Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Bug Reports
  3. sendBatteryLevel: wrong nodeId?

sendBatteryLevel: wrong nodeId?

Scheduled Pinned Locked Moved Bug Reports
nodeidmqttsendbatteryleve
5 Posts 3 Posters 2.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • XanderX Offline
    XanderX Offline
    Xander
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      diamantmatch
      wrote on last edited by
      #2

      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 for ;)

      happy new year!

      1 Reply Last reply
      0
      • hekH Offline
        hekH Offline
        hek
        Admin
        wrote on last edited by
        #3

        s=child-sensor-id,
        c=message-type
        t=sub-type
        pt=payload-type (see MyMessage.h)
        l=payload length

        You 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

        XanderX 1 Reply Last reply
        0
        • hekH hek

          s=child-sensor-id,
          c=message-type
          t=sub-type
          pt=payload-type (see MyMessage.h)
          l=payload length

          You 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

          XanderX Offline
          XanderX Offline
          Xander
          wrote on last edited by
          #4

          @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.

          1 Reply Last reply
          0
          • hekH Offline
            hekH Offline
            hek
            Admin
            wrote on last edited by
            #5

            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).

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            27

            Online

            11.7k

            Users

            11.2k

            Topics

            113.1k

            Posts


            Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • MySensors
            • OpenHardware.io
            • Categories
            • Recent
            • Tags
            • Popular