My nightstand lights are connected to a surge protector plugged into a Zigbee smart plug plugged into a dumb wall outlet controlled by a single dumb wall switch.

I have the smart plug set to default=On, so the wall switch works fine, and I can also turn the lights off from my phone or via an automation. All good so far.

What I WANT is to be able to turn the lights ON without getting out of bed, and irrespective of the position of the switch.

I tried putting a second smart plug in the switch-controlled outlet and making an automation to toggle the surge protector’s smart plug when the switch’s empty smart plug powers off/on via the wall switch, but it looks like it’s not simple to detect a Zigbee device “disappearing”. I found some integrations that detect zigbee devices disappearing, but those seemed more for running health checks to detect and repair moved devices than for live detection.

Any suggestions?

Edit:

Looks like a relay behind the switch will be my best bet. Thank you all!

  • Clay_pidgin@sh.itjust.worksOP
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 days ago

    That’s probably possible, but doesn’t solve my problem. That said, some commentors found my explanation confusing.

    When the switch is toggled ON, I want the lights to go ON.

    When the switch is toggled OFF, I want the lights to go OFF.

    Irrespective of the switch position, I want to be able to turn the lights ON or OFF with Home Assistant.

    It sounds like a zigbee relay behind the switch will be the way to detect the switch position.

    • eddiereasoner@lemmus.org
      link
      fedilink
      English
      arrow-up
      3
      ·
      2 days ago

      I don’t think a relay would work because it wouldn’t let you turn the lights off without getting up, and would make it so the switch won’t turn the lights off without turning of the relay from your phone.

    • FrederikNJS@piefed.zip
      link
      fedilink
      English
      arrow-up
      3
      ·
      edit-2
      2 days ago

      @eddiereasoner@lemmus.org might actually be on to something…

      Depending on the wall switch you have, you might be able to add a spring that makes it always return to the previous position when released. At least the switches I have in my house have a special little socket for adding a spring.

      So in your Zigbee control panel you would configure the “power on behaviour” of the smart light/socket to “toggle”.

      Then I you would add the spring inside your physical switch.

      Now when you press the switch it would cut the power to the light/socket briefly, and as soon as you release the switch the power would be restored.

      If the light/socket is on, you press and release the switch, which cuts the power and the light/socket stays off due to the “toggle” behaviour.

      If the light/socket is off, the light/socket is still powered, soo you can still turn it on via Zigbee, and if you pres the switch, it momentarily cuts the power and the toggle behaviour would now make if turn on.

      This gives you basically the same behaviour as if you installed a relay, but if you use smart bulbs you gain the benefit of being able to control the brightness, color temperature, and hue, if it has those controls

      • Clay_pidgin@sh.itjust.worksOP
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 days ago

        The second one that I attempted to use as a switch position detector, you mean? Because I think I’d still need the one in the un-switched outlet to turn the lights on and off.

        • paks@feddit.uk
          link
          fedilink
          English
          arrow-up
          2
          ·
          2 days ago

          A lot of relay boxes will both detect the switch position and toggle the power, so you should be able to get rid of all smart plugs that you were planning to use for this light.

          The relay should have these connections:

          • Live input from breaker box
          • Neutral (both from breaker box and to socket)
          • Switched live output to socket
          • Connection to one side of the manual switch
          • Connection to the other side of the manual switch
          • Clay_pidgin@sh.itjust.worksOP
            link
            fedilink
            English
            arrow-up
            1
            ·
            1 day ago

            Ah, so it would disconnect the physical switch from the circuit except as an IRL input for the HA relay entity ! That does sound perfect.

    • eddiereasoner@lemmus.org
      link
      fedilink
      English
      arrow-up
      2
      ·
      2 days ago

      My point is, you would keep the switch on no matter what and flick it off and on again when switching the lights on/off