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. Feature Requests
  3. Can a node request a status from other node?

Can a node request a status from other node?

Scheduled Pinned Locked Moved Feature Requests
3 Posts 3 Posters 58 Views 3 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.
  • joaoabsJ Offline
    joaoabsJ Offline
    joaoabs
    wrote on last edited by
    #1

    Hello,

    I'd like to have a "6 button node" that will control lights (in other nodes). Since some lights are far away (not visible), I'm thinking in putting there a led just to signal if the light is currently on or off.

    For this to happen, I guess I'll have to request the status of each light every time a button is pressed (or pool it every 10m or so).

    Is this possible? How?

    Thanks

    mfalkviddM 1 Reply Last reply
    0
    • joaoabsJ joaoabs

      Hello,

      I'd like to have a "6 button node" that will control lights (in other nodes). Since some lights are far away (not visible), I'm thinking in putting there a led just to signal if the light is currently on or off.

      For this to happen, I guess I'll have to request the status of each light every time a button is pressed (or pool it every 10m or so).

      Is this possible? How?

      Thanks

      mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by
      #2

      @joaoabs yes it is possible. There are multiple threads in the forum. The documentation for how to request information is available at https://www.mysensors.org/download/sensor_api_20#requesting-data and just above that section is information on how to make a node respond to the request.

      1 Reply Last reply
      0
      • BearWithBeardB Offline
        BearWithBeardB Offline
        BearWithBeard
        wrote on last edited by BearWithBeard
        #3

        While it would be possible via request() as @mfalkvidd suggests, I wouldn't recommend to do that in this case. I think it's rather pointless to regularly request variables which only change rarely. It adds a lot of traffic to the network - at least 4 messages (including echos) per request - while the requested values stay unchanged 98% of the time or so. Not to mention that the status LEDs could show a wrong condition for up to 10 minutes if you toggle a light switch right after its state has been requested.

        I'd suggest to use one of the following alternatives instead:

        1. You could have the light nodes send messages to both the gateway and the node with the status LEDs. The status LEDs would update immediately when a light is toggled and there's a lot less unnecessary traffic on the network.

        2. Let the controller handle the logic. Whenever a light node sends a state change to the gateway, tell the controller to send a message to the node with the status LEDs. This method has the same benefits as the one before and it's easier maintainable since you don't need to re-upload sketches to multiple nodes if something changes - just reconfigure a script in your controller.

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


        17

        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