Desk lamp automation
This commit is contained in:
parent
aca29db464
commit
daef10270e
31
packages/computers.yaml
Normal file
31
packages/computers.yaml
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
binary_sensor:
|
||||||
|
- platform: mqtt
|
||||||
|
state_topic: "computer/arrakis/on"
|
||||||
|
name: Arrakis
|
||||||
|
|
||||||
|
automation:
|
||||||
|
- alias: Desk lamp follows computer
|
||||||
|
trigger:
|
||||||
|
- platform: state
|
||||||
|
entity_id: binary_sensor.arrakis
|
||||||
|
to: "on"
|
||||||
|
for:
|
||||||
|
hours: 0
|
||||||
|
minutes: 0
|
||||||
|
seconds: 1
|
||||||
|
- platform: state
|
||||||
|
entity_id: binary_sensor.arrakis
|
||||||
|
to: "off"
|
||||||
|
for:
|
||||||
|
hours: 0
|
||||||
|
minutes: 0
|
||||||
|
seconds: 1
|
||||||
|
action:
|
||||||
|
service_template: >-
|
||||||
|
{% if trigger.to_state.state == 'on' %}
|
||||||
|
light.turn_on
|
||||||
|
{% else %}
|
||||||
|
light.turn_off
|
||||||
|
{% endif %}
|
||||||
|
data:
|
||||||
|
entity_id: light.skrivbordslampa_1
|
Loading…
x
Reference in New Issue
Block a user