Qolsys IQ Panel 2 and 3rd party integration

It would be assumed that if the software is the same on the Qolsys 4 as the 2, then yes it would work, but I don’t know of anyone that has a 4 yet to test it. I would assume it would work.

This script doesn’t do any other control of the alarm system other than allowing you to arm and disarm the system and to allow the sensor status to be passed to home assistant. You cannot control zwave through this script and currently it also doesn’t even have any information about zwave devices that are passed through the stream either. It is solely the sensors connected to the panel.

The IQ Panel 4 looks very similar in terms of interface. The manual states that it has the same 3rd party integration option with token hidden in the settings. So the odds look good that you can get it to work, though there might be small differences that will take some troubleshooting:

I don’t have the new panel yet so I can’t begin testing. Assuming that HA can talk to the panel will I be able to see the status of all the sensors and control Z wave etc. from HA? Or am I limited to arming and disarming the system?

You can see the status of the sensors and arm/disarm the system only. No zwave control.

Arguably you will have better control of zwave devices on Home Assistant over the control the IQ panel has.

Presumably with the status of sensors I can then have automations which control Z wave devices or other entities.

You can do that as long as home assistant is able to control the zwave devices.

A thought just occurred to me… The Qolsys panels are just glorified wall mounted Android tablets. Does anyone think we could find a way to root them and install a custom Android image and still take advantage of the built in radios and modules? Or has Qolsys put in an image verification to make sure that only their Android images run on it? If it would be possible to do this then having full Home Assistant integrations would maybe be possible, heck, you could even have your Home Assistant pages right on the display… Sounds like we need to do some hardware hacking :wink:

Makes sense and would be cool. I will say my thought would be I wouldn’t like the security for a security system is compromised. Lol

I’ve thought about that a number of times too, but in my opinion it’d probably be way more trouble than it’s worth. I don’t think the performance nor the actual hardware capabilities of the device would even be something one would want to run an HA dashboard on. First off you’d probably lose access to the sensors and other functionality right away and have to rebuild that somehow, and even if all that work were to be done… a the end of the day you’re only going to get a worse performing version of something you can already really easily get with a better and cheaper generic Android device.

This was actually how my thought process started when I moved into my new house in January, and once this plugin came along I realized that having this panel as a dedicated device for that purpose is actually probably smarter. The security system will continue working even if HA goes down which is a good practice. I actually JUST completed my vision for this this weekend which involved swapping out the IQ2 for a wall-mounted Fire HD 8, and I simply spliced a new charging cable in using the existing wire that was for the IQ2 panel. I’ve moved the IQ2 into our main bedroom closet which is also where the POE cables for my security cameras come in. They still communicate nicely with the contact sensors so I’m pretty satisfied with this final setup now.

This is, of course, all something I’d love to be proven wrong on though :smiley:

Did anyone ever figure out how to utilize the IQ2 motion sensor / camera via the integration?

Hi guys, new to this integration. I tried to get this set up last night, and ran into some problems. I wanted to see if anyone here has encountered something like this.

My AppDaemon apps.yaml:

qolsys_panel:
  module: qolsys_client
  class: QolsysClient
  mqtt_namespace: mqtt
  qolsys_host: REDACTED
  qolsys_token: REDACTED
  request_topic: qolsys/requests # Optional
  qolsys_info_topic: qolsys/panel/info # Optional
  qolsys_zone_update_topic: qolsys/panel/zone_update # Optional
  qolsys_zone_event_topic: qolsys/panel/zone_event # Optional
  qolsys_alarming_event_topic: qolsys/panel/alarming # Optional
  qolsys_disarming_event_topic: qolsys/panel/disarm # Optional
  qolsys_confirm_arm_code: False # Optional
  qolsys_confirm_disarm_code: False # Optional
  qolsys_arm_away_always_instant: False # Optional
  homeassistant_mqtt_discovery_topic: homeassistant/

And my appdaemon.yaml:

secrets: /config/secrets.yaml
appdaemon:
  latitude: REDACTED
  longitude: REDACTED
  elevation: REDACTED
  time_zone: REDACTED
  plugins:
    HASS:
      type: hass
    MQTT:
      type: mqtt
      namespace: mqtt #you will need this namespace name in your apps.yaml
      # The IP Address or hostname of your MQTT broker.
      client_host: REDACTED
      client_port: 1883
      client_user: homeassistant
      client_password: REDACTED
