I’ve had no success figuring out how to leverage these sensors to automate and trigger other z-wave devices. My example would be turning on a light when there’s motion from the Alarm.com sensor.
Any help figuring this out would be much appropriated.
Invalid config for [automation]: extra keys not allowed @ data[‘action’][0][‘entity_id"’]. Got None invalid template (TemplateSyntaxError: unexpected ‘)’) for dictionary value @ data[‘trigger’][0][‘value_template’]. Got None
You have an errant double quote (") next to entity_id , last line of your actions.
Your template is not configured correctly. As there could be more than one state reported in sensor_status you are going to need to use the string in method. Try this for the template:
"{{ 'Office Motion Detector is Activated' in state_attr('alarm_control_panel.alarm_com', 'sensor_status') }}"
Personally I’d make a bunch of binary template sensors to match on the expected strings in sensor_status. You can then just use the binary sensors in state triggers in your automations. You also get nice feedback as you are able to see the sensors in the front end. Like this:
Thanks for the help. I’m going to follow your suggestion and create some sensors. I’m not sure how often the ‘sensor_status’ gets updated. Is there a way to change the polling to get close to real-time updates?
On a separate thread I was chatting with @FlyGuy62N and @walrus_parka and we tested a sensor as well as a binary_sensor configuration. I’m not sure what the difference is.
Both options worked but I noticed there was a lag between opening and closing a sensor with both solutions.
It took ~2 minutes for the UI to recognized the window being opened from a close state
It took 20 seconds for the UI to recognized the window being closed from an opened state
I’m looking for a way to shorten the time for item #1
I’m new to this forum and HA so sure how to loop you into that conversation. Since you looked at the code I wanted to keep you updated on my progress.
Those times are just gonna be what they are. Here’s what’s happening in the background…
The window is opened/closed (“state event”)… tic-toc
Your alarm box tells AdC’s web site about the event… tic-toc
AdC queues the update for the next time your HA box logs in. … tic-toc
Your HA logs in and gets the latest updates.
There could be seconds or longer between each. For my use case that we’ve been discussing, the lag doesn’t matter.
If you want it to be faster, you’ll need a local sensor that talks directly to your HA. A ZWave sensor would do it, but then you have sensors on the same physical object to do the same thing.
AlarmDecoder might work but I don’t have any time with one of those.
Has anyone had any luck tapping in to smoke or CO sensors? As far as I know, the only way to see the sensor_status attribute if smoke or CO is detected would be to actually set it off, and that’s not exactly easy to do. I’m wondering if I can just use something like this?
value_template: "{{ 'smoke' in state_attr('alarm_control_panel.alarm_com', 'sensor_status') }}"
I don’t even really care which room detects smoke/CO. I really just want one sensor for the entire house. Thoughts?
I am having issues also here. I have intergrated ADC to the point where I can arm and disarm. I can also see the sensors status’s in developer tools. here is my yml config for one zone.
binary_sensor:
- platform: template
sensors:
# Contact Sensor
alarm_Living Room Door:
friendly_name: "Living Room Door"
device_class: door
value_template: "{{ state_attr('alarm_control_panel.alarm_com', 'sensor_status')|regex_search('Living Room Door is Closed', ignorecase=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 ?).