Basic - Interpreting Alarm.com Sensor State

Figured I’d share the alarm.com setup for those wanting to be able to view their sensor state. I went with the split config approach for my sensors. In my configuration.yaml file I included the below.

binary_sensor: !include binary_sensors.yaml

I put all my binary sensors within a file called “binary_sensors.yaml”. One thing to note that I didn’t see documented or I perhaps wasn’t looking at the right stuff. You denote the sensor type before the !include command line. If you put the sensor type of "binary_sensor: within the binary_sensor.yaml it will fail with an error stating “Invalid config for [binary_sensor]: required key not provided @ data[‘platform’]…”

Below is an example of what I have in place in the binary_sensor.yaml file. You can simply copy a entry and edit to to reflect your sensor name in alarm.com You can change out the device_class with anything from Binary Sensor Class documentation.

 - platform: template
   sensors:
      alarm_frontdoor:
        friendly_name: "Front Door"
        device_class: door
        value_template: >-
          {{ state_attr('alarm_control_panel.alarm_com', 'sensor_status')|regex_search('Front Door is Open', ignorecase=TRUE) }}

  - platform: template
    sensors:
      alarm_backdoor:
        friendly_name: "Back Door"
        device_class: door
        value_template: >-
          {{ state_attr('alarm_control_panel.alarm_com', 'sensor_status')|regex_search('Back Door is Open', ignorecase=TRUE) }}

  - platform: template
    sensors:
      alarm_smokedetector:
        friendly_name: "Smoke Detector"
        device_class: smoke
        value_template: >-
          {{ state_attr('alarm_control_panel.alarm_com', 'sensor_status')|regex_search("Smoke Detector is OK", ignorecase=TRUE) }}

Now go to your overview within HA, add an entity card, and select binary sensor/s you created.

Giving credit where its due as this was based off @FlyGuy62N post here. but wanted something a little more simpler and easier to setup for those just starting out with HA like I am.

Edit: I’m aware of the typo, just to didn’t want to mess with uploading a corrected screenshot after the fact.

1 Like

Hey thanks for this @StealthWyvern it’s exactly what i’m looking for. I followed your instructions and having trouble.
When adding your content into binary_sensors.yaml it complains with:

bad indentation of a sequence entry at line 2, column 2:
sensors:
^

Tried to space them out and all but still complains. Would appreciate some pointers, super new to this whole yaml stuff.

The first template should look like this:

 - platform: template
   sensors:

there was an extra space in front of sensors: line @Hashin_Maedom

Out of curiosity: How is the responsiveness in the alarm.com integration?
Is it a real API with an open session or “get status once in a while”?

It’s really nice to get the alarm status, and statuses into HA, but for usage in an automation you usually need quite fast responses. Like if you have “turn on the lights when the alarm is disarmed”, then it’s nice if the lights are turned of when you eneter, not 5 minutes later :slight_smile:

I’m asking since I’m about to buy an alarm.com based system just now.

Thanks

@Dino-Tech Thanks for pointing that extra space out, I’ve since corrected.
@Hashin_Maedom Sorry, I’ve been stupid busy as of lately and haven’t even had a change to look at my Pi in ages it seems.
@boneheadfraggle - There is a slight delay but nothing major, just a few seconds, and way shorter than 10 seconds. So its nothing crazy like 5 minutes.