I want to use the current activity for showing the state of a templateswitch.
with a Sensor i can get the actual activity via:
states.remote.harmony.attributes.current_activity
But the switch wont turn On with this lines, what is false?
- platform: template
switches:
fernseher:
value_template: "{% if is_state('states.remote.harmony.attributes.current_activity', 'Fernsehen') %}on{% else %}off{% endif %}"
turn_on:
service: remote.turn_on
entity_id: remote.harmony
data:
activity: "23292532"
turn_off:
service: remote.turn_off
entity_id: remote.harmony
Thanks for your help!