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
-
ESP8266 Gateway start without WiFi connection
Troubleshooting • 17 Nov 2017, 11:26 • LeoDJ 17 Nov 2017, 11:26 -
MQTT unsure of relay state
Troubleshooting • 16 Jul 2016, 13:23 • Samuel235 16 Jul 2016, 13:23 -
MySensorsTracker - a simple logger for MySensors MQTT messages
My Project • 5 Aug 2021, 08:44 • canyouhearmenow 1 Nov 2021, 15:18 -
Need help with Turning a LED On/Off with OpenHab and MQTT.
Troubleshooting • 24 Mar 2015, 19:19 • kunall 29 Mar 2016, 14:33 -
Battery level to openHAB
OpenHAB • 20 Jan 2015, 19:25 • bomber 20 Jan 2015, 21:06 -
MQTT Client Gateway / Node Controller / OTA
Hardware • 19 Jul 2016, 15:01 • CrankyCoder 26 Jul 2017, 13:32 -
NodeId, ChildId and EEPROM
Troubleshooting • 30 Sept 2014, 20:21 • nono056 30 Sept 2014, 20:21