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

Wait for Trigger & Choose with Value Template…

$
0
0

Hi, been playing with the new Wait for Trigger and was wondering if I’ve missed something when combining it with choose:

Working set up:

  • Automation calling IOS actionable notification
  • Second automation with a trigger of the IOS response, choose in the actions based on the actionName in the response

To be set up:

  • Single automation calling IOS action notification
  • 'Wait for trigger ’ for the response back from IOS actionable notification
  • Choose action based on the trigger data from the waited for trigger

The configuration I’m trying to get running (possible responses from the actionable notification are TESTA and TESTB:

- id: '1596277325558'
  alias: xTest
  description: Test only.....
  trigger:
  - platform: device
    type: turned_off
    device_id: d20608626cd04a00844b9b01ddf05ca2
    entity_id: light.office_play
    domain: light
  condition: []
  action:
  - service: notify.mobile_app_mike_wood_iphonex
    data:
      message: This is a test
      data:
        push:
          category: TEST
  - wait_for_trigger:
    - platform: event
      event_type: ios.notification_action_fired
      event_data: {}
    timeout: 00:01:00
    continue_on_timeout: true
  - choose:
    - conditions:
      - condition: template
        value_template: '{{ trigger.event.data.actionName == "TESTA" }}'
      sequence:
      - type: toggle
        device_id: d20608626cd04a00844b9b01ddf05ca2
        entity_id: light.office_play
        domain: light
    - conditions:
      - condition: template
        value_template: '{{ trigger.event.data.actionName == "TESTB" }}'
      sequence:
      - type: toggle
        device_id: 1921d1bc21774f9894700ce41360cd05
        entity_id: light.office_light
        domain: light
    default: []
  mode: restart

The working set up I have has one automation triggering the IOS actionable notification, and a second with the trigger being the IOS event, and the choose conditions as outlined in this one using the same value template format.

Probably error in chair, just wondered if this was possible and I’ve made a mistake or if the value_template in the choice is looking to the original trigger and not and the waited for one?

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 106505

Trending Articles



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