Hello again!
I would like to make four automations for Harmony, but I can’t get them to work
FIRST automation:
- Power on
- If and only if a particular activity is active and the sun has set
- Change scene.
SECOND automation:
- shutdown
- if and only if a particular activity is active and the sun has set
- change scene
THIRD automation:
- Power on
- if and only if one of the listed activities is active
- change scene
FOURTH automation:
- shutdown
- if and only if one of the listed activities is active
- change scene
- wait 10 minutes
- turn off a plug
It doesn’t change my scene …
where am i wrong?
my code:
#FIRST#
- alias: kodi soggiorno off
trigger:
- entity_id: remote.harmony_soggiorno
platform: state
to: 'off'
condition:
- condition: state
entity_id: sun.sun
state: below_horizon
- condition: template
value_template: '{{ trigger.to_state.attributes.current_activity == "Watch Kodi" }}'
action:
service: scene.turn_on
entity_id: scene.soggiorno_normale
id: 683f8418b2b349e9a81bfbd03972b007
#SECOND#
- alias: kodi soggiorno on
trigger:
- entity_id: remote.harmony_soggiorno
platform: state
to: 'on'
condition:
- condition: state
entity_id: sun.sun
state: below_horizon
- condition:template value_template:'{{ trigger.to_state.attributes.current_activity == "Watch Kodi" }}
action:
service: scene.turn_on
entity_id: scene.soggiorno_spenta
id: 82eae7d823e443febdac6d78bc835baa
#THIRD#
- alias: taverna off
trigger:
- entity_id: remote.harmony_taverna_2
platform: state
to: 'off'
condition:
condition: or
conditions:
- condition: template
value_template: '{{ trigger.to_state.attributes.current_activity == "Project Kodi" }}'
- condition: template
value_template: '{{ trigger.to_state.attributes.current_activity == "Project Kodi 2" }}'
- condition: template
value_template: '{{ trigger.to_state.attributes.current_activity == "Project Wii" }}'
- condition: template
value_template: '{{ trigger.to_state.attributes.current_activity == "Project Xbox 360" }}'
- condition: template
value_template: '{{ trigger.to_state.attributes.current_activity == "Project Retro Console" }}'
- condition: template
value_template: '{{ trigger.to_state.attributes.current_activity == "Projector" }}'
action:
- service: scene.turn_on
entity_id: scene.taverna_normale
- delay: 00:10:00
- service: switch.turn_off
entity_id: switch.accessory_mss310_main_channel
- service: switch.turn_off
entity_id: switch.media_center_mss310_main_channel
id: ef238f31c77346f18e3dc4678beb65c0
#FOURTH#
- alias: taverna on
trigger:
- entity_id: remote.harmony_taverna_2
platform: state
to: 'on'
condition:
condition: or
conditions:
- condition: template
value_template: '{{ trigger.to_state.attributes.current_activity == "Project Kodi" }}'
- condition: template
value_template: '{{ trigger.to_state.attributes.current_activity == "Project Kodi 2" }}'
- condition: template
value_template: '{{ trigger.to_state.attributes.current_activity == "Project Wii" }}'
- condition: template
value_template: '{{ trigger.to_state.attributes.current_activity == "Project Xbox 360" }}'
- condition: template
value_template: '{{ trigger.to_state.attributes.current_activity == "Project Retro Console" }}'
- condition: template
value_template: '{{ trigger.to_state.attributes.current_activity == "Projector" }}'
action:
service: scene.turn_on
entity_id: scene.taverna_spenta
id: aa4a74f063bf406a82177bf3addb9419