Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 103068

Choose options in wait for event automation

$
0
0

Hello,
Im trying to create an automation that has this flow using the choose option but its not working as expected.

Kitchen motion sensor times out > Alexa asks if I want to turn the lights off if the TV is off. > Action based on response > If response yes > turn off the lights
If response no > do nothing
If response none > turn off the lights

can someone point me in the right direction?

id: id_50
alias: Kitchen Off 5 minutes after last movement (alexa action)
trigger:
  - platform: state
    to: 'off'
    for:
      hours: 0
      minutes: 5
      seconds: 0
    entity_id: binary_sensor.kitchen_sensor_any
condition:
  - condition: state
    entity_id: input_boolean.auto_lights_off
    state: 'on'
  - condition: state
    entity_id: switch.kitchen_lights
    state: 'on'
action:
  - choose:
      - conditions:
          - condition: state
            state: 'off'
            entity_id: remote.lounge
        sequence:
          - service: script.activate_alexa_actionable_notification
            data:
              text: >-
                No motion detected in the kitchen, would you like me to turn off
                the lights?
              event_id: actionable_notification_kitchen_lights_off
              alexa_device: media_player.kitchen_show_5
    default:
      - service: switch.turn_off
        data: {}
        target:
          entity_id: switch.kitchen_lights
  - condition: state
    entity_id: switch.kitchen_lights
    state: 'on'
  - choose:
      - conditions: []
        sequence:
          - wait_for_trigger:
              - platform: event
                event_type: alexa_actionable_notification
                event_data:
                  event_id: actionable_notification_kitchen_lights_off
                  event_response_type: ResponseYes
          - service: switch.turn_off
            data: {}
            target:
              entity_id: switch.kitchen_lights
      - conditions: []
        sequence:
          - wait_for_trigger:
              - platform: event
                event_type: alexa_actionable_notification
                event_data:
                  event_id: actionable_notification_kitchen_lights_off
                  event_response_type: ResponseNo
                id: '7656'
          - condition: state
            entity_id: switch.kitchen_lights
            state: 'on'
    default:
      - wait_for_trigger:
          - platform: event
            event_type: alexa_actionable_notification
            event_data:
              event_id: actionable_notification_kitchen_lights_off
              event_response_type: ResponseNone
      - service: switch.turn_off
        data: {}
        target:
          entity_id: switch.kitchen_lights

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 103068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>