sendBatteryLevel: wrong nodeId?
-
Hi.
My battery powerd sensor node is connected to OpenHAB via mqtt/ethernet gateway. The switch works well in OpenHAB. But not the battery level.
For testing every time the switch changed a hardcoded value of "77" is send after the switch message.
Log MQTT-Gateway:
Started!
0;0;3;0;9;read: 26-26-0 s=4,c=1,t=16,pt=2,l=2:0
0;0;3;0;9;read: 26-26-0 s=255,c=3,t=0,pt=1,l=1:77
0;0;3;0;9;read: 26-26-0 s=4,c=1,t=16,pt=2,l=2:1
0;0;3;0;9;read: 26-26-0 s=255,c=3,t=0,pt=1,l=1:77
The PC-MQ-Client MQTT.fx also only shows the switch messages.
The nodeId is 4. Why is there "255" in line 2 and 4? Or is this OK?
-
bump
I also wonder what the S, T, PT & L values stand for..
i see them coming and going but never understood what they are here forhappy new year!
-
s=child-sensor-id,
c=message-type
t=sub-type
pt=payload-type (see MyMessage.h)
l=payload lengthYou will understand it better if you have a look at the code:
https://github.com/mysensors/Arduino/blob/master/libraries/MySensors/MyMessage.h#L175
https://github.com/mysensors/Arduino/blob/master/libraries/MySensors/MySensor.cpp#L273
https://github.com/mysensors/Arduino/blob/master/libraries/MySensors/MySensor.cpp#L220
-
@hek
Thanks for reply.
I know the meaning of "s". But I was wondering about the value "255". Is this OK? I think it should be "4" - the value of "CHILD_ID" in my sketch.
-
sensor id is not the same as node id.
sensor id = 255 is used for internal stuff like id request and battery level for node. You can assign 0-254 to your own attached sensors (to the arduino node).
Suggested Topics
-
Mysensors - Keep alive / LWT (last will, testament)?
General Discussion • 25 Aug 2015, 08:10 • ahhk 25 Aug 2015, 10:41 -
MQTT Client Gateway
My Project • 3 Feb 2015, 10:37 • b0rmann 14 Apr 2015, 03:47 -
Node Child and MQTT Subscribe
Development • 16 Jan 2015, 15:28 • Gambituk 17 Jan 2015, 14:11 -
processing incoming MQTT messages to actuate gateway local relay / variable.
Troubleshooting • 12 Nov 2016, 22:59 • Meshx86 13 Nov 2016, 16:40 -
OpenHAB Mysensors binding 2.4: cant get mqtt gateway online
Troubleshooting • 21 Jan 2019, 20:51 • jimmy loyens 21 Mar 2019, 02:32 -
Raspberry PI + MQTT (Mosquitto) + Serial Gateway
General Discussion • 14 Feb 2015, 06:12 • catcher 2 Mar 2017, 17:58 -
Switching from v1.5 MQTT gateway to ESP8266 MQTT Client gateway
OpenHAB • 1 Feb 2016, 18:41 • mbj 8 Mar 2016, 22:07 -
MySensors MQTT gateway and serial rs485 sensor node communication
Development • 5 Aug 2017, 06:31 • ehome 5 Aug 2017, 08:15