Home Assistant Blueprint: Sonoff Detached Lights
| blueprint: | |
| name: Sonoff Detached Lights | |
| description: > | |
| Keep a light synchronized with the state of a detached Sonoff switch. | |
| domain: automation | |
| author: Rui | |
| input: | |
| switch_entity: | |
| name: Detached switch | |
| selector: | |
| entity: | |
| filter: | |
| - domain: switch | |
| light_target: | |
| name: Corresponding light | |
| selector: | |
| target: | |
| entity: | |
| - domain: light | |
| triggers: | |
| - trigger: state | |
| entity_id: !input switch_entity | |
| from: "off" | |
| to: "on" | |
| - trigger: state | |
| entity_id: !input switch_entity | |
| from: "on" | |
| to: "off" | |
| actions: | |
| - action: >- | |
| {% if trigger.to_state.state == "on" %} | |
| light.turn_on | |
| {% else %} | |
| light.turn_off | |
| {% endif %} | |
| target: !input light_target | |
| mode: restart |
评论
?
参与讨论