Sensing LabsA 4-20ma Output: No Cayenne Widget


#1

Hi All,

I need your help regarding the following issue.

I have a LORA Sensing Labs Radio Transmitter 4-20ma connected to a water pressure.
I am using TTN and Cayenne tool to show the pressure graph in bar…

The customer Uplink Data received by TTN Tool is as follow:
00 F9 8E 01 9C 10 05 D1
2nd byte: Battery level = (FE) 249/254 = 98%
Last two bytes are Current = 05D1 => (suppressed in 1/200ma)

I have decoded and converted 05D1 using TTN Payload Format function to a pressure value xxx bar.

My question, how can I get the pressure values in a Cayenne widget?
Do I need to convert the last 4x byte to Cayenne LPP Format like 05 73 “pressure value in Hex

In my actual situation I can see only SNR, RSSI, Battery and current in milliampere widgets in cayenne tool

Your help is very appreciated?

Best Regards,
Ennabih


#2

Hi @ennabih,

Can you share the DevEui of your device?
I can take a look from our side & see if it’s decoding the payload properly.
If not, that could explain why the pressure widget is not working.

Thanks.
-Jesse


#3

HI Jesse,

Thank you for the e-mail!

Yes, with great pleasure. Here is the DevEui:
70B3D580A0104C03.

Thank you in advance for your help!
Best Regards,

Ennabih


#4

Hi @ennabih,

Based on the payload you’re sending, this is how we’re decoding it:

[
    {
        "channel": 1,
        "type": "batt",
        "unit": "p",
        "value": 98,
        "name": "Battery"
    },
    {
        "channel": 2,
        "type": "current",
        "unit": "a",
        "value": 7.445,
        "name": "Current"
    }
] 

Can you confirm if this is what you’re to expect?
If not, our “decoder” is not translating all the data that is in the payload transmitted to us.

Thanks.
-Jesse


#5

Hi Jesse,

Yes, this is correct, these values belong the Sensing Labs A 4-20ma transmitter which is connected to water pressure.

For my Test:

The Current value 7.445 A needs to be converted to hPa or bar and associated to Graph (widget).

I have decoded the current value 7.445 A (Bytes 7 and 8) and converted the result to bar…hPA

_var decoded = (((bytes[6] << 8) | bytes [7]));

var procent = ((decoded/200)-4)*100/16; //convert milliampere to procents (4ma-20ma)

var pressure = procent*3+10; //convert to bar (10bar-400bar)_

*return {

pressure+ ‘bar’,*

And I don´t know how to associate the result to Cayenne widget;-)?

X SCALE: 0ma => 10bar, 20ma => 400bar

Y SCALE: 10…400bar

Is it possible to that in Cayenne tool?

Thanks!

Best Regards,

Ennabih


#6

Hi @ennabih,

The best approach would be to modify the device’s payload, to send in our Cayenne LPP format, so you can get the data to show up in hPa. Then add your device on Cayenne as a LPP device.

You can read more about the available LPP Data Types here: https://mydevices.com/cayenne/docs/lora/#lora-cayenne-low-power-payload-data-types

Let me know if this works for you.
Thanks.
-Jesse


#7

Hi Jesse,

I wascontacting Sensing Labs Support team, unfortunately it´s not possible to modify the Senlab payload format. This is a standard format;-)

Is it possible to add either one more widget which will automatically do the required convertion (like we did in TTN decoder -> Decoder/Converter Function)?

Or if you can add possibility to modify incomming data before they are shown in widget and stored into Database?

Thanks!

Best Regards,

Ennabih


#8

Hi @ennabih,

Unfortunately, there’s no option on the Cayenne side to modify the payload or data coming in. Best option would be to do conversion before it is sent to Cayenne. Just follow the Cayenne LPP format & it should show up on Cayenne based on that. Unfortunately, we currently do not support reading the TTN data that comes from the Payload decoder.

Thanks.
-Jesse


#9

Hi Jesse,

Thanks, I will try to find a way to do that.

Best Regards,
Ennabih