How to build an overridable MySensors relay based device (e.g. lamp with manual switch)



  • Hi all,

    I finally got my first MySensors lamp working, controlled via OpenHab2.

    My goal is to replace a couple of timers that we use either on vacation or when we have Christmas lights up with MySensors devices in the longer run.

    In order to get wife approval factor, lamps need to be able to be manually switchable too. She doesn't want to have to get her phone out to turn the lamp on at odd times of day.

    So far I have 2 ideas for indoor lights, and I'd like to know which one of these seems more sensible.

    1. Have a switch attached to the lamp cord (replacing the existing switch) with 2 wires running to the smart plug I'm building. This would change the state of the relay and send a message to OpenHab reflecting this change.
    2. Have a completely separate switch, battery powered, attached somewhere near the lamp being controlled. This would include an RF24 radio and act as a control for the lamp.

    Option 1 would be cheaper, but have ugly wires running along the lamp wires.

    Option 2 seems like it would be harder to miniaturize and power for longer periods of time.

    Are there other options that I'm missing ?

    What would you do ?


  • Mod

    @anonymouslemming power is not a problem. The node would sleep as long as someone isn't pressing the switch. You should get 10 years battery life with 2xAA. If you want to make it smaller, use 2xAAA or something like cr123.


  • Mod



  • @mfalkvidd Ok, that's great then - sounds like Option 2 is the way to go.

    Now to try and work out how to have a press event on one node trigger the on/off on another node via OpenHAB.

    Are you aware of any examples like that ?


  • Mod

    @anonymouslemming sorry I don't use OpenHab.


  • Hero Member

    @anonymouslemming said in How to build an overridable MySensors relay based device (e.g. lamp with manual switch):

    In order to get wife approval factor, lamps need to be able to be manually switchable too. She doesn't want to have to get her phone out to turn the lamp on at odd times of day.

    A local control is a very good idea for most internal lights.

    So far I have 2 ideas for indoor lights, and I'd like to know which one of these seems more sensible.

    1. Have a switch attached to the lamp cord (replacing the existing switch) with 2 wires running to the smart plug I'm building. This would change the state of the relay and send a message to OpenHab reflecting this change.
    2. Have a completely separate switch, battery powered, attached somewhere near the lamp being controlled. This would include an RF24 radio and act as a control for the lamp.

    Option 1 would be cheaper, but have ugly wires running along the lamp wires.

    This option will give the most reliable control of the light. If the light is in any way critical to normal day to day use then it is the only option that will give guaranteed control of the light.

    Option 2 seems like it would be harder to miniaturize and power for longer periods of time.

    This is a good choice if the light needs to be turned on as you enter the room, just like a normal room light requires.
    The switch @mfalkvidd has pointed you to is a good example of this.

    The down side is you have a lot of places where instability can enter the system. If either of the two nodes loose their connection the light will not work. If your Gateway is down the light will not work. If your controller is down the light may not work. From experience I can tell you the WAF can drop very quickly if a light that is used daily does not work first time every time!

    Are there other options that I'm missing ?

    There may be other ways to achieve your goal. You could for example use a more novel approach like gesture control or perhaps a knock or clap sensor.

    I have used the cheap X10 stick on battery powered wall switches in some areas but these need extra work to interface into the MySensors network.

    Now to try and work out how to have a press event on one node trigger the on/off on another node via OpenHAB.

    Do you need this to go through your controller? Usually the best way to treat a remote switch is to use direct node to node communication.

    Perhaps you can give us a better idea of the physical layout of your setup, this may help us to suggest a more specific solution.



  • @Boots33 said in How to build an overridable MySensors relay based device (e.g. lamp with manual switch):

    Do you need this to go through your controller? Usually the best way to treat a remote switch is to use direct node to node communication.

    The reason I was considering going via the controller is so that the controller stays in sync. My worry with communicating directly with the node is that then the controller will think that the light is on, when it's off, or vice versa.

    Perhaps you can give us a better idea of the physical layout of your setup, this may help us to suggest a more specific solution.

    For the initial prototype, it's a lamp that sits in the far corner of the lounge. Control is currently the in-line switch on the lamp cable. I'd like to place the local control switch somewhere near it, if not on the cable, then on the bookcase that the lamp sits on.

    The ethernet gateway is about 5m away from this switch and plug socket, with the controller running on a VM on the same ethernet network.


  • Hero Member

    @anonymouslemming said in How to build an overridable MySensors relay based device (e.g. lamp with manual switch):

    The reason I was considering going via the controller is so that the controller stays in sync. My worry with communicating directly with the node is that then the controller will think that the light is on, when it's off, or vice versa.

    You can still notify the controller of the change but use node to node to activate the light. This is usually the simplest way to go. It also has the advantage that even if the controller is not available the light will still switch.

    Like i said having the switch connected to the node that controls the light is the most reliable way, but not always the most convenient.

    For the initial prototype, it's a lamp that sits in the far corner of the lounge. Control is currently the in-line switch on the lamp cable. I'd like to place the local control switch somewhere near it, if not on the cable, then on the bookcase that the lamp sits on.

    The ethernet gateway is about 5m away from this switch and plug socket, with the controller running on a VM on the same ethernet network.

    Where is the node that will control the light going to be. Are you fitting it inside the lamp or is it to be external?

    You may get some ideas from these posts

    AC-DC double solid state relay module

    Synchronising Light switch

    AC Power controller with node to node remotes

    Outdoors Touch Switch light controller



  • @Boots33 said in [How to build an overridable MySensors relay based device

    You can still notify the controller of the change but use node to node to activate the light. This is usually the simplest way to go. It also has the advantage that even if the controller is not available the light will still switch.

    Ok - I'll look into that.

    Like i said having the switch connected to the node that controls the light is the most reliable way, but not always the most convenient.

    The node is going to be in a plug socket type device instead of in the lamp in some way. The lamp will plug into this socket. So I can't work out a way to conveniently have the local switch attached to that without being quite ugly and ungainly.

    Where is the node that will control the light going to be. Are you fitting it inside the lamp or is it to be external?

    It'll be external - built into a plug socket. I figured that gives me more space to work, much like the X10 equipment I'm replacing.

    You may get some ideas from these posts

    AC-DC double solid state relay module

    Synchronising Light switch

    AC Power controller with node to node remotes

    Outdoors Touch Switch light controller

    Thanks - I'll have a look over those !



  • This post is deleted!

Log in to reply
 

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.