ADT Pulse integration

@iva8524 could you provide your addon logs mqtt dump from start to finish in a pastebin or https://gist.github.com/ ?

Hi all,

I’m trying to run this on a Raspberry Pi with a docker container, using docker-compose:

  pulse-adt-mqtt:
     container_name: pulse-adt-mqtt
     image: digitalcraig/adt-pulse-mqtt:latest
     volumes:
       - /home/pi/pulse-adt-mqtt:/data

It say’s it’s starting, but then a ‘docker ps’ does not show it’s running. Are there pre-requisites for it? I’ve installed npm/nodejs.

Thanks.

Are you having trouble with it? Do you have e any logs or console output from docker?

Sorry for the very delayed reply. I switched to HASSIO and was using the addon, but now I find myself again in need of going back to a non HASSIO installation on a raspberry pi. The error was related to not realizing you had a default amd Docker file.

I rebuilt following your post above. It would be good to maybe edit your post and include a blurb on creating an options.json file. The container was crashing with a ‘cannot find options.json’. I took a guess and created the file and pasted in the config data from my HASSIO version and that seemed to work.

Thanks

I’m glad you got it going, you’re right, I’m running docker on a QNAP NAS which is Intel-based. I’ll have to look into how to make Docker also build an arm version. It is the same options.json that’s used in the addon and the config.json in the github repo defines the possible fields for it in the “options” and “schema” entries. I can’t edit my post, but I created a reply with my sample options.json.

You will also need an options.json, here is a sample of the one I use:

Note: I use mqtt_url, but unless you want to specify the full URL, you may want to use mqtt_host to keep it simple.

{
      "pulse_login" : {
        "username": "username",
        "password": "password"
      },
      "mqtt_url" : "mqtt://mqtt:1883",
      "mqtt_connect_options" :  {
        "username" : "username",
        "password" : "password",
		"clientId" : "adtpulse",
		"protocolId" : "MQIsdp",
		"protocolVersion" : "3",
		"connectTimeout" : "1000",
		"debug" : "true"
      },
      "alarm_state_topic": "home/alarm/state",
      "alarm_command_topic": "home/alarm/cmd",
      "zone_state_topic": "adt/zone",
      "smartthings_topic": "smartthings",
      "smartthings": false
}
1 Like

I’ll have to look into how to make Docker also build an arm version.

That would be great. Would love to be able to pull the latest images without having to rebuilt the docker every time! The addon is great, thanks for putting this together.

Can you try pulling digitalcraig/adt-pulse-mqtt:armhf-latest? I’m having trouble getting it to cross-build automatically on Docker Hub, but I did manage to cross-build on my QNAP NAS and pushed the image up to Docker Hub. If that works on your RPi, I can do more troubleshooting on the automated build part.

Eventually if I can figure out how manifests work, you’ll be able to pull just digitalcraig/adt-pulse-mqtt:latest as a virtual image and it will pull the correct image based on the platform. That’s still an experimental feature outside of the official images as far as I can tell, though.

Worked great!

Hi

Like Buckeyes1995, I too am trying to get HASSIO running with the ADT Pulse add on. I have noticed that the addon just says “This addon is not available on your system.”

From a little research my Raspberry Pi is the 3B+ thus the 64bit version, so not the armhf version (ie ARMV7) but this is an ARMV8. I am guessing this is why haruny’s version fails when I try and pull it down. Install just doesn’t work.

Looking in the docker-build.sh file on haruny’s version I can see this: # homeassistant/aarch64-base but not sure if this build would work.

Anyone encountered this? If so how did you fix it.

From what I understand of the Hassio add-on system, the ARG $BUILD_FROM line in the Dockerfile should allow it to build the add-on locally on your Raspi, from the Dockerfile, for any architecture supported by the Hassio add-on. However, it’s possible something needs to be adjusted in the package.json to support 64-bit or one of the dependencies aren’t available on that architecture.

I noticed on the Hassio install page that there are two images for Raspberry Pi 3 B+. One is 32-bit and 64-bit with the 32-bit one being recommended. So you may want to try that if you want maximum compatibility with add-ons.

The docker-build.sh is not for use with Hassio add-on’s, but for those that are running Docker independently on a generic Linux host like myself or like Buckeyes1995 who runs on Raspberry Pi but not Hassio. It allows you to build a local Docker image from the Docker file.

Could you maybe explain how to run just the docker image (without NPM)? I’ve run docker build with armhf as the build target and have updated config.json with the appropriate ADT & MQTT login info but am not sure how to actually run the docker image.

Sure, I’ll try to explain at a high level. There are docker images and there are docker containers. You have to create and configure the container from an image. The container is what actually runs, the image is just a virtualized file system image. I use a QNAP NAS running ContainerStation so most of the tedious bits I do with the GUI. For the command line, you would probably be best served by finding a good Docker tutorial such as the one on the Docker website.

For day to day administration, I use docker-compose to manage all of the various containers related to Home Assistant. It will pull the images, (re-)create the containers, configure them, and start and/or stop them in the correct order.

Here is my current docker-compose.yml:

version: '3'
services:
   influxdb:
      container_name: influxdb
      image: influxdb
      volumes:
       - /share/Container/influxdb-data:/var/lib/influxdb
      ports:
       - "8086:8086"
   mqtt:
      container_name: mqtt
      image: eclipse-mosquitto:latest
      volumes:
       - /share/Container/mosquitto-config:/mosquitto/config
       - /share/Container/mosquitto-ssl:/ssl
      ports:
       - "8883:8883"
       - "1883:1883"
   pulse-adt-mqtt:
      container_name: pulse-adt-mqtt
      image: digitalcraig/adt-pulse-mqtt
      volumes:
       - /share/Container/pulse-adt-mqtt-config:/data
       - /share/Container/mosquitto-ssl:/ssl
   homeassistant:
      container_name: home-assistant
      image: homeassistant/home-assistant:0.83.3
      volumes:
        - /share/Container/hassio-config:/config
        - /share/Container/mosquitto-ssl:/ssl
        - /etc/localtime:/etc/localtime:ro
      depends_on:
        - mqtt
        - influxdb
      restart: always
      ports:
        - "8123:8123"
   grafana:
      container_name: grafana
      image: grafana/grafana
      depends_on:
        - influxdb
      volumes: 
       - /share/Container/grafana-data:/var/lib/grafana:rw
       - /share/Container/grafana-config:/etc/grafana:rw
      ports:
       - "3000:3000"
   node-red:
      container_name: node-red
      image: nodered/node-red-docker:0.19.4-v8
      depends_on: 
        - homeassistant
      volumes:
        - /share/Container/nodered-data:/data
      ports:
       - "1880:1880"
       - "1820:1820"
   web:
      container_name: nginx-certbot
      image: really/nginx-certbot
      depends_on:
        - homeassistant
      volumes:
         - /share/Container/nginx-config:/etc/nginx/conf.d:rw
         - /share/Container/nginx-ssl:/etc/letsencrypt
         - /share/Container/nginx-html:/var/www/html
      ports:
         - "81:80"
         - "443:443

Then I would just run “docker-compose up -d” from the directory containing docker-compose.yml to start everything up.

To use this yourself, change the image for the adt-pulse-mqtt container to your locally built image. You will also need to change the path to the data directory from /share/Container/pulse-adt-mqtt-config to the correct path on your local filesystem.

Thank you very much! I’m still learning about docker and it sounds like docker-compose is something I should look into, since right now I just have a text file with a bunch of docker commands saved in it. I have Portainer installed on a PC with some existing docker containers running on it, so I figure I’ll try to get things running there first, then can mess with getting it on a Raspberry Pi once I understand it a little more. Using your docker-compose.yml file, I was able to figure out this command but it keeps restarting:

docker run --restart unless-stopped --network DockerInternal -d --name=pulse-adt-mqtt -v /home/dockeruser/adt-pulse-mqtt/config:/data digitalcraig/adt-pulse-mqtt

I’ve created a file in the mapped /data directory named options.json, like the example you posted here: ADT Pulse integration I’ve also verified that the usernames & passwords in the file work to login to http://portal.adtpulse.com and the MQTT broker but I’m getting a “Connection Refused” error:

> [email protected] start /usr/src/app
> node server.js

2019-1-7 23:50:39 Pulse.pulse Spanning
2019-1-7 23:50:39 Pulse: New Client undefined
2019-1-7 23:50:39 Pulse: Login called Authenticating
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: Connection refused: Not authorized
    at MqttClient._handleConnack (/usr/src/app/node_modules/mqtt/lib/client.js:920:15)
    at MqttClient._handlePacket (/usr/src/app/node_modules/mqtt/lib/client.js:350:12)
    at work (/usr/src/app/node_modules/mqtt/lib/client.js:292:12)
    at Writable.writable._write (/usr/src/app/node_modules/mqtt/lib/client.js:302:5)
    at doWrite (/usr/src/app/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:428:64)
    at writeOrBuffer (/usr/src/app/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:417:5)
    at Writable.write (/usr/src/app/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:334:11)
    at Socket.ondata (_stream_readable.js:639:20)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node server.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-01-07T23_50_39_581Z-debug.log

Do you have any idea of what might be wrong, or what the best next troubleshooting steps would be?

Thanks again for your help!

Thanks for the heads up. Am new to the Raspberry Pi and thought I would try Hassio out, not realising I had gone for the 64bit version. Currently reinstalling now so will piece what I have done back together and come back to you if I have an issue. :slight_smile:

Hi folks,
ADP pushed the version 12.0.0-82 of the portal out recently.
It seems the ADT Pulse add-on (0.2.2.7) is not working with it.
It’s able to read the status but can not set alarm status to home or away.
I’ll take a look at it.
FYI.

Hi digitalcraig. I have managed to reinstall using the 32 bit edition for the Raspberry Pi. I am now able to install the ADT Pulse add in, so thank you for that.

However I have noticed that the login page is different in the UK to the one you have for US (I assume). It seems the UK use a different set up

Has anyone connected to a PM360-R that ADT currently use?

Looks like it started working again with no changes. I confirm addon version 0.2.2.7 is working fine with portal 12.0.0-82.

Hey man…

This addon has been working perfectly for months until now, great work!
I have used my ADT system so much more now than ever.

But as you described on your post earlier, I am able to get all statuses with no problem, but can’t arm/disarm the system.

Looking at the URLs in your code and inspecting the current ADT Pulse webpage, running this in Chrome:

https://portal.adtpulse.com/myhome/10.0.0-60/quickcontrol/armDisarmRRA.jsp?href=rest/adt/ui/client/security/setArmState&armstate=off&arm=stay

ends in “You do not have access to the requested feature”, while:

https://portal.adtpulse.com/myhome/13.0.0-153/quickcontrol/armDisarm.jsp?href=rest/adt/ui/client/security/setArmState&armstate=off&arm=stay

Arms the alarm just fine.

I replaced “13.0.0-153” with “10.0.0-60” and it armed as well.
So it looks like “armDisarmRRA.jsp” is the issue, and that “armDisarm.jsp” works instead.

Is arming/disarming still working for you?
Thanks a lot!
Damien

Arming/Disarming is not working for me either. Earlier this month it stopped working, then worked for a couple of days (I think that when haruny last posted), but then stopped working again.