Texecom2mqtt: Texecom alarm panel and MQTT integration with HA support

Hi Guys

Does this work with IPCom?
I have a premier 412 version 11.0 and get the following error:

Starting texecom2mqtt … done
Attaching to texecom2mqtt
texecom2mqtt | 2020-09-04 06:15:41 - INFO: Connected to alarm, sleeping for 0.5 seconds…
texecom2mqtt | 2020-09-04 06:15:42 - INFO: Connection ready
texecom2mqtt | 2020-09-04 06:15:42 - INFO: Fetched serial number: 1153715
texecom2mqtt | 2020-09-04 06:15:42 - INFO: Logging in
texecom2mqtt | 2020-09-04 06:15:42 - DEBUG: Executing command 1
texecom2mqtt | /snapshot/app/dist/texecom/texecom.js:57
texecom2mqtt | throw new Error(Unexpected start, expected 't', got ${headerStart});
texecom2mqtt | ^
texecom2mqtt |
texecom2mqtt | Error: Unexpected start, expected ‘t’, got :heart:
texecom2mqtt | at Texecom.parseBuffer (/snapshot/app/dist/texecom/texecom.js:57:19)
texecom2mqtt | at Socket. (/snapshot/app/dist/texecom/texecom.js:216:22)
texecom2mqtt | at Socket.emit (events.js:315:20)
texecom2mqtt | at emitReadable_ (_stream_readable.js:562:12)
texecom2mqtt | at processTicksAndRejections (internal/process/task_queues.js:83:21)

Hi Marcel,

according to the author, the app uses the Texecom Connect protocol and therefore is only compatible with Premier Elite controllers:

I’d appreciate if someone had some insight on this.

I only have a SmartCom and can use both the Texecom app and this in parallel, with some limitations. I don’t get Texecom alerts when this is running (but can set the equivalent up in Home Assistant), and the calendar in the app doesn’t work (but it was pretty useless anyway)

Hi, I am a NOOB when it comes to docker.

I first tried to install this on a PI following this giuide


so doocker is up and running.

I have also installed docker desktop on my WIN 10 desktop.

I do not know now how to install the image / container, I have followed this


Again no problem following these steps.

I am stumped when it comes to Dockerfile and Docker Pull Command as all the examples point to GIT?

When I use the command docker build --tag dchesterton/texecom2mqtt . I get all kinds of errors.

Normally I would not attempt this but unfortunately this is my only option to achieve this integration at present.

Hi Mark,

the docker build command is used to make your own container from a DOCKERFILE you’ve created yourself. In this case you’re using the dchesterton/texecom2mqtt container that has been published to docker hub - therefore you need to use the “docker run” command, as per this post:

That being said, the author of the container recommends to use docker-compose in the container documentation, which is the way I am using it currently. See https://hub.docker.com/r/dchesterton/texecom2mqtt:

Running in Docker

Docker is currently the only supported way of running the application. A docker-compose.yml example is shown below:

version: "3"
services:
    texecom2mqtt:
        container_name: texecom2mqtt
        image: dchesterton/texecom2mqtt:latest
        restart: unless-stopped
        volumes:
            - ./config.yml:/app/config.yml

So for this, you’d create a directory, add the docker-compose.yml file as above and your config.yml file. Then using the docker-compose up command will download/run the container and use your configuration file.

I think there was talk earlier in this thread above of turning this into a fully-fledged home assistant add-on to make this more user-friendly but I’m not sure if it’s been implemented yet.

Note you’ll also need to set up a MQTT broker (such as the mosquito add-in available in home assistant)

Thanks, Anthony. If that is the case then I guess I’ll need to make a decision about whether or not these are things I can live without.

I’m also wondering if it’s physically possible to have both SmartCom and ComIP communicators installed on the panel.

Hi Chris,

Many thanks for the confirmation, after much googling yesterday I managed to get it up and running on Docker-Desktop and your above write up serves as confirmation.

My issue now is that i am trying to replicate the same on my R PI.
These are my steps.

  1. Installed the Raspberry Pi OS 32 bit Lite version and enabled SSH.
  2. Login
  3. Install Docker

curl -sSL https://get.docker.com | sh

  1. Add permission to Pi User to run Docker Commands

sudo usermod -aG docker pi

Reboot

  1. Test Docker installation

docker run hello-world

  1. Install proper dependencies

sudo apt-get install -y libffi-dev libssl-dev
sudo apt-get install -y python3 python3-pip
sudo apt-get remove python-configparser

  1. Install Docker Compose

sudo pip3 -v install docker-compose

nano Dockerfile
save and exit

nano config yml
save and exit

nano docker-compose.yml
save and exit

docker-compose up

pi@raspberrypi:~ $ docker-compose up
Starting texecom2mqtt ... done
Attaching to texecom2mqtt
texecom2mqtt    | standard_init_linux.go:211: exec user process caused "exec format error"

docker ps

pi@raspberrypi:~ $ docker ps
CONTAINER ID        IMAGE                             COMMAND                  CREATED             STATUS                         PORTS               NAMES
218e2da192af        dchesterton/texecom2mqtt:latest   "docker-entrypoint.s…"   13 hours ago        Restarting (1) 6 seconds ago                       texecom2mqtt

Any Ideas?
texecom2mqtt | standard_init_linux.go:211: exec user process caused “exec format error”

Regards,

The “exec format error” is almost certainly due to trying to run an application compiled for a different processor architecture.

Tried on my Pi 4, same results.


pi@raspberrypi:~ $ docker-compose up
Creating network "pi_default" with the default driver
Pulling texecom2mqtt (dchesterton/texecom2mqtt:latest)...
latest: Pulling from dchesterton/texecom2mqtt
cbdbe7a5bc2a: Pull complete
c6b8a3ced104: Pull complete
b5b015038032: Pull complete
5228d41d469d: Pull complete
0050f54e85db: Pull complete
fec675876f14: Pull complete
Digest: sha256:b6fc7a8dadccf9fcdda1ddcf59505db942ba7e95f97e10389ebe98dd392b66df
Status: Downloaded newer image for dchesterton/texecom2mqtt:latest
Creating texecom2mqtt ... done
Attaching to texecom2mqtt
texecom2mqtt    | standard_init_linux.go:211: exec user process caused "exec format error"

So would I be right in saying you cannot run this on a Raspberry Pi, only in Docker Desktop WIN / MAC?

I am not too familiar with running containers on pi but based on your logs I’d hazard a guess that it’s the node image referenced in the container itself not being arm-compatible:

https://hub.docker.com/r/dchesterton/texecom2mqtt/dockerfile

FROM node:14-alpine AS build

WORKDIR /app

COPY package.json .
COPY yarn.lock .
RUN yarn install --frozen-lockfile

COPY tsconfig.json .
COPY src .
RUN yarn build
RUN yarn compile

FROM node:14-alpine

WORKDIR /app

COPY --from=build /app/texecom2mqtt ./app/texecom2mqtt

CMD ["./app/texecom2mqtt"]

I think you’re right. I’ll look at building a Pi compatible container.

nice - perhaps kill 2 birds with one stone by making the PI-compatible one a home assistant add-on. It looks like this uses docker for add-ons so: https://developers.home-assistant.io/docs/add-ons/tutorial

Hi,

This is probably going to be the dumbest question on here, but I’m going to ask anyway.
can some one walk me through how to get this image running with integration with HA.
I’m really new to Docker containers and Pi. With the massive help from you tube and by fumbling around on the net i have managed to get HA running inside a container.

So far i’ve only been able to pull down the dchesterton/texecom2mqtt image.

any help or guidance appreciated.

thanks
Sups

Hi Sups,

As per the posts above, this isn’t going to work on Raspberry Pi at present due to the way the container has been created.

This integration is quite new and the author (dchesterton) has kindly indicated that they will look at making one that is pi compatible so keep an eye on this thread for updates.

OMG, how did i miss that! Daniel clearly says that he’ll look into a Pi compatible container only a few posts up.
Thanks Chris

Which panel do you have?

I’m on a Premier Elite 48-W Live (same board as the 64W-live), it has 2 regular onboard Com ports, and a separate 10 pin communication port (I think intended for speech modules etc). Some panels have three Com ports as standard though.

The SmartCom requires the two onboard Com ports (Com1 and Com2), however, in the box with the Smartcom is an adaptor board to turn the third communication port into a regular com port (Com3).

I have bought a SmartCom and ComIP to see if I can run both as you have mentioned (and avoid relying on Wifi). I have the ComIP now running on Com3 in parallel with my existing ComWifi (on Com1) successfully (although there are some issues with the device not appearing on my Ubiquiti controller). I’m winding myself up for the possibly painful experience of updating firmware on the board (and likely reprogramming the lot) before I can install the SmartCom.

The above likely explains my issues with attempting to run this on Portainer on my Pi :slight_smile:

Hi Manic,

Currently an older model - premier 24 I think. I’ve just moved into a new house where this was pre-installed. I’ve spoken with the installer of the current system and I’m about to upgrade to the Premier Elite 24 so I can make use of the connect protocol in both the Texecom app and home automation.

Based on the information in davidMbrooke’s API here I took the decision to go with both SmartCom and ComIP communicators since I wanted other family members to be able to use the app without issues caused by also integrating with home assistant. Then from reading the installer manual for Smartcom I saw that it required both com1 and com2 ports in the panel. Your explanation of the adapter board to gain an extra com port makes sense.

I have got the texecom2mqtt service running already on one of my servers as a check that it would work as expected. I have been using netcat in my Mac terminal (nc -l 10002) to pose as the panel, at least enough to get past the initial requests for serial number etc. and for the mosquito broker to log a connection. For anything more I’d probably need to look at the code :slight_smile:

Hey,

I am just passing by to thank you for your effort.
I just tested your project on an elite 24 and smart com with great success.

Also, I am glad to see that you are already working on an ARM build. All those guys who are running HassOS on a PI will be happy (me included).

I have a side question: I was hoping to use this integration for automation like presence detection. But I see that a “light detection” (orange led only enabled on a detector) is not considered as a real detection.
Is there a way to track those events ?

Thank you again.

I’ve released a version which should add support for Raspberry Pi’s as well as x86 processors. Just run docker pull dchesterton/texecom2mqtt:latest to get the latest version.

I’ve tested it on my 3 Model B and all seems to be working well but please let me know if you have any issues.

1 Like