Qolsys IQ Panel 2 and 3rd party integration

So here are a few things that I’ve noticed. Btw this is amazing.

Entity unique IDs
Setting the arm away time for instant arm for example
Last will mqtt topic if qolsys goes down and to retain the entities
Do you do a periodic INFO scan? Would be good to do this every few times for if a person adds a sensor.

If I think of anything else I will let you know. But amazing work once I got it to work. Lol

Great thread, I too have a IQ2 panel. I am a HA newbie, so bear with me.

I got HACS configured, installed MQTT broker in my HA OS running in Virtual Box on my Windows server.

I managed to add the custom repository using the github path as AppDaemon, but when I click on the custom repository, the pop up frame seems to be stuck at “Loading information…”

image

You added the AppDaemon addon first ?

I’m very new to HASS. Is it possible this will be made into an official integration once all the kinks are ironed out?

Lots of things are possible. However, this was written specifically for AppDaemon. I think official integrations require use of the HA APIs (not MQTT). Could be done, I’m sure. I don’t think I’ll invest my time there, since AppDaemon works well for me.

Do you have AppDaemon installed? Latest HA and HACS?

Thanks for the quick response, I didn’t have the AppDaemon 4 Addon, after installing it, I was able to install the Client for Qolsys!

Update: got this resolved by adding user and password to the MQTT section of the AppDaemon.yaml.

My client cannot connect to MQTT broker, getting an NOT Authorised error according to AppDaemon log:

2021-04-11 00:05:46.221214 CRITICAL MQTT: Could not complete MQTT Plugin initialization, for Connection was refused due to Not Authorised

Do I need to setup MQTT broker to allow anonymous connect along with a ACL list? addons/DOCS.md at e933cba5a457a492fec458dcb2629e9dbadeb569 · home-assistant/addons · GitHub

I fixed the authorization error in AppDaemon by adding the client_user and client_password config nodes to the MQTT config section in the appdaemon.yaml.

I am now seeing different KeyError during mqtt_zone_update_event_received, it seems like qolsys client is able to connect to my alarm panel fine and it is getting all the sensors. I think I might be missing some zone configuration in my HA setup.

Looking at the code, it seems to be getting the zones from an INFO call to the panel, however I am not sure how I can add additional logging to see which zones got loaded from the initial INFO call.

        # Populate the zones and partitions with an INFO call
        info_payload = {"event":"INFO", "token":self.qolsys_token}
        self.call_service("mqtt/publish", namespace=self.mqtt_namespace, topic=self.request_topic, payload=json.dumps(info_payload))

Also if the qolsys client is working, where do I find all the sensors from my alarm? Would they just show up under Entties or Devies in HA?

Did a bit more digging in the code, so the Populate the zones and partitions with an INFO call is been made. However it seems like my panel is not returning any useful partition or zone info. Below are the logs from AppDaemon:

2021-04-11 01:44:40.681868 INFO qolsys_panel: listener for arming topic: qolsys/panel/alarming
2021-04-11 01:44:40.691056 INFO qolsys_panel: Populate zones and partitions with INFO call
2021-04-11 01:44:40.704014 INFO AppDaemon: App initialization complete
2021-04-11 01:44:41.829401 INFO qolsys_panel: event: INFO
2021-04-11 01:44:41.831401 INFO qolsys_panel: event: INFO, usercode: None, partition_id: None, arm_type: None

@ri3eboi see this Errors in AppDaemon logs and no entities being created. · Issue #5 · roopesh/ad-qolsys · GitHub

I’ve pushed an update with this change. Update and let me know.

1 Like

Does appdaemon need to be restarted with updates to your plug-in? I’m not familiar with appdaemon enough to know.

Probably. AppDaemon caches all the dependent files that also get updated. Therefore the restart is required.

Gotcha.

Another improvement on top keeping the sensor entities alive if appdaemon doesn’t reconnect is creating another entity that can be used for notifications if connection doesn’t come back up. I just updated and apparently I need to reboot the panel.

I’m not 100% sure what caused it to hang up, but because the mqtt topics are not being retained, I pass many device through to HomeKit, and when they drop out due to a restart, I have to setup the HomeKit sensors again.

Thanks for the quick fix and a version update. The 8k receive buffer fixed things for me. I am now getting all my sensors in HA and can see my alarm arming state! Going to try disarming it tomorrow.

Curious what are you all doing with the alarm panel sensor states?

I use the alarm control panel card. Shows me status and arm/disarm buttons; no extra work required.

What can I do to get this thing working? Appdaemon seems to be stuck… appreciate any help, thanks!

