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
-
thethingbox
General Discussion • 12 Feb 2015, 01:00 • gregl 21 Feb 2015, 02:24 -
OpenHab, MQTT gateway and Battery level - how?
OpenHAB • 17 Dec 2014, 16:49 • doctor64 8 Jan 2015, 22:12 -
Openhab2 + MySensors MQTTClientGateway + discovery
Development • 22 Sept 2016, 15:30 • CrankyCoder 22 Sept 2016, 18:47 -
ESP8266MQTTClientGateway
Bug Reports • 30 Jan 2016, 10:26 • mbj 30 Jan 2016, 14:16 -
💬 MqGateway
OpenHardware.io • 16 Mar 2021, 20:15 • openhardware.io 31 Aug 2022, 20:18 -
testing with different controllers (mqtt brokers)
Controllers • 4 Jan 2023, 16:48 • OldSurferDude 5 Jan 2023, 07:26 -
[SOLVED] ESP8266MQTTClientGateway problem
General Discussion • 24 Jan 2016, 19:32 • mbj 26 Jan 2016, 21:29 -
ESP8266 crashes while starting up and receiving a message from node
General Discussion • 17 Jan 2018, 19:45 • Abdu Sahin 18 Jan 2018, 22:36