I have a question about the new Choose action. Mine seems to follow the default action as long as it triggers. It doesn’t “choose” the other options.
Here’s my code (yes, I’ve upgraded it from a mere “Dog Feed Alert” to a “Pets Feed Alert” but haven’t changed the internal names yet)
- id: dogfeedalert
alias: Dog Feed Alert
trigger:
- platform: time
at: '09:00:00'
- platform: time
at: '17:00:00'
- platform: template
value_template: "{{ (states.input_select.family_status.state == 'Home') and (as_timestamp(states.input_select.family_status.last_changed) | timestamp_custom ('%H') | int) <= 12 }}"
- platform: template
value_template: "{{ (states.input_select.family_status.state == 'Home') and (as_timestamp(states.input_select.family_status.last_changed) | timestamp_custom ('%H') | int) >= 18 }}"
condition:
- condition: or
conditions:
- condition: state
entity_id: input_boolean.dog_fed
state: 'off'
- condition: state
entity_id: input_boolean.fish_fed
state: 'off'
- condition: state
entity_id: input_select.family_status
state: 'Home'
action:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.dog_fed
state: "off"
- condition: state
entity_id: binary_sensor.fish_fed
state: "on"
sequence:
- service: rest_command.assistant_broadcast
data:
command: "Hey guys. I don't think that the dog has been fed. Care to feed him?"
user: "Home Assistant"
- service: script.notify_slack
data_template:
channel: CSTK325NV
message: "Hey Guys. I don't think the dog has been fed. Care to feed him?"
attachments:
- title: "Mark him as fed?"
callback_id: dog_fed_callback
color: '#03a9f4'
attachment_type: default
actions:
- text: Mark Fed
value: Mark Fed
name: 'dog_fed'
type: button
- text: Dismiss
value: Dismiss
name: 'anything_just_not_blank'
type: button
- conditions:
- condition: state
entity_id: binary_sensor.fish_fed
state: "off"
- condition: state
entity_id: binary_sensor.dog_fed
state: "on"
sequence:
- service: rest_command.assistant_broadcast
data:
command: "Hey guys. I don't think that the fish have been fed. Care to feed them?"
user: "Home Assistant"
- service: script.notify_slack
data_template:
channel: CSTK325NV
message: "Hey Guys. I don't think the fish have been fed. Care to feed them?"
attachments:
- title: "Mark them as fed?"
callback_id: fish_fed_callback
color: '#03a9f4'
attachment_type: default
actions:
- text: Mark Fed
value: Mark Fed
name: 'fish_fed'
type: button
- text: Dismiss
value: Dismiss
name: 'anything_just_not_blank'
type: button
default:
- service: rest_command.assistant_broadcast
data:
command: "Hey guys. I don't think that the dog or fish have been fed. Care to feed them?"
user: "Home Assistant"
- service: script.notify_slack
data_template:
channel: CSTK325NV
message: "Hey Guys. I don't think the dog or fish have been fed. Care to feed them?"
attachments:
- title: "Mark them as fed?"
callback_id: pets_fed_callback
color: '#03a9f4'
attachment_type: default
actions:
- text: Mark Fed
value: Mark Fed
name: 'pets_fed'
type: button
- text: Dismiss
value: Dismiss
name: 'anything_just_not_blank'
type: button
Is there something obviously wrong with my “Choose” function? As I say - if both switches are “on” then the automation doesn’t fire (due to my conditions). When both are “off” then the default fires (as expected). But, if one is on and one is not, it should notify which is on. It doesn’t. I always get either “Hey guys, I don’t think that the dog or fish have been fed.”
Thanks.