Hi There,
I need a little bit of help trying to figure it out how to integrate HA with my alarm system. I have an old alarm system and to make it work for modern environments I am using alarmdecoder. Once you have this working it offers different ways to connect to your alarm system:
It offers a WEB server with API than can be called this way:
curl -X GET --header 'Accept: application/json' 'http://alarmdecoder.local:5000/api/v1/alarmdecoder?apikey=1111111111':
{
"panel_alarming": false,
"panel_armed": false,
"panel_bypassed": false,
"panel_fire_detected": false,
"panel_on_battery": false,
"panel_panicked": false,
"panel_powered": true,
"panel_relay_status": [],
"panel_type": "ADEMCO",
"panel_zones_faulted": [3,
4
]
}
I am interested in getting the panel_zones_faulted [] information. This information is an array, and I want to do some automation based on the status of the zones. Some of them are movement sensors. I managed to connect to the sensor adding the following to the configuration:
sensor 2:
platform: rest
resource: http://192.168.1.76:5000/api/v1/alarmdecoder?apikey=11111
value_template: '{{ value_json.panel_zones_faulted }}'
The problem with this is that I can get 1 or 2 or 3 zones faulting at the same time. How to process this?
Other possibility is to connect to the raw data: http://192.168.1.76:10000
[10000001100000003A--],008,[f70000071008001c28020000000000]," DISARMED CHIME Ready to Arm "
[00000001100000000A--],004,[f70000071004000028020000000000],"FAULT 04 BASEMENT OFFICE "
[10000001100000003A--],008,[f70000071008001c28020000000000]," DISARMED CHIME Ready to Arm "
[00000001100000000A--],004,[f70000071004000028020000000000],"FAULT 04 BASEMENT OFFICE "
[10000001100000003A--],008,[f70000071008001c28020000000000]," DISARMED CHIME Ready to Arm "
[00000001100000000A--],004,[f70000071004000028020000000000],"FAULT 04 BASEMENT OFFICE "
To do this I am using the following:
sensor 3:
# Example configuration.yaml entry
sensor 3:
platform: tcp
name: alarmdecoder
host: 192.168.1.76
port: 10000
timeout: 1
payload: ""
value_template: "{{ value.split(',')[1] }}"
unit: N
Is this the right way to do this? or should I use an HTP Sensor or REST Sensor or aREST sensor to get this information? With the current definition as a TCP sensor it takes too much time to update the information (minutes).
This is how it looks now in my front page: