Texecom2mqtt: Texecom alarm panel and MQTT integration with HA support

I think that’s the problem, I didn’t match the area names in the config to the ones in alarm. When you are saying that I can use the area numbers, will it be 1 for area A, 2 for B etc.?

EDIT: It was the naming :blush:. My bad on not posting the full config from the start. Might worth making a comment in the config file so others won’t get stuck like me.

1 Like

Cool, glad you’ve found the problem. Yeah you can do it that way if it’s easier, e.g.

homeassistant:
  discovery: true
  areas:
    1:
      mapping:
        full_arm: armed_away
        part_arm_1: armed_night

Would correspond to Area A.

1 Like

@dchesterton, Great to see that someone has made some progress here. I’m very excited to have a chance at finally getting my texecom alarm integrated into HA. Thanks a lot for your work so far!

I’m currently trying to get set up and am getting this error when starting the container:

$ docker-compose up
texecom2mqtt is up-to-date
Attaching to texecom2mqtt
texecom2mqtt    | 2020-08-19 21:30:37 - INFO: Connected to alarm, sleeping for 0.5 seconds...
texecom2mqtt    | 2020-08-19 21:30:37 - INFO: Connection ready
texecom2mqtt    | 2020-08-19 21:30:37 - INFO: Fetched serial number: 1044466
texecom2mqtt    | 2020-08-19 21:30:37 - INFO: Logging in
texecom2mqtt    | 2020-08-19 21:30:37 - DEBUG: Executing command 1
texecom2mqtt    | 2020-08-19 21:30:37 - ERROR: Unhandled rejection - RangeError [ERR_INVALID_OPT_VALUE]: The value "NaN" is invalid for option "size"

Could this possibly come from my ComIP not being configured for the Crestron protocol?

Thanks @edennis :slight_smile:

I’m not sure what is causing that error but @jonnyrider had the same issue above and seemed to fix it, he might be able to shine some light on it? The app is using the Connect protocol, not the Crestron protocol, so you’ll need to configure your ComIP for the Connect protocol.

@edennis, I had this too - it was caused by bad yaml.

Is the IP address in the config.yml in quotes?

The Connect protool is the latest and greatest and the direction Texecom are promoting. It is far more capable than previous protocols. Working for me… (I know that doesn’t help)

Thanks for the advice! I tried putting the IP address in quotes but that didn’t seem to help. (Incidentally, the example yaml on https://hub.docker.com/r/dchesterton/texecom2mqtt doesn’t use quotes)

I also probably should’ve mentioned before that I have a slightly older panel, a Premier 412. I suppose this one might not at all be compatible? Please say it is… :smile:

I don’t think it is, sorry :frowning: according to their docs the Connect Protocol is only available on the Premier Elite panels with v4 firmware or above.

I can arm / disarm from with Home Assistant, but when I part arm my alarm from the Texecom App the status in Home Assistant is set to pending and I get the following error:

2020-08-18 00:04:59 WARNING (MainThread) [homeassistant.components.mqtt.alarm_control_panel] Received unexpected payload: part_armed_1

My config.yml currently looks like:

  areas:
    house_alarm:
      mapping:
        full_arm: armed_away
        part_arm_1: armed_night

Have you tried restarting Home Assistant? There seems to be a bug where HA doesn’t always pick up changes to the MQTT discovery.

1 Like

I got the same message as you but my area mapping was wrong. Like if you part arm the alarm from the keypad what status do you get in HA?

Well, I gave in an ordered a Premier Elite 24 for 83 EUR which should be arriving in about a week. This is just too important to not have connected to HA. I should be back in a few weeks with some feedback and certainly more questions. Thanks, Daniel!

I would like to configure phone notifications if alarms triggers. Anyone has any template that will send the sensor that triggered the alarm?

Thanks, restarting home assistant did the job after changing the config.yml and restarting the docker container

Add-in form would make me very happy indeed as presumably I wouldn’t have to move from my current HassOS installation.

In the meantime, I’ve downloaded docker to my laptop to have a play and see if I can get it working in it’s current form. Regard me as the idiot test :slight_smile:

You might be able to use the Portainer addon to install the docker container. I haven’t done this, so don’t know if it would work though

I’ve added a couple of new features.

  1. The app now sends log messages from the panel to the MQTT topic texecom2mqtt/XXXX/log. This is useful for doing automations based on various events. For example, I’ve set up an automation which alerts me to a bunch of failure events:
alias: "Alarm: log event"
trigger:
  platform: mqtt
  topic: texecom2mqtt/XXXX/log
condition:
  condition: template
  value_template: "{{ trigger.payload_json['type'] in ['ArmFailed', 'ACFail', 'LowBattery', 'MainsOverVoltage', 'PanelBoxTamper', 'BellTamper', 'AuxiliaryTamper', 'ExpanderTamper', 'KeypadTamper', 'FireZoneTamper', 'ZoneTamper', 'CodeTamperAlarm', 'PSUACFail', 'PSUBatteryFail', 'PSULowOutputFail', 'PSUTamper', 'PowerUnitFailure', 'BatteryChargerFault'] }}"
action:
  service: notify.phones
  data_template:
    message: "Alarm: {{ trigger.payload_json['description'] }}"
  1. You can now set the date and time by sending a message to texecom2mqtt/XXXX/datetime. I use this to sync the Home Assistant date and time every night.
alias: "Alarm: sync date and time"
trigger:
  platform: time
  at: "03:00:00"
action:
  service: mqtt.publish
  data_template:
    payload: "{{ now().isoformat() }}"
    topic: texecom2mqttt/XXXX/datetime

I hope they’re useful to people. I’m also looking at adding support for panel outputs soon.

3 Likes

I’ve been working on something similar. I’ve set it up by tracking the last active sensor and then including that in the notification.

To do so, you will need an input_text entity which stores the last active sensor:

input_text:
  recently_active_alarm_sensor:
    name: Recently active alarm sensor

Then add two automations. The first tracks the most recently active sensor:

automation:
  - alias: "Alarm: recently active"
    trigger:
      platform: state
      entity_id: binary_sensor.master_bedroom_motion_sensor, binary_sensor.hallway_motion_sensor, binary_sensor.living_room_motion_sensor, binary_sensor.front_door
      from: 'off'
      to: 'on'
    action:
      service: input_text.set_value
      data_template:
        entity_id: input_text.recently_active_alarm_sensor
        value: "{{ trigger.from_state.name }}"

The second triggers the notification on alarm.

automation:
  - alias: "Alarm: triggered"
    trigger:
      platform: state
      entity_id: alarm_control_panel.house_alarm
      to: triggered
    action:
      service: notify.phones
      data_template:
        title: House Alarm Triggered
        message: "Last active sensor: {{ states('input_text.recently_active_alarm_sensor') }}"
        data:
          push:
            sound:
              critical: 1
              volume: 1.0

This example uses iOS notifications and sends them as ‘critical’ which means your phone will still make a sound even if your phone is on silent and will show in CarPlay etc.

Obviously change your entity_ids and notification service but it should be a start at least.

2 Likes

Hi - I’m about to update my system to a premier elite controller with add-on communicator(s).

Hopefully someone can clarify something that is not clear to me - If I want to access the system with both the Texecom app and home assistant at the same time, will I need to install both SmartCom and ComIP or is SmartCom alone sufficient to handle both use cases?

Thank you, i’ll give it a go. I’ve installed Portainer and created the container with Daniels image but it fails constantly. However…as i’m a complete noob to this I have probably set it up completely wrong.

I don’t want to derail this thread too much so if anyone has any pointers for where I should start for idiot proof guides/help on how to set up containers it would be greatly appreciated.