Automation with physically turned off Lamps

Hey Community :slight_smile:
I wanted to make an automation that mirrors thr state of a phillips hue bulb I have to a WeMo power socket. It works fine if I turn the hue lamp on/off with the app or alexa voice command.

But here is the problem, the hue bulb is still on a physical switch and if I turn the bulb off manually the state of the lamp switches to off in hassio but the automation trigger (if bulb changes state from “ON” to anything (left it blank)) doesnt trigger and the wemo socket is still active. Is there anyway I can fix this?

Thank you :slight_smile:

Remove or replace the physical switch?

1 Like

is not possible atm (rented home), there must be a solution anywhere? since hassio gets the information that the lamp went offline/switched off :slight_smile:

Unless you set up a scanning sensor that assumes the lamp is off if unreachable, I am not sure how you could do this.

What have you tried so far?

1 Like

first let me thank you for your fast replies, appreciate it :slight_smile:
tbh I havn’t tried much, I hoped it would be as easy as making the automation. There is no state (like ON and OFF) for devices that are offline right? for example if hue_bulb is “offline” do turn_on_switch ?

A template sensor may work. Just a guess though. You may have the sensor tell HA the light is off.

1 Like

thank you very much, it worked :slight_smile: the is_state function was all it took :slight_smile:

here is my sensor template for anyone interested:

sensor:

  • platform: template
    sensors:
    kuchensensor:
    value_template: <-
    {{ is_state(‘light.kuche_2’, ‘on’)}}