Add-on version: 0.6.0
You are running the latest version of this add-on.
System: Home Assistant OS 5.13 (amd64 / qemux86-64)
Home Assistant Core: 2021.4.6
Home Assistant Supervisor: 2021.04.0

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.
[01:27:39] INFO: Starting AppDaemon…
2021-04-27 01:27:41.019720 INFO AppDaemon: AppDaemon Version 4.0.8 starting
2021-04-27 01:27:41.020551 INFO AppDaemon: Python version is 3.8.8
2021-04-27 01:27:41.020886 INFO AppDaemon: Configuration read from: /config/appdaemon/appdaemon.yaml
2021-04-27 01:27:41.021007 INFO AppDaemon: Added log: AppDaemon
2021-04-27 01:27:41.021509 INFO AppDaemon: Added log: Error
2021-04-27 01:27:41.021586 INFO AppDaemon: Added log: Access
2021-04-27 01:27:41.021647 INFO AppDaemon: Added log: Diag
2021-04-27 01:27:41.070385 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2021-04-27 01:27:41.138560 INFO HASS: HASS Plugin Initializing
2021-04-27 01:27:41.138764 INFO HASS: HASS Plugin initialization complete
2021-04-27 01:27:41.139757 INFO AppDaemon: Loading Plugin MQTT using class MqttPlugin from module mqttplugin
2021-04-27 01:27:41.155811 INFO MQTT: MQTT Plugin Initializing
2021-04-27 01:27:41.156154 INFO MQTT: Using ‘mqtt-client/status’ as Will Topic
2021-04-27 01:27:41.156691 INFO MQTT: Using ‘mqtt-client/status’ as Birth Topic
2021-04-27 01:27:41.156777 INFO MQTT: Using appdaemon_mqtt_client as Client ID
2021-04-27 01:27:41.157848 INFO AppDaemon: Initializing HTTP
2021-04-27 01:27:41.158482 INFO AppDaemon: Using ‘ws’ for event stream
2021-04-27 01:27:41.161613 INFO AppDaemon: Starting API
2021-04-27 01:27:41.164363 INFO AppDaemon: Starting Admin Interface
2021-04-27 01:27:41.165137 INFO AppDaemon: Starting Dashboards
2021-04-27 01:27:41.196014 INFO HASS: Connected to Home Assistant 2021.4.6
2021-04-27 01:27:41.200575 INFO MQTT: Connected to Broker at URL 192.168.86.141:1883
2021-04-27 01:27:41.216577 INFO AppDaemon: App ‘qolsys_panel’ added
2021-04-27 01:27:41.217937 INFO AppDaemon: Found 1 total apps
2021-04-27 01:27:41.218675 INFO AppDaemon: Starting Apps with 1 workers and 1 pins
2021-04-27 01:27:41.221106 INFO AppDaemon: Running on port 5050
2021-04-27 01:27:41.222531 INFO AppDaemon: Got initial state from namespace mqtt
2021-04-27 01:27:41.222923 INFO MQTT: MQTT Plugin initialization complete
2021-04-27 01:27:41.257132 INFO HASS: Evaluating startup conditions
2021-04-27 01:27:41.265643 INFO HASS: Startup condition met: hass state=RUNNING
2021-04-27 01:27:41.266565 INFO HASS: All startup conditions met
2021-04-27 01:27:41.276322 INFO AppDaemon: Got initial state from namespace default
2021-04-27 01:27:43.235069 INFO AppDaemon: Scheduler running in realtime
2021-04-27 01:27:43.236767 INFO AppDaemon: Adding /config/appdaemon/apps to module import path
2021-04-27 01:27:43.236989 INFO AppDaemon: Adding /config/appdaemon/apps/ad-qolsys to module import path
2021-04-27 01:27:43.251102 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/hello.py - ignoring
2021-04-27 01:27:43.252507 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/ad-qolsys/qolsys_socket.py - ignoring
2021-04-27 01:27:43.253740 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/ad-qolsys/door_window.py - ignoring
2021-04-27 01:27:43.254583 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/ad-qolsys/qolsys_client.py
2021-04-27 01:27:43.274493 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/ad-qolsys/partition.py - ignoring
2021-04-27 01:27:43.276334 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/ad-qolsys/qolsys_requests.py - ignoring
2021-04-27 01:27:43.277723 INFO AppDaemon: Initializing app qolsys_panel using class QolsysClient from module qolsys_client
2021-04-27 01:27:43.325312 INFO qolsys_panel: Creating qolsys_socket
2021-04-27 01:27:43.329709 INFO qolsys_panel: wrapping socket
2021-04-27 01:27:43.336183 INFO qolsys_panel: connecting to socket

Hey @crazeeeyez any chance you have some idea of what I need to do to get passed this? I had the system receiving info from the panel and then I reset the system and it no longer was getting changes in events or arming. Also, even when that worked, it never integrated into the overview … so was not clear to me where it was sending the info. Anyway, nice work on the qolsys integration… have been looking for something like this for a while.

Have you tried rebooting your panel, then once it’s back up restart appdaemon?

can you try to connect to the port manually? Getting stuck at that point seems to be more about establishing a connection to the panel than the app.