- alias: Turn off electronics
initial_state: 'on'
trigger:
platform: state
entity_id: device_tracker.hostname1
to: 'Away'
action:
- service: switch.music_upstairs
data:
entity_id: remote.harmony_hub
activity: 'PowerOff'
Eventually i want to turn off all electronics but for now it sould just turn off my switch (harmony activity), is there a reason why this doesn’t work?
Instead of guessing what the state should be, if you go to your states page and look for the device_tracker entity, look at its history and see what the state changes to. Automations are case sensitive I believe, so make sure it’s all lower case if that’s what it shows on the states page.
Your harmony activity service isn’t correct. Turning on any harmony activity requires the remote.turn_on service, even if you are using the PowerOff activity. Harmony is weird.
- alias: Turn off electronics
trigger:
- platform: state
entity_id: device_tracker.hostname1
to: 'not_home'
action:
- service: remote.turn_on
data:
entity_id: remote.harmony_hub
activity: 'PowerOff'