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 3.3k 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.
  • X Offline
    X 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
      • H Offline
        H 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

        X 1 Reply Last reply
        0
        • H 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

          X Offline
          X 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
          • H Offline
            H 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

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            18

            Online

            12.0k

            Users

            11.2k

            Topics

            113.4k

            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