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. Development
  3. Standalone lights controll / controller-independent node

Standalone lights controll / controller-independent node

Scheduled Pinned Locked Moved Development
6 Posts 5 Posters 2.5k Views 4 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.
  • D Offline
    D Offline
    dakipro
    wrote on last edited by dakipro
    #1

    Hi,
    I built few sensors and installed domoticz on old laptop and life is good.
    I will now MySensorify all the lights in the house, but I would like to be free to update/restart/replace laptop and controller if needed, without braking the lights functionality (because first time lights do not work as advertised, my wife will have me revert to regular switches).

    This is where my "brilliant" plan of decentralizing light controller comes in. I am planning to build one "light controller" node that will receive messages from all the switches in the house, and send appropriate commands to all the lights.

    Lights controll node.jpg

    Also controller will have communication with the lights to show their status, or to update them on some "smart" events.
    So logic would be like:

    1. LightSwitch1 sends "clicked", or "double clicked" event to the "Lights control node"
    2. "Lights control node" then has some if/else logic where it will figure out which switch was clicked and then
    3. it will send appropriate command to some (or all the lights)
    4. Lights then send current status to the main Domoticz controller

    Disadvantage is that when adding a new light or new switch I would have to reprogram the "Lights control node", which will not happen that often.
    But the huge advantage is that this node is controller independent and will work fast and reliably. It will also improve response time as now I get almost 1s lag from domoticz before it turns lights on.

    I am also planning to have a bit advanced "clicks" on the switches, such as "hold 2s -> turn on/off all the lights", "double click -> turn only floor lights on" etc.. This doesn't have to be in the "Lights control node" as it is not that mission-critical

    What do you think about this design, did someone implemented something similar? Some tips about the design and the code?
    How should I communicate messages between switches and lights controller and lights? Some code tips?

    Thank you all for making this awesome library/project, I love it!

    Edit: Changed the title from "Decentralized" to Standalone

    C: OpenHAB2 with node-red on linux laptop
    GW: Arduino Nano - W5100 Ethernet, Nrf24l01+ 2,4Ghz mqtt
    GW: Arduino Mega, RFLink 433Mhz

    1 Reply Last reply
    0
    • m26872M Offline
      m26872M Offline
      m26872
      Hardware Contributor
      wrote on last edited by m26872
      #2

      High risks are involved when it comes to the WAF aspect. "One light controller node" doesn't sound very decentralized to me. There would still be some level of complexity and just move the single point of vulnerability. I like the interface to any type of controller to be as safe and simple, independent, separated and distributed as possible. The button/switch to light/actuator connection should be wired and override everything else.
      A "lights control node" could be an intermediate level in such system. And particularly good if it offloads your controller as you say.

      1 Reply Last reply
      0
      • Luke CorkillL Offline
        Luke CorkillL Offline
        Luke Corkill
        wrote on last edited by
        #3

        Sounds interesting and useful.
        Does the MySensors protocol already support node to node communications? I have a similar decentralised desire to sound a buzzer when a motion detector is activated.

        fetsF 1 Reply Last reply
        0
        • Luke CorkillL Luke Corkill

          Sounds interesting and useful.
          Does the MySensors protocol already support node to node communications? I have a similar decentralised desire to sound a buzzer when a motion detector is activated.

          fetsF Offline
          fetsF Offline
          fets
          wrote on last edited by fets
          #4

          @Luke-Corkill I think you can setDestination on MyMessage object before sending it :
          msg.setDestination(id_destination_node);
          Then send message
          gw.send (msg) ;

          1 Reply Last reply
          0
          • D Offline
            D Offline
            dakipro
            wrote on last edited by dakipro
            #5

            @m26872 I agree with you about the wired connection, unfortunately in the apartment I rent now we have one switch in the middle of the apartment that controls five light bulbs in two different rooms (don't ask why), so running the cables trough whole apartment is just not practical. Which is the main reason I am motivated to MySensorify it all, it takes too much walking around for the light switch and too much hitting the door and the cat in the night.

            @fets Exactly, I found that method/setter in API and got inspired to go around/parallell of the controller.
            The sketch logic would be then:
            -- Switches
            On Click: sends message to Lights Control Node with its SwitchNodeID and SwitchAction (NodeID is sent automatically if I read API right?)

            -- Ligts Control Node
            On Message Received:

            1. Do some if else based on the SwitchNodeId and SwitchAction and
            2. send "Toggle" message to desired light or group of lights. (Right now I am a bit concerned whether to send the toggle message or on/off, as controller can get lights out of sync by running some automatic script. Not sure how to handle this yet, probably by always running some lights in the group-only (living room lights, bedroom etc))

            -- Light nodes
            On Message Received (both from "Lights control node" and domoticz): do what it says in the message and report your status back to domoticz.

            I just started with MySensors and arduino programming (I do some programming in php). I will have some time now during the hollidays to play around, but do you guys see any challenges in this code and design logic? Something that could be difficult/impossible due to some design or code limitations?

            I guess switches and the Lights control node need to be presented to the gateway and the controller, which can then just ignore them.

            Also, which message should I send from switches and Lights control node, S_LIGHTS or some custom variable?

            Does anyone have some example of node-to-node communication and sending the messages between?
            I think I saw something on the forum about weather station but I cannot find it now

            C: OpenHAB2 with node-red on linux laptop
            GW: Arduino Nano - W5100 Ethernet, Nrf24l01+ 2,4Ghz mqtt
            GW: Arduino Mega, RFLink 433Mhz

            1 Reply Last reply
            0
            • S Offline
              S Offline
              Stuart Middleton
              wrote on last edited by
              #6
              This post is deleted!
              1 Reply Last reply
              0
              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