Home Assistant | Toggle Automation with Switch

  • Hey guys. I have the following setup causing issues:

    Shelly 1
    • Light switch attached to (SW)
    • GU5.3 LED array attached to (O)
    • Motion sensor logically attached via Home Assistant automation

    The desired outcome would be to be able to toggle the automation itself ie:

    • to have the light go on and off automatically (according to the motion detection rules defined in Home Assistant) when the switch is set to ON

    • for the lights and the automation to stay off at all times if I toggle the switch which runs of (SW) to OFF

    In reality, the motion sensor will either always trigger the lights to turn on, or they will always stay off.

    I have tried to run the Shelly with:

    Button Type DETACHED with Power on Default Mode SWITCH as well as

    Button Type TOGGLE SWITCH with Power on Default Mode SWITCH

    Can anyone please tell me how to get fix this?


    Thanks for you help!

  • The issue is in your automation in HA. You have to have an and statement in there. IF the switch is on AND there is motion THEN turn on light. The switch would be DETACHED and used independently within HA as a binary sensor. With the switch on, any motion would activate the light on, when motion is not seen, then the light will turn off. Further, if the switch is switch off the light would turn off immediately. But be careful with mothion sensors, sometimes a second automation to set a timer is nice to have if the motion clears too quickly.