http:
  url: http://127.0.0.1:5050
admin:
api:
hadashboard:

When I start AppDaemon, I see the following in the log:

-----------------------------------------------------------
 Add-on: AppDaemon 4
 Python Apps and Dashboard using AppDaemon 4.x for Home Assistant
-----------------------------------------------------------
 Add-on version: 0.7.0
 You are running the latest version of this add-on.
 System: Debian GNU/Linux 11 (bullseye)  (amd64 / qemux86-64)
 Home Assistant Core: 2021.8.7
 Home Assistant Supervisor: 2021.09.6
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] appdaemon.sh: executing... 
[cont-init.d] appdaemon.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[22:29:08] INFO: Starting AppDaemon...
2021-09-29 22:29:09.149087 INFO AppDaemon: AppDaemon Version 4.1.0 starting
2021-09-29 22:29:09.149235 INFO AppDaemon: Python version is 3.9.5
2021-09-29 22:29:09.149332 INFO AppDaemon: Configuration read from: /config/appdaemon/appdaemon.yaml
2021-09-29 22:29:09.149441 INFO AppDaemon: Added log: AppDaemon
2021-09-29 22:29:09.149575 INFO AppDaemon: Added log: Error
2021-09-29 22:29:09.149667 INFO AppDaemon: Added log: Access
2021-09-29 22:29:09.149759 INFO AppDaemon: Added log: Diag
2021-09-29 22:29:09.161093 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2021-09-29 22:29:09.180719 INFO HASS: HASS Plugin Initializing
2021-09-29 22:29:09.180871 INFO HASS: HASS Plugin initialization complete
2021-09-29 22:29:09.181078 INFO AppDaemon: Loading Plugin MQTT using class MqttPlugin from module mqttplugin
2021-09-29 22:29:09.185219 INFO MQTT: MQTT Plugin Initializing
2021-09-29 22:29:09.185345 INFO MQTT: Using 'mqtt-client/status' as Will Topic
2021-09-29 22:29:09.185462 INFO MQTT: Using 'mqtt-client/status' as Birth Topic
2021-09-29 22:29:09.185588 INFO MQTT: Using appdaemon_mqtt_client as Client ID
2021-09-29 22:29:09.186034 INFO AppDaemon: Initializing HTTP
2021-09-29 22:29:09.186246 INFO AppDaemon: Using 'ws' for event stream
2021-09-29 22:29:09.188255 INFO AppDaemon: Starting API
2021-09-29 22:29:09.190447 INFO AppDaemon: Starting Old Admin Interface
2021-09-29 22:29:09.190703 INFO AppDaemon: Starting Dashboards
2021-09-29 22:29:09.202985 INFO HASS: Connected to Home Assistant 2021.8.7
2021-09-29 22:29:09.206767 INFO MQTT: Connected to Broker at URL REDACTED:1883
2021-09-29 22:29:09.213701 INFO AppDaemon: Got initial state from namespace mqtt
2021-09-29 22:29:09.213899 INFO MQTT: MQTT Plugin initialization complete
2021-09-29 22:29:09.215313 INFO AppDaemon: App 'qolsys_panel' added
2021-09-29 22:29:09.215777 INFO AppDaemon: Found 1 total apps
2021-09-29 22:29:09.216016 INFO AppDaemon: Starting Apps with 1 workers and 1 pins
2021-09-29 22:29:09.216519 INFO AppDaemon: Running on port 5050
2021-09-29 22:29:09.246896 INFO HASS: Evaluating startup conditions
2021-09-29 22:29:09.254619 INFO HASS: Startup condition met: hass state=RUNNING
2021-09-29 22:29:09.254826 INFO HASS: All startup conditions met
2021-09-29 22:29:09.266776 INFO AppDaemon: Got initial state from namespace default
2021-09-29 22:29:11.221233 INFO AppDaemon: Scheduler running in realtime
2021-09-29 22:29:11.224727 INFO AppDaemon: Adding /config/appdaemon/apps to module import path
2021-09-29 22:29:11.225184 INFO AppDaemon: Adding /config/appdaemon/apps/ad-qolsys to module import path
2021-09-29 22:29:11.232683 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/hello.py - ignoring
2021-09-29 22:29:11.233824 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/ad-qolsys/door_window.py - ignoring
2021-09-29 22:29:11.234942 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/ad-qolsys/qolsys_socket.py - ignoring
2021-09-29 22:29:11.235989 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/ad-qolsys/qolsys_requests.py - ignoring
2021-09-29 22:29:11.237054 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/ad-qolsys/qolsys_client.py
2021-09-29 22:29:11.247390 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/ad-qolsys/partition.py - ignoring
2021-09-29 22:29:11.248318 INFO AppDaemon: Initializing app qolsys_panel using class QolsysClient from module qolsys_client
2021-09-29 22:29:11.338711 INFO qolsys_panel: Creating qolsys_socket
2021-09-29 22:29:11.339595 INFO qolsys_panel: wrapping socket
2021-09-29 22:29:11.341740 INFO qolsys_panel: connecting to socket
2021-09-30 08:30:47.256521 INFO AppDaemon: New client Admin Client connected

