Hello everyone, I’m here again to disturb …
My code works, but the automation starts by itself without me doing anything.
what can I do? and above all where am I wrong?
CODE 1
trigger:
- entity_id: remote.harmony_soggiorno
platform: state
attribute: current_activity
to: 'PowerOff'
condition:
- condition: template
value_template: "{{ states.remote.harmony_soggiorno.attributes.current_activity == 'PowerOff' }}"
action:
- service: scene.turn_on
entity_id: scene.soggiorno_normale
TRIGGER 1
24 agosto 2021
Has been triggered by state of remote.harmony_soggiorno
10:34:37 - 1 ora fa
Has been triggered by state of remote.harmony_soggiorno
9:53:21 - 2 ore fa
Has been triggered by state of remote.harmony_soggiorno
9:48:18 - 2 ore fa
Has been triggered by state of remote.harmony_soggiorno
8:57:41 - 3 ore fa
same problem here:
CODE 2
- alias: GoogleTV taverna off
trigger:
- entity_id: remote.harmony_taverna
platform: state
attribute: current_activity
to: 'PowerOff'
condition:
- condition: template
value_template: "{{ states.remote.harmony_taverna.attributes.current_activity == 'PowerOff' }}"
action:
- service: scene.turn_on
entity_id: scene.taverna_normale
- delay: 00:01:00
- service: switch.turn_off
entity_id: switch.media_taverna_mss120b_outlet_mediabase
- service: switch.turn_off
entity_id: switch.media_taverna_mss120b_outlet_games
TRIGGER 2
24 agosto 2021
Has been triggered by state of remote.harmony_taverna
8:11:06 - 4 ore fa
Here
CODE 3
- alias: "Selezione Switch OFF"
trigger:
- entity_id: remote.harmony_taverna
platform: state
attribute: current_activity
to: 'PowerOff'
condition:
- condition: template
value_template: >
{{ not state_attr('remote.harmony_taverna', 'current_activity') in [ 'Project GoogleTV', 'Project PC', 'Watch PC', 'Projector', 'Television', 'Watch GoogleTV', 'Watch TV', 'Play Xbox 360', 'Play Wii', 'Project Wii', 'Project Xbox 360', 'Play Retro Console' ] }}
- condition: template
value_template: "{{ states.remote.harmony_taverna.attributes.current_activity == 'PowerOff' }}"
action:
- delay: 00:01:30
- service: switch.turn_off
entity_id: switch.media_taverna_mss120b_outlet_mediabase
- service: switch.turn_off
entity_id: switch.media_taverna_mss120b_outlet_games
TRIGGER 3:
24 agosto 2021
Has been triggered by state of remote.harmony_taverna
8:11:06 - 4 ore fa
and here:
CODE 4:
- alias: "Selezione Switch ON"
trigger:
- entity_id: remote.harmony_taverna
platform: state
attribute: current_activity
from: 'PowerOff'
action:
choose:
- alias: "Attivita Taverna MEDIA"
conditions:
- condition: template
value_template: "{{ state_attr('remote.harmony_taverna', 'current_activity') in [ 'Project GoogleTV', 'Project PC', 'Watch PC', 'Projector', 'Television', 'Watch GoogleTV', 'Watch TV' ] }}"
sequence:
- service: switch.turn_on
entity_id: switch.media_taverna_mss120b_outlet_mediabase
- alias: "Attivita Taverna GAMES"
conditions:
- condition: template
value_template: "{{ state_attr('remote.harmony_taverna', 'current_activity') in [ 'Play Xbox 360', 'Play Wii', 'Project Wii', 'Project Xbox 360', 'Play Retro Console' ] }}"
sequence:
- service: switch.turn_on
entity_id: switch.media_taverna_mss120b_outlet_mediabase
- service: switch.turn_on
entity_id: switch.media_taverna_mss120b_outlet_games
TRIGGER 4:
24 agosto 2021
Has been triggered by state of remote.harmony_taverna
8:10:27 - 4 ore fa