I’m using the useful add-on Texecom2mqtt. Link to the main thread here.
I want to be able to take the current armed state and save this to a helper, so I can use it in an automation:
- in_entry
- pending
- in_exit
- arming
- disarmed
- triggered
- full_armed
- armed_away
- part_armed_1
- armed_home
Here is the debug log when the add-on starts:
2025-01-15 20:22:47 - INFO: Starting texecom2mqtt v1.2.3 (Node v16.13.0)...
2025-01-15 20:22:47 - INFO: Connected to alarm, sleeping for 2 seconds...
2025-01-15 20:22:49 - DEBUG: Executing serial number command
2025-01-15 20:22:49 - INFO: Connection ready
2025-01-15 20:22:49 - INFO: Logging in to panel
2025-01-15 20:22:50 - INFO: Successfully logged in to panel
2025-01-15 20:22:50 - INFO: Connected to MQTT broker: 192.168.1.195:1883 (retain: true, clean: true, client_id: texecom2mqtt, qos: 2)
2025-01-15 20:22:50 - DEBUG: Publishing to texecom2mqtt/status: online
2025-01-15 20:22:50 - INFO: Serial number: *******
2025-01-15 20:22:50 - INFO: Panel: Premier Elite 64 (V6.05.03LS1)
2025-01-15 20:22:51 - INFO: Fetched Area A: Garden Room
2025-01-15 20:22:51 - INFO: Fetched Area B: Area B
2025-01-15 20:22:51 - INFO: Fetched Area C: Area C
2025-01-15 20:22:51 - INFO: Fetched Area D: Area D
2025-01-15 20:22:51 - INFO: Fetched Zone 1: Door main area (Type: Entry/Exit 1; Areas: A)
2025-01-15 20:22:51 - INFO: Fetched Zone 2: PIR main area (Type: Guard Access; Areas: A)
2025-01-15 20:22:52 - INFO: Fetched Zone 3: Door utility (Type: Entry/Exit 1; Areas: A)
2025-01-15 20:22:52 - INFO: Fetched Zone 4: PIR utility (Type: Guard Access; Areas: A)
2025-01-15 20:23:01 - INFO: Fetched Zone 33: Fire alarm main room (Type: Fire; Areas: A)
2025-01-15 20:23:01 - INFO: Fetched Zone 34: Fire alarm utility (Type: Fire; Areas: A)
2025-01-15 20:23:10 - DEBUG: Publishing to texecom2mqtt/status: online
2025-01-15 20:23:10 - DEBUG: Publishing to texecom2mqtt/power: {"battery_charging_current":36,"battery_voltage":13.49,"panel_current":405,"panel_voltage":13.63}
2025-01-15 20:23:10 - INFO: Updating all zone states...
2025-01-15 20:23:11 - INFO: Updating all area states...
2025-01-15 20:23:11 - DEBUG: Received area flags: 000000000000000000000000000000000f00000000010100000f000000ff00010f000000000000000000000000000000000000000000000100000000010000010000000100000000
2025-01-15 20:23:11 - DEBUG: Received area flags for Area A (1): 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,0,0,1,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,0,1,0,0,0,0
2025-01-15 20:23:11 - DEBUG: Publishing to texecom2mqtt/zone/door_main_area: {"name":"Door main area","number":1,"areas":["A"],"status":0,"type":"Entry/Exit 1"}
2025-01-15 20:23:11 - DEBUG: Publishing to texecom2mqtt/zone/pir_main_area: {"name":"PIR main area","number":2,"areas":["A"],"status":0,"type":"Guard Access"}
2025-01-15 20:23:11 - DEBUG: Publishing to texecom2mqtt/zone/door_utility: {"name":"Door utility","number":3,"areas":["A"],"status":0,"type":"Entry/Exit 1"}
2025-01-15 20:23:11 - DEBUG: Publishing to texecom2mqtt/zone/pir_utility: {"name":"PIR utility","number":4,"areas":["A"],"status":0,"type":"Guard Access"}
2025-01-15 20:23:11 - DEBUG: Publishing to texecom2mqtt/zone/fire_alarm_main_room: {"name":"Fire alarm main room","number":33,"areas":["A"],"status":0,"type":"Fire"}
2025-01-15 20:23:11 - DEBUG: Publishing to texecom2mqtt/zone/fire_alarm_utility: {"name":"Fire alarm utility","number":34,"areas":["A"],"status":0,"type":"Fire"}
2025-01-15 20:23:11 - DEBUG: Publishing to texecom2mqtt/area/garden_room: {"id":"A","name":"Garden Room","number":1,"status":"full_armed"}
2025-01-15 20:23:11 - DEBUG: Publishing to homeassistant/alarm_control_panel/texecom2mqtt/garden_room/config: {"code":"****","code_arm_required":true,"code_disarm_required":true,"name":"Garden Room","state_topic":"texecom2mqtt/area/garden_room","command_topic":"texecom2mqtt/area/garden_room/command","unique_id":"texecom2mqtt.area.garden_room","value_template":"{% set values = {\"in_entry\":\"pending\",\"in_exit\":\"arming\",\"disarmed\":\"disarmed\",\"triggered\":\"triggered\",\"full_armed\":\"armed_away\",\"part_armed_1\":\"armed_home\"} %}{{ values[value_json.status] }}","payload_disarm":"disarm","json_attributes_topic":"texecom2mqtt/power","payload_arm_away":"full_arm","payload_arm_home":"part_arm_1","availability_topic":"texecom2mqtt/status","qos":2,"device":{"name":"Texecom Premier Elite 64","identifiers":"*******","manufacturer":"Texecom","model":"Premier Elite 64","sw_version":"V6.05.03LS1"}}
2025-01-15 20:23:11 - DEBUG: Publishing to homeassistant/binary_sensor/texecom2mqtt/door_main_area/config: {"name":"Door main area","state_topic":"texecom2mqtt/zone/door_main_area","payload_on":"1","payload_off":"0","value_template":"{{ value_json.status }}","device_class":"door","unique_id":"texecom2mqtt.zone.door_main_area","json_attributes_topic":"texecom2mqtt/zone/door_main_area","json_attributes_template":"{{ {'zone_number': value_json.number, 'zone_type': value_json.type, 'areas': value_json.areas} | tojson }}","availability_topic":"texecom2mqtt/status","qos":2,"device":{"name":"Texecom Premier Elite 64","identifiers":"*******","manufacturer":"Texecom","model":"Premier Elite 64","sw_version":"V6.05.03LS1"}}
2025-01-15 20:23:11 - DEBUG: Publishing to homeassistant/binary_sensor/texecom2mqtt/pir_main_area/config: {"name":"PIR main area","state_topic":"texecom2mqtt/zone/pir_main_area","payload_on":"1","payload_off":"0","value_template":"{{ value_json.status }}","device_class":"motion","unique_id":"texecom2mqtt.zone.pir_main_area","json_attributes_topic":"texecom2mqtt/zone/pir_main_area","json_attributes_template":"{{ {'zone_number': value_json.number, 'zone_type': value_json.type, 'areas': value_json.areas} | tojson }}","availability_topic":"texecom2mqtt/status","qos":2,"device":{"name":"Texecom Premier Elite 64","identifiers":"*******","manufacturer":"Texecom","model":"Premier Elite 64","sw_version":"V6.05.03LS1"}}
2025-01-15 20:23:11 - DEBUG: Publishing to homeassistant/binary_sensor/texecom2mqtt/door_utility/config: {"name":"Door utility","state_topic":"texecom2mqtt/zone/door_utility","payload_on":"1","payload_off":"0","value_template":"{{ value_json.status }}","device_class":"door","unique_id":"texecom2mqtt.zone.door_utility","json_attributes_topic":"texecom2mqtt/zone/door_utility","json_attributes_template":"{{ {'zone_number': value_json.number, 'zone_type': value_json.type, 'areas': value_json.areas} | tojson }}","availability_topic":"texecom2mqtt/status","qos":2,"device":{"name":"Texecom Premier Elite 64","identifiers":"*******","manufacturer":"Texecom","model":"Premier Elite 64","sw_version":"V6.05.03LS1"}}
2025-01-15 20:23:11 - DEBUG: Publishing to homeassistant/binary_sensor/texecom2mqtt/pir_utility/config: {"name":"PIR utility","state_topic":"texecom2mqtt/zone/pir_utility","payload_on":"1","payload_off":"0","value_template":"{{ value_json.status }}","device_class":"motion","unique_id":"texecom2mqtt.zone.pir_utility","json_attributes_topic":"texecom2mqtt/zone/pir_utility","json_attributes_template":"{{ {'zone_number': value_json.number, 'zone_type': value_json.type, 'areas': value_json.areas} | tojson }}","availability_topic":"texecom2mqtt/status","qos":2,"device":{"name":"Texecom Premier Elite 64","identifiers":"*******","manufacturer":"Texecom","model":"Premier Elite 64","sw_version":"V6.05.03LS1"}}
2025-01-15 20:23:11 - DEBUG: Publishing to homeassistant/binary_sensor/texecom2mqtt/fire_alarm_main_room/config: {"name":"Fire alarm main room","state_topic":"texecom2mqtt/zone/fire_alarm_main_room","payload_on":"1","payload_off":"0","value_template":"{{ value_json.status }}","device_class":"smoke","unique_id":"texecom2mqtt.zone.fire_alarm_main_room","json_attributes_topic":"texecom2mqtt/zone/fire_alarm_main_room","json_attributes_template":"{{ {'zone_number': value_json.number, 'zone_type': value_json.type, 'areas': value_json.areas} | tojson }}","availability_topic":"texecom2mqtt/status","qos":2,"device":{"name":"Texecom Premier Elite 64","identifiers":"*******","manufacturer":"Texecom","model":"Premier Elite 64","sw_version":"V6.05.03LS1"}}
2025-01-15 20:23:11 - DEBUG: Publishing to homeassistant/binary_sensor/texecom2mqtt/fire_alarm_utility/config: {"name":"Fire alarm utility","state_topic":"texecom2mqtt/zone/fire_alarm_utility","payload_on":"1","payload_off":"0","value_template":"{{ value_json.status }}","device_class":"smoke","unique_id":"texecom2mqtt.zone.fire_alarm_utility","json_attributes_topic":"texecom2mqtt/zone/fire_alarm_utility","json_attributes_template":"{{ {'zone_number': value_json.number, 'zone_type': value_json.type, 'areas': value_json.areas} | tojson }}","availability_topic":"texecom2mqtt/status","qos":2,"device":{"name":"Texecom Premier Elite 64","identifiers":"*******","manufacturer":"Texecom","model":"Premier Elite 64","sw_version":"V6.05.03LS1"}}
2025-01-15 20:23:11 - DEBUG: Publishing to texecom2mqtt/config: {"version":"1.2.3","log_level":"debug","model":"Premier Elite 64","firmware_version":"V6.05.03LS1","serial_number":"*******"}
2025-01-15 20:23:11 - INFO: Application ready
The line in question showing the states:
2025-01-15 20:23:11 - DEBUG: Publishing to homeassistant/alarm_control_panel/texecom2mqtt/garden_room/config: {"code":"****","code_arm_required":true,"code_disarm_required":true,"name":"Garden Room","state_topic":"texecom2mqtt/area/garden_room","command_topic":"texecom2mqtt/area/garden_room/command","unique_id":"texecom2mqtt.area.garden_room","value_template":"{% set values = {\"in_entry\":\"pending\",\"in_exit\":\"arming\",\"disarmed\":\"disarmed\",\"triggered\":\"triggered\",\"full_armed\":\"armed_away\",\"part_armed_1\":\"armed_home\"} %}{{ values[value_json.status] }}","payload_disarm":"disarm","json_attributes_topic":"texecom2mqtt/power","payload_arm_away":"full_arm","payload_arm_home":"part_arm_1","availability_topic":"texecom2mqtt/status","qos":2,"device":{"name":"Texecom Premier Elite 64","identifiers":"*******","manufacturer":"Texecom","model":"Premier Elite 64","sw_version":"V6.05.03LS1"}}
Creating an automation, it does not show all of the states, specifically these are not shown:
- in_entry
- pending
- in_exit
- arming
There is an example here which creates a helper, and then uses an automation to track the last activated sensor (which I also have working). But I can’t understand how to apply the same principle to parse the current alarm state.
So, how do I parse these states into a helper that shows the current state?