Hello everyone
This is my first post. I’m new to HA but I already have a little experience. I have started experimenting with fields in scripts.
I have a script with following field:
station:
name: Station
required: true
selector:
text: null
Everything is working but the while condition, so it iterates forewer:
repeat:
sequence:
- service: media_player.select_source
data:
source: "{{station}}"
target:
device_id: 65fb746534c743de4577c0c80205976c
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
while:
- condition: not
conditions:
- condition: state
entity_id: media_player.kuche
attribute: media_channel
state: "{{station}}"
enabled: true
While this example is working:
repeat:
sequence:
- service: media_player.select_source
data:
source: "{{station}}"
target:
device_id: 65fb746534c743de4577c0c80205976c
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
while:
- condition: not
conditions:
- condition: template
value_template: "{{ state_attr(\"media_player.kuche\",\"media_channel\") == station }}"
alias: media_channel == station
enabled: false
I could not find out, how to use sation field in state condition. Is someone here who can explain this or link me to the correct doc?
Many thanks in advance and best regards