Hi!
I have a Sony TV connected to a tplink smart plug (HS110) that automatically switchs off after the harmony hub sends PowerOff.
Problem is when i start an activity, i have three different activities, for the first time after Power Off State. The plug switchs on but i cant get the harmony hub to select the right input because the tv needs 27s to boot up. Delays on harmony hub doesnt work really good so i need to rely on HA to do it.
Actually i need this to only happen when starting an activity for the first time and not while switching between them. So when the switch powers on i need to check the activity that is on and add a delay and then send a command to the tv
- alias: Set TV Switch ON
trigger:
platform: state
entity_id: remote.salita
from: 'off'
to: 'on'
condition:
condition: template
value_template: "{{ states.remote.salita.attributes.current_activity != 'PowerOff' }}"
action:
- condition: state
entity_id: switch.enchufesalon
state: 'off'
- service: switch.turn_on
entity_id: switch.enchufesalon
This code works, but i cant get to go the second part of checking the activity and sending the command. Know that sending the command is
service: remote.send_command
data_template:
command: InputHdmi3
device: 70049580
entity_id: remote.salita
But im lost at how to code the conditions and ifs.