poudenes
(Poudenes)
September 27, 2023, 12:43pm
1
Hi All,
I have some platform triggers that i want convert to a condition. For example:
- platform: state
entity_id: media_player.woonkamer
to:
- "standby"
- "idle"
- "paused"
for: "00:00:05"
id: appletv_standby
I know the condition without the ‘for’ but how do i manage this with the ‘for’?
The ‘id’ part will be useless then.
123
(Taras)
September 27, 2023, 1:01pm
2
Based on the examples shown in the documentation for State Condition , this should work:
condition:
- condition: state
entity_id: media_player.woonkamer
state:
- "standby"
- "idle"
- "paused"
for: "00:00:05"
poudenes
(Poudenes)
September 27, 2023, 1:02pm
3
offcource… i was so blind on this. Thanks… haha
123
(Taras)
September 27, 2023, 1:32pm
4
You’re welcome!
Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions.
For more information about the Solution tag, refer to guideline 21 in the FAQ .
poudenes
(Poudenes)
September 27, 2023, 1:33pm
5
Did that. Do it always but somethings not directly
1 Like
poudenes
(Poudenes)
September 28, 2023, 6:28am
6
There is still an error. I want use them in a “choose” and then this must be the lines:
- conditions:
- condition: state
entity_id: media_player.woonkamer
state:
- "playing"
for: "00:00:05"
Without the “for” everything is ok. I need the 5 seconds delay…
I now solved it with this:
sequence:
- wait_template: "{{ not is_state('media_player.woonkamer', 'playing')}}"
timeout: "00:00:05"
continue_on_timeout: true