How to parse this value?

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?

A bit more info, I set the logs to DEBUG and then recorded the following actions:

2025-01-16 13:15:33 - INFO: Application ready

# OPENED DOOR
2025-01-16 13:21:27 - INFO: Garden Room status changed to In Entry
2025-01-16 13:21:27 - DEBUG: Publishing to texecom2mqtt/area/garden_room: {"id":"A","name":"Garden Room","number":1,"status":"in_entry"}
2025-01-16 13:21:27 - PANEL: Entry Started (Areas: A; Parameter: 1; Group: 18)
2025-01-16 13:21:27 - DEBUG: Publishing to texecom2mqtt/log: {"type":"EntryStarted","description":"Entry Started","timestamp":"2025-01-16T13:21:27Z","areas":["A"],"parameter":1,"groupType":18}
2025-01-16 13:21:27 - INFO: Door main area status changed to Active
2025-01-16 13:21:27 - DEBUG: Publishing to texecom2mqtt/zone/door_main_area: {"name":"Door main area","number":1,"areas":["A"],"status":1,"type":"Entry/Exit 1"}

# ENTERED CODE TO DISARM
2025-01-16 13:21:36 - PANEL: User 1 logged in by Code Entered
2025-01-16 13:21:36 - PANEL: User Code (Areas: A; Parameter: 1; Group: 0)
2025-01-16 13:21:36 - INFO: Garden Room status changed to Disarmed
2025-01-16 13:21:36 - DEBUG: Publishing to texecom2mqtt/area/garden_room: {"id":"A","name":"Garden Room","number":1,"status":"disarmed"}
2025-01-16 13:21:36 - PANEL: Open/Close (Away Armed) (Areas: A; Parameter: 1; Group: 5)
2025-01-16 13:21:36 - DEBUG: Publishing to texecom2mqtt/log: {"type":"OpenClose","description":"Open/Close (Away Armed)","timestamp":"2025-01-16T13:21:36Z","areas":["A"],"parameter":1,"groupType":5}
2025-01-16 13:21:40 - DEBUG: Publishing to texecom2mqtt/log: {"type":"UserCode","description":"User Code","timestamp":"2025-01-16T13:21:40Z","areas":["A"],"parameter":1,"groupType":0,"entity":{"user_id":1,"user_name":"Owner"}}

# ENTERED CODE TO ARM
2025-01-16 13:22:50 - PANEL: User 1 logged in by Code Entered
2025-01-16 13:22:50 - PANEL: User Code (Areas: A; Parameter: 1; Group: 0)
2025-01-16 13:22:50 - DEBUG: Publishing to texecom2mqtt/log: {"type":"UserCode","description":"User Code","timestamp":"2025-01-16T13:22:50Z","areas":["A"],"parameter":1,"groupType":0,"entity":{"user_id":1,"user_name":"Owner"}}

# LEFT BUILDING
2025-01-16 13:22:53 - INFO: Garden Room status changed to In Exit
2025-01-16 13:22:53 - DEBUG: Publishing to texecom2mqtt/area/garden_room: {"id":"A","name":"Garden Room","number":1,"status":"in_exit"}
2025-01-16 13:22:53 - PANEL: Exit Started (Areas: A; Parameter: 11; Group: 16)
2025-01-16 13:22:53 - DEBUG: Publishing to texecom2mqtt/log: {"type":"ExitStarted","description":"Exit Started","timestamp":"2025-01-16T13:22:53Z","areas":["A"],"parameter":11,"groupType":16}
2025-01-16 13:23:07 - PANEL: Open/Close (Away Armed) (Areas: A; Parameter: 1; Group: 6)
2025-01-16 13:23:07 - DEBUG: Publishing to texecom2mqtt/log: {"type":"OpenClose","description":"Open/Close (Away Armed)","timestamp":"2025-01-16T13:23:07Z","areas":["A"],"parameter":1,"groupType":6}
2025-01-16 13:23:07 - INFO: Garden Room status changed to Armed
2025-01-16 13:23:07 - DEBUG: Publishing to texecom2mqtt/area/garden_room: {"id":"A","name":"Garden Room","number":1,"status":"full_armed"}

So it seems the state I want it published to MQTT topic texecom2mqtt/area/garden_room , could I get the state from that?

If so how do I update a helper from the status part of the MQTT payload?

Getting further along…

Now I am stuck as to the data value to write to the entity via input_text.set_value

alias: "[AA TEST alarm state save)"
description: ""
triggers:
  - trigger: mqtt
    topic: texecom2mqtt/area/garden_room
    value_template: "{{ value_json.status }}"
conditions: []
actions:
  - action: input_text.set_value
    metadata: {}
    data:
      value: 
    target:
      entity_id: input_text.test_alarm_state_helper
mode: single

Anyone help with this?