I’d like to use template in order to merge these automations into one.
Basically, when i turn off the desktop the switch goes off (and the opposite if PC is turned on).
Thanks
- id: SpegniLuceStudio
alias: Spegni luce studio se PC off
trigger:
entity_id: device_tracker.saradesktop
platform: state
from: home
to: not_home
action:
- service: switch.turn_off
data:
entity_id: switch.plug_158d0001bc2dbe
- id: AccendiLuceStudio
alias: Accendi luce studio se PC on
trigger:
entity_id: device_tracker.saradesktop
platform: state
from: not_home
to: home
action:
- service: switch.turn_on
data:
entity_id: switch.plug_158d0001bc2dbe