Need Assistance with Trigger

Hello,

I’m new to Home Assistant, running the latest version via docker on Unraid.

So far, I’ve gotten hooked into my Abode security system, Life360, and my Chamberlain garage door opener. I’m still learning the syntax and other features of HA.

Regarding the Abode alarm system, I’m having trouble figuring out how to capture an event from within an automation trigger.

Is there documentation somewhere that explains how to translate the variables, events, and fields in that Abode link to an automation script, as in, how to write a trigger to capture an event? I’m asking in case there is something I missed that will make me more self-sufficient.

Meanwhile, here is the event I want to trap from my HA log:

2019-09-08 22:00:27 DEBUG (SocketIOThread) [abodepy.event_controller] Timeline event received: Automation : bedtime - Automation (5206)
2019-09-08 22:00:27 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event abode_automation[L]: device_id=, device_name=bedtime, device_type=, event_code=5206, event_name=Automation : bedtime, event_type=Automation, event_utc=1567994427, user_name=, date=09/08/2019, time=10:00 PM>

The event is one triggered that I triggered from Abode, but I want this to be a trigger for an HA automation. Reading the link above, the documentation confirms what I see in the log (event_type, event_name, device_name, etc.), but I can’t figure out how to translate that information into a valid trigger.

Any help appreciated.

The combination of the Abode integration’s documentation (linked above) and the docs for Event Trigger should get you started.

It will look something like this:

automation:
- alias: 'Example 1'
  trigger:
    platform: event
    event_type: abode_automation
    event_data:
      event_code: 5206
  action:
    # whatever it is you want to do

Thanks! I was able to get the trigger to work. But, it was odd that if I listed two event_data items, it failed to trigger. But with only one, it worked. For instance,

    event_data:
      device_name: bedtime

works, but this does not:

    event_data:
      device_name: bedtime
      event_code: 5206

Of course, I had read the trigger documentation you referenced, but it still seems somewhat vague as to what is valid syntactically or even semantically. Is there documentation that describes all the possible options in a given construct, such as a trigger? I’m channeling a Unix manpage. I’ve yet to find that, so it feels like a scavenger hunt to get to the right answer.

It’s possible that event_code is a string, not a number. If so, then you may need this instead:

    event_data:
      device_name: bedtime
      event_code: '5206'

It might help if you use the Events page to listen for this event. It will then print out the event in JSON, which should make it easier to see if the value is a number or a string.