Thanks for sharing this! I’ve added your lovelace config snippet to the main project README, as documentation is building up.
I’d also like to add information about running this as an isolated Docker addon. However, have you considered taking inspiration from the current Dockerfile? Specifically, you could try with the following Dockerfile:
FROM python:alpine3.7
# Copy data for add-on
COPY run.sh ip150.py ip150_mqtt.py requirements.txt options.json /
RUN apk add --no-cache python3 &&\
python3 -m ensurepip &&\
pip3 install -r requirements.txt
RUN chmod a+x /run.sh
CMD [ "/run.sh" ]
Then, have run.sh be something like
while true
do
python3 ip150_mqtt.py options.json
# 20 seconds should be enough to ensure the session expired on the server
sleep 20
done
The above should do a couple of things:
Only copy the necessary files in the Docker image
use a small wrapper around the app that automatically restarts it if it crashes. Hopefully this will never be needed but there used to be times when this addon was quite less stable than today!
If you could let me know your mileage, I’d be happy to add instructions (or somewhat add this alternative Dockerfile to the source, for quickest reuse).
This is working on my setup with the following changes:
Dockerfile:
FROM python:alpine3.7
# Copy data for add-on
COPY run.sh ip150.py ip150_mqtt.py requirements.txt options.json /
RUN apk add --no-cache python3 &&\
python3 -m ensurepip &&\
pip3 install -r requirements.txt
#RUN chmod a+x /run.sh**This line is not needed for windows hosts because all files are copied with x permission**
CMD [ "/run.sh" ]
run.sh
#!/bin/sh
# Shebang needs to be here, else it returns: standard_init_linux.go:207: exec user process caused "exec format error"
while true
do
python3 ip150_mqtt.py options.json
# 20 seconds should be enough to ensure the session expired on the server
sleep 20
done
I still have trouble setting this up.
Deleted ver.0.5, started from scratch, copy-pasted config from readme and replaced passwords/addresses.
No errors in log (which I assume means add-on connects both to mosquitto brocker and to the IP150s).
I can see the updates in the respective topics via MQTTLens.
alarm entity is in unknown state and pirs are constantly off
My problems are definitely connected with the Mosquitto add-on I’m using.
I reinstalled the add-on from scratch last night, messing up the config with my sleepy fingers.
Today I found an error message per every IP150 PIR event.
I managed to fix the Mosquitto logging following instructions in this discussion, however I’m back to all PIR sensors being off.
Can you share which MQTT broker you guys are using?
MQTT Server & Web client
Mosquitto MQTT Server bundled with Hivemq’s web client
Works good. I’m having a problem with the MQTT alarm panel not sending the appropriate messages, but the sensors work fine and I’ve verified I can arm/disarm by sending the requisite MQTT message manually to the MQTT server, so the MQTT server itself appears to be working perfectly…
I replaced my broker with ‘MQTT Server & Web client’, re-configured from scratch.
I can currently subscribe to the paradox/zone/state/# topic from HiveMQ web client or mosquitto_sub and I can see the updates happening … off status for all (32) PIRs, on when something is triggered, etc.
None of this is reflected in the UI - I’m using the Lovelace GUI interface to seup my sensors.
I can manually flip one of the sensors publishing the ‘on’ msg to the broker and only then is the status change visible in the GUI…
What else can I try?
Are you willing to try the Mosquito Broker HASSIO addon again, and put this in your config file?
“MQTT_ADDRESS”: “mqtt://core-mosquitto”,
My one didn’t work with an IP address, it had to be core-mosquitto in the URL
Failing this, depending on what timezone you are, I can try to assist you remotely if you like.
I’m going to look at doing this integration, has any more work / development been done this Jan 2018 posting.
do you maybe have some screen shots of a implementation,
MY system is split into 2 partitions, would like to group the sensors/zone into partitions and show door and window icons next to the zones.
ignore, some how i missed the 168 posts since… hope my answer is in there some where
… so completed the reading, looks like i might have a issue, my system is running: 4.40.04
Please advise.
I did quickly check, was logged in via web page and could log in via the app, and then tested the reverse, logged in via app then did not allow me to log in via the web…
We actively use the app too arm/disarm, make that, that 95% of our interface with the system, so if using the app is going to block the web and the web interface is used by the add-on then i might not be able to do this.
I’m having a problem with zoning… My system has 3 zones, 2 of them are for windows and one is for motion detectors… In order to do a “ARM_HOME”, what it looks like would need to happen is that I would need to send an “ARM_AWAY” to 2 of the zones (for the windows), whereas for an “ARM_AWAY” I would have to send it to the 3rd zone (for motion detectors), and possibly the other 2 as well if all the windows are closed… Is there any way to configure at least using separate zones for “ARM_HOME” and “ARM_AWAY”?
Right. I tired core-mosquitto which couldn’t be resloved. But with the ip address I can see the events pushed to the broker by subscribing to the topic, so the add-on-to mosquitto integration works.
I created a virtualbox vm and basically started from scratch, keeping it to bare minimum - mqtt and paradox alarm add-on. Ended up with the same result.
I would gladly appreciate your generous offer for remote assistance. I’m in EEST (gmt+2).
I’ve looked hard into this, and I came to the conclusion there are no ways of triggering the alarm from the web interface, be it panic (no siren) or regular alarm (with bells).
One way to go would be to add a remotely controlled relay to the alarm GPIO, and use that for the trigger. This requires some wiring in the alarm module, and the purchase of a remotely controlled relay (say controlled via MQTT over WiFi, or Zigbee). Once you have that, you would need to add the switch in Home Assistant.
My take here would be to define an alarm panel for each zone, then set up an automation or a script for arming/disarming. That is, one instance of the addon is running, providing info for all zones (under different MQTT paths). Each alarm panel is configured to operate on different zones (i.e. different MQTT paths, each corresponding to a different zone).
Well, yes, right now I have 3 alarm panels, so I can go in and manually arm and disarm all 3 zones, but that’s pretty cumbersome… I’d like to have one alarm panel for all of them…
I’m thinking of trying to build something using the Manual Alarm Panel, which then sends the necessary requests to the 3 other panels… But then I have to build all the state handling and everything too… Kind of a hassle… But maybe someday I will get motivated to do it…
It would still be awfully nice if we could just have some config option to arm/disarm multiple zones with a single panel in this MQTT addon though.
that mean need to trigger a zone by wifi relay. It will be good to program any kind of sensors to the system via home assistant to create a better alarm system on top of the exisiting.