When I look in my MQTT broker (I’m using Mosquitto broker), I see the following:

1632957197: Saving in-memory database to /data/mosquitto.db.
1632957335: Socket error on client 68mLtv5ZuFjrKToJgf6gTt, disconnecting.
1632957342: New connection from REDACTED  on port 1883.
1632957342: New client connected from REDACTED  as 4XVnPnFoiqsD0nmzQGQLS7 (p2, c1, k60, u'homeassistant').
1632957528: Socket error on client 4XVnPnFoiqsD0nmzQGQLS7, disconnecting.
1632957535: New connection from REDACTED  on port 1883.
1632957535: New client connected from REDACTED  as 667wnOxBd8A8IgpQzbXvM0 (p2, c1, k60, u'homeassistant').
1632958221: Socket error on client 667wnOxBd8A8IgpQzbXvM0, disconnecting.
1632958228: New connection from REDACTED  on port 1883.
1632958228: New client connected from REDACTED  as 1OnlKZexFAfg3tZfOg1Mcu (p2, c1, k60, u'homeassistant').
1632958998: Saving in-memory database to /data/mosquitto.db.
1632960799: Saving in-memory database to /data/mosquitto.db.
1632962600: Saving in-memory database to /data/mosquitto.db.
1632964401: Saving in-memory database to /data/mosquitto.db.
1632965444: New connection from REDACTED  on port 1883.
1632965444: New client connected from REDACTED  as appdaemon_mqtt_client (p2, c1, k60).
1632965717: Client appdaemon_mqtt_client disconnected.
1632965730: New connection from REDACTED on port 1883.
1632965730: New client connected from REDACTED  as appdaemon_mqtt_client (p2, c1, k60).
1632966202: Saving in-memory database to /data/mosquitto.db.
1632966554: New connection from REDACTED  on port 1883.
1632966554: Client <unknown> disconnected due to protocol error.
1632966554: New connection from REDACTED  on port 1883.
1632966554: Client <unknown> disconnected due to protocol error.
1632966554: New connection from REDACTED  on port 1883.
1632966554: Client <unknown> disconnected due to protocol error.
1632966554: New connection from REDACTED on port 1883.
1632966554: Client <unknown> disconnected due to protocol error.
1632966554: New connection from REDACTED  on port 1883.
1632966554: Client <unknown> disconnected due to protocol error.
1632966554: New connection from REDACTED on port 1883.
1632966554: Client <unknown> disconnected due to protocol error.
1632966554: New connection from REDACTED  on port 1883.
1632966554: Client <unknown> disconnected due to protocol error.
1632966554: New connection from REDACTED  on port 1883.
1632966554: Client <unknown> disconnected due to protocol error.
1632966554: New connection from REDACTED  on port 1883.
1632966554: Client <unknown> disconnected due to protocol error.
1632966554: New connection from REDACTED  on port 1883.
1632966554: Client <unknown> disconnected due to protocol error.
1632966961: Client appdaemon_mqtt_client disconnected.
1632966973: New connection from REDACTED  on port 1883.
1632966973: New client connected from REDACTED  as appdaemon_mqtt_client (p2, c1, k60).
1632968003: Saving in-memory database to /data/mosquitto.db.
1632968045: Client appdaemon_mqtt_client disconnected.
1632968211: New connection from REDACTED on port 1883.
1632968211: New client connected from REDACTED  as appdaemon_mqtt_client (p2, c1, k60).
1632968936: Client appdaemon_mqtt_client disconnected.
1632968949: New connection from REDACTED  on port 1883.
1632968949: New client connected from REDACTED  as appdaemon_mqtt_client (p2, c1, k60, u'homeassistant').
1632969804: Saving in-memory database to /data/mosquitto.db.

I don’t see any of the devices connected to the panel in HA, nor do I see the panel in HA. I’m not sure what’s going wrong here, and any advice would be appreciated.

It’s not connecting to your panel. Are you sure you enabled 3rd party integration on the panel? Try rebooting the panel then restarting AppDaemon. Also make sure the qolsys_host and qolsys_token are correct.

I just got set up and also had problems with it connecting to my panel – even with 3rd party integration enabled and a reboot. For some reason, after disabling, re-enabling, & rebooting it connected.

Just set this up, but AppDaemon seems to run into a bug and reloads all the time. I’m using AppD only for this integration; removing apps.yaml stops it from crashing. I get the following tracebacks:

2021-10-07 18:36:08.901638 WARNING AppDaemon: apps.yaml in the Config directory is deprecated. Please move apps.yaml to the apps directory.
2021-10-07 18:36:08.902520 WARNING AppDaemon: ------------------------------------------------------------
2021-10-07 18:36:08.904493 WARNING AppDaemon: Unexpected error:
2021-10-07 18:36:08.905347 WARNING AppDaemon: ------------------------------------------------------------
2021-10-07 18:36:08.912448 INFO MQTT: Connected to Broker at URL x.x.x.x:1883
2021-10-07 18:36:08.917139 WARNING AppDaemon: Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/appdaemon/app_management.py", line 585, in check_config
    new_config = await self.read_config()
  File "/usr/lib/python3.9/site-packages/appdaemon/app_management.py", line 463, in read_config
    await self.check_sequence_update(new_config.get("sequence", {}))
AttributeError: 'coroutine' object has no attribute 'get'

2021-10-07 18:36:08.919132 WARNING AppDaemon: ------------------------------------------------------------
/usr/lib/python3.9/site-packages/appdaemon/app_management.py:713: RuntimeWarning: coroutine 'run_in_executor' was never awaited
  self.logger.warning("-" * 60)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
2021-10-07 18:36:08.932287 WARNING AppDaemon: ------------------------------------------------------------
2021-10-07 18:36:08.933208 WARNING AppDaemon: Unexpected error during run()
2021-10-07 18:36:08.934011 WARNING AppDaemon: ------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/appdaemon/__main__.py", line 154, in run
    loop.run_until_complete(asyncio.gather(*pending))
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/usr/lib/python3.9/site-packages/appdaemon/utility_loop.py", line 53, in loop
    await self.AD.threading.create_initial_threads()
  File "/usr/lib/python3.9/site-packages/appdaemon/threading.py", line 121, in create_initial_threads
    self.total_threads = int(apps["active"])
TypeError: 'NoneType' object is not subscriptable
2021-10-07 18:36:08.944398 INFO AppDaemon: Previous message repeated 1 times
2021-10-07 18:36:08.945214 INFO AppDaemon: AppDaemon Exited

And it keeps restarting.

appdaemon.yaml:

secrets: /config/secrets.yaml
appdaemon:
  latitude: ...
  longitude: ...
  elevation: ...
  time_zone: ...
  plugins:
    HASS:
      type: hass
    MQTT:
      type: mqtt
      namespace: mqtt
      client_host: x.x.x.x
      client_port: 1883
      client_id: appdaemon
      client_user: appdaemon
      client_password: !secret mqtt_password
      birth_topic: appdaemon/status
      will_topic: appdaemon/status

http:
  url: https://127.0.0.1:5050
  password: !secret ad_password
  dash_ssl_certifiacate: /ssl/fullchain.pem
  dash_ssl_key: /ssl/privkey.pem

admin:

api:

hadashboard:

apps.yaml:

qolsys_panel:
  module: qolsys_client
  class: QolsysClient
  mqtt_namespace: mqtt
  qolsys_host: x.x.x.x
  qolsys_token: xxxxxx
  request_topic: qolsys/requests # Optional
  qolsys_info_topic: qolsys/panel/info # Optional
  qolsys_zone_update_topic: qolsys/panel/zone_update # Optional
  qolsys_zone_event_topic: qolsys/panel/zone_event # Optional
  qolsys_alarming_event_topic: qolsys/panel/alarming # Optional
  qolsys_disarming_event_topic: qolsys/panel/disarm # Optional
  qolsys_confirm_arm_code: False # Optional
  qolsys_confirm_disarm_code: False # Optional
  qolsys_arm_away_always_instant: False # Optional
  homeassistant_mqtt_discovery_topic: homeassistant/

Any ideas?

I’ve noticed that there is quite a bit of dead or unused code in the integration and that not using the defaults and overriding them in the appdaemon.yaml file seems to have unexpected results. So my suggestion is to just override the bare minimum config values and leave the others alone. For example, the following don’t seem to be necessary:

  • client_id
  • birth_topic
  • will_topic

I also suggest not using https until you have everything working so that you are not debugging multiple issues at once. Only url seems to be necessary in http:

In apps.yaml I suggest leaving the hello world app in there (for now). So for example, my apps.yaml looks like this:

hello_world:
  module: hello
  class: HelloWorld

qolsys_panel:
  module: qolsys_client
  class: QolsysClient
  mqtt_namespace: mqtt
  qolsys_host: x.x.x.x
  qolsys_token: xxxxxx
  request_topic: qolsys/requests # Optional
  qolsys_info_topic: qolsys/info # Optional
  qolsys_zone_event_topic: qolsys/zone_event # Optional
  qolsys_alarming_event_topic: qolsys/alarming # Optional
  qolsys_disarming_event_topic: qolsys/disarm # Optional
  qolsys_confirm_disarm_code: True
  qolsys_confirm_arm_code: True
  log_level: DEBUG

Also, apps.yaml should be in the apps directory (/config/appdaemon/apps/apps.yaml)

Make sure that you have mqtt working correctly. You can test it by going into the Configuration for the MQTT Broker Integration and listening to # while publish whatever message you want. Be sure to re-configure the broker so that you can enter the right username, password, etc

Also important to make sure that the panel is communicating. It’s very sensitive about new connections and will lock you out if you are not careful(for example - if you are constantly restarting AppDaemon). Here’s the easiest way to test:

openssl s_client -host xxx.xxx.xxx.xxx -port 12345

Finally, there are some changes you need to make to mqtt configuration to get password authentication to work. Assuming that you are using the mosquito broker add-on, you should have

customize:
  active: false

true will create ACL issues. Also be sure that you have a login section populated in the mqtt configuration like:

logins:
  - username: xxxxx
    password: xxxx

There are a couple of key points about setting up MQTT on this post: Qolsys IQ Panel 2 and 3rd party integration - #285 by DDragon and this link on that post: https://github.com/home-assistant/addons/blob/e933cba5a457a492fec458dcb2629e9dbadeb569/mosquitto/DOCS.md#access-control-lists-acls

I’ve been busting my head for months trying to get this to work…and adding the code you provided finally got discovery to work for me. I think your point about max number of bytes set is dead on…in my case I have a Hardware translator which I think increases the amount of information that get’s sent in that initial payload request…thank you so much for posting! @crazeeeyez you should really consider adding this implementation of the listen socket…it solved my problem right away.

As @big.server mentioned devices were offline at first, but restart brought them back online. I will watch this for the next couple of days and report back if there are any issues. Thanks to all of you for posting your experiences and challenges these last couple of months…I finally had some extra time to jump back on this and glad that it appears to be working.

@amirite, can you elaborate on the setup with the Fire HD 8? Are you mirroring the qolsys panel like that they currently do with the optional secondary screen or something else entirely? Thanks for sharing.

I’m happy to accept tested pull requests :slight_smile: . Unfortunately I’ve got a day (and feels like night) job too. Maybe if I got Hacktoberfest fake internet credits for this I would be more motivated :upside_down_face: .

I will look into that implementation. TBH I am not even close to familiar to the socket implementation. @mzac that original python script you wrote is still at the core of the socket connection. What do you think of @big.server 's rewrite? Qolsys IQ Panel 2 and 3rd party integration - #340 by big.server

I’ve got some time in the next week or so and I’ll put together a pull request. I have been testing my changes since my post and I haven’t run into any issues at all related to it. If there are unit or other tests I’ll also make sure to add my own. I appreciate the work others have put into the integration and I’m happy to contribute.

2 Likes