I’m having some trouble with a Conditional card and the input_select.
I have a couple of input_selects defined as follows:
announcement_suggested_text:
options:
- Dinner is ready!
- Lunch is ready!
- We're leaving now!
- Steve's on his way home!
- I'm on my way home!
- Custom Message
announcement_target:
options:
- Everywhere
- Upstairs
- Steves Bedroom
- Computer Room
- Kitchen
an input_text named announcement_text and a conditional card as follows:
My aim was to have a card which could show input_select.announcement_suggested_text and only show input_select.announcement text if “Custom Message” was selected from the dropdown. To this end I created the following with a couple of Conditional cards, inside a vertical-stack:
- type: vertical-stack
cards:
- type: conditional
conditions:
- entity: input_select.announcement_suggested_text
state_not: Custom Message
card:
type: entities
show_header_toggle: false
entities:
- entity: input_select.announcement_target
- entity: input_select.announcement_suggested_text
- type: call-service
icon: 'mdi:voice'
action_name: Announce It...
name: ' '
service: script.send_annoucement
- type: conditional
conditions:
- entity: input_select.announcement_suggested_text
state: Custom Message
card:
type: entities
show_header_toggle: false
entities:
- entity: input_select.announcement_target
- entity: input_select.announcement_suggested_text
- entity: input_text.announcement_text
- type: call-service
icon: 'mdi:voice'
action_name: Announce It...
name: ' '
service: script.send_annoucement
This appeared to work but, if I switch to “Custom Message” to one of the other options (with the text input hidden as expected) and then back to “Custom Message”, although the text box re-appears as expected the input_select changes to show the option I had previously selected, like this:
This then seems to get stuck. I can’t select any other option until I refresh the page. It looks like this is because the displayed value in the dropdown doesn’t actually match the state of the input_select. Refreshing the page fixes it, and the dropdown resets to show the actual state of the input_select.
Does anybody have any ideas of a way to fix this, or a better way of having one of the entities in an entities card shown or hidden based on the state of another entity?