Alarm.com sensor not working

Trying to get my Alarm.com sensore to show open and closed status. I have it set up and it’s there,but opening and closing the door doesn’t do anything…

- 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) }}

Try this

        value_template: >-
          {{ state_attr('alarm_control_panel.alarm_com', 'sensor_status')|regex_search('Front Door is Open', true) }}

The docs are a bit confusing. I might try clarifying them with some examples.

Ok,I’ll give it a try.

I tried it and still nothing. It shows closed,but not open when door is open.

Can you post a screen-shot of the sensor_status attribute value (Developer Tools States Menu)?

As that regex was working for me when I tested it.

And another test:

Alright,let me check.

I can’t find anything that looks like your screenshot,so I’m not sure what I’m doing wrong. The only thing in attributes for that sensor is…
friendly_name: Front Door
device_class: door

Or go to the Template section on that page, and past in:

{{ state_attr('alarm_control_panel.alarm_com', 'sensor_status') }}

Ok, now paste this into the template editor:

{{ state_attr('alarm_control_panel.alarm_com', 'sensor_status') }}
{{ state_attr('alarm_control_panel.alarm_com', 'sensor_status')|regex_search('Front Door is Closed', true) }}

Nice. It correctly matched your closed front door.

Now open your front door and paste this in the template editor:

{{ state_attr('alarm_control_panel.alarm_com', 'sensor_status') }}
{{ state_attr('alarm_control_panel.alarm_com', 'sensor_status')|regex_search('Front Door is Open', true) }}

Ok,it’s working now. I was about to say t wasn’t,but there is a 10 second delay for status changes.
Now do I repeat the same template for the Side door?
Appreciate the help.

1 Like

Tried making one for the Side door using the same template,but changing the name and it doesn’t even show up.

So something like this?

- 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', true) }}

      alarm_sidedoor:
        friendly_name: "Side Door"
        device_class: door
        value_template: >
          {{ state_attr('alarm_control_panel.alarm_com', 'sensor_status')|regex_search('Side Door is Open', true) }}

That was it. I forgot to change alarm_frontdoor to alarm_sidedoor. Everything is good now. Appreciate the help tom. :+1:

1 Like

I am having a similar issue, here is my yml
binary_sensor:
- platform: template
sensors:
# Contact Sensor
alarm_front_door:
friendly_name: “Front Door”
device_class: door
value_template: “{{ state_attr(‘alarm_control_panel.alarm_com’, ‘sensor_status’)|regex_search(‘Front Door is Closed’, true) }}”

I keep getting this error

Invalid config for [alarm_control_panel.alarmdotcom]: [binary_sensor] is an invalid option for [alarm_control_panel.alarmdotcom]. Check: alarm_control_panel.alarmdotcom->binary_sensor. (See ?, line ?).

this line works perfectly in my template editor, what am I missing?