Event conditions and person_id

Hi there. I’ve been wondering around the forum with no results, so I just thought I would create a new topic!

I created an actionable notification for an office alarm. Here it is.

alias: Office Alarm deactivate question
description: ""
triggers:
  - trigger: state
    entity_id:
      - binary_sensor.office_door_contact_sensor
    from: "off"
    to: "on"
conditions: []
actions:
  - action: script.activate_alexa_actionable_notification
    data:
      text: Would you like me to deactivate the Office Alarm
      event_id: deactivate_office_alarm
      alexa_device: media_player.office_echo
mode: single

Thats the question… Here is the response

alias: Office Alarm Deactivate Response
description: ""
triggers:
  - trigger: event
    event_type: alexa_actionable_notification
    event_data:
      event_id: deactivate_office_alarm
      event_response_type: ResponseString
      event_response: yes please deactivate
conditions: []
actions:
  - device_id: ecf0c928a2291991eaf
    domain: alarm_control_panel
    entity_id: a79aae583b7fa7
    type: disarm
    code: "****"
mode: single

This is working good but I want to further the response automation if the conditions in the event are not met. Like the event_response.

events dont show up as entities so i cant use a state condition on it and when trying to confgure a condition in the ui there are no options for events.

any help would be appreciated.

P.S. If anyone knows how to get event_person_id to show up in the event when its triggered, I would really like that! I have everything configured properly with my custom alexa skill and have turned on skill personalization and rebuilt the skill. According the instructions on the KeatonTayler Git hub for Alexa Actionable Notifications thats all you need to do?

Thanks,

this is what I have, but its not letting me save the automation due to the template line? Is this correct?

alias: Office Alarm Deactivate Response
description: ""
triggers:
  - trigger: event
    event_type: alexa_actionable_notification
    event_data:
      event_id: deactivate_office_alarm
      event_response_type: ResponseString
      event_response: yes please authorization Bravo
    id: MBPL001
conditions: []
actions:
  - if:
      - condition: template
        value_template: "{{ trigger.event.data.event_response == "yes please authorization Bravo" }}"
    then:
      - action: alarm_control_panel.alarm.disarm
        metadata: {}
        data:
          code: "****"
        target:
          entity_id:
            - alarm
    else:
      action: notify.alexa_media_office_echo
      metadata: {}
      data:
        message: You are not authorized to disable the security system.
        data:
          type: tts
mode: single

that is not the solution… This is…

alias: Office Alarm Deactivate Response
description: ""
triggers:
  - trigger: event
    event_type: alexa_actionable_notification
    event_data:
      event_id: deactivate_office_alarm
conditions: []
actions:
  - if:
      - condition: template
        value_template: >-
          {{ trigger.event.data.event_response == "yes please deactivate
          authorization bravo" }}
    then:
      - action: alarm_control_panel.alarm_disarm
        metadata: {}
        data:
          code: "***"
        target:
          entity_id:
            - alarm_control_panel.location_alarm
            - alarm_control_panel.location_alarm
    else:
      action: notify.alexa_media_office_echo
      metadata: {}
      data:
        message: You are not authorized to disable the security system.
        data:
          type: tts
mode: single

The solution is right. If you are wondering why: it is because you cannot simply place a string with double quotes around it inside a string with double quotes. Switching to multiline avoids the outer qoutes.

Thanks. I was having a hard time with that! lol

1 Like