Qolsys IQ Panel 2 and 3rd party integration

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.

@crazeeeyez

Yes, rebooting the panel got past the first issue. Good call – not sure why it needed that, but it seems to have fixed it.

2021-04-27 19:09:18.781360 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/hello.py - ignoring
2021-04-27 19:09:18.782171 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/ad-qolsys/qolsys_socket.py - ignoring
2021-04-27 19:09:18.783380 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/ad-qolsys/door_window.py - ignoring
2021-04-27 19:09:18.784615 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/ad-qolsys/qolsys_client.py
2021-04-27 19:09:18.806500 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/ad-qolsys/partition.py - ignoring
2021-04-27 19:09:18.807292 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/ad-qolsys/qolsys_requests.py - ignoring
2021-04-27 19:09:18.808613 INFO AppDaemon: Initializing app qolsys_panel using class QolsysClient from module qolsys_client
2021-04-27 19:09:18.859516 INFO qolsys_panel: Creating qolsys_socket
2021-04-27 19:09:18.865729 INFO qolsys_panel: wrapping socket
2021-04-27 19:09:18.871233 INFO qolsys_panel: connecting to socket
2021-04-27 19:09:19.373360 INFO qolsys_panel: Connected wrappedSocket: <ssl.SSLSocket fd=12, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=(‘172.30.33.5’, 42484), raddr=(‘192.168.86.57’, 12345)>
2021-04-27 19:09:19.374790 INFO qolsys_panel: Starting listener thread
2021-04-27 19:09:19.376784 INFO qolsys_panel: Previous message repeated 1 times
2021-04-27 19:09:19.377241 INFO qolsys_panel: starting listen
2021-04-27 19:09:19.378486 INFO qolsys_panel: started listener thread
2021-04-27 19:09:19.379814 INFO qolsys_panel: started listener
2021-04-27 19:09:19.381394 INFO qolsys_panel: QolSys Socket Created
2021-04-27 19:09:19.382395 INFO qolsys_panel: listener for requests topic: qolsys/requests
2021-04-27 19:09:19.386709 INFO qolsys_panel: listener for info topic: qolsys/panel/info
2021-04-27 19:09:19.392456 INFO qolsys_panel: listener for zone event topic: qolsys/panel/zone_event
2021-04-27 19:09:19.394840 INFO qolsys_panel: listener for zone update topic: qolsys/panel/zone_update
2021-04-27 19:09:19.397343 INFO qolsys_panel: listener for arming topic: qolsys/panel/alarming
2021-04-27 19:09:19.401508 INFO AppDaemon: App initialization complete

Next issue is getting anything to show-up in the overview. I’m new to HA and this level of setup so honestly a bit excited and surprised that I got this far lol.

I wonder if it has anything to do with the configuration of my Mosquito add-on

logins:

  • username: XXXX
    password: XXXX
    anonymous: true
    customize:
    active: false
    folder: mosquitto
    certfile: fullchain.pem
    keyfile: privkey.pem
    require_certificate: false

I set anonymous to true because it was the only way I could get it to work. I tend to do a lot of this stuff by trial and error.

Just armed and unarmed the system and saw it registered with this:

2021-04-27 19:09:19.382395 INFO qolsys_panel: listener for requests topic: qolsys/requests
2021-04-27 19:09:19.386709 INFO qolsys_panel: listener for info topic: qolsys/panel/info
2021-04-27 19:09:19.392456 INFO qolsys_panel: listener for zone event topic: qolsys/panel/zone_event
2021-04-27 19:09:19.394840 INFO qolsys_panel: listener for zone update topic: qolsys/panel/zone_update
2021-04-27 19:09:19.397343 INFO qolsys_panel: listener for arming topic: qolsys/panel/alarming
2021-04-27 19:09:19.401508 INFO AppDaemon: App initialization complete
2021-04-27 19:10:06.608349 INFO qolsys_panel: publishing ZONE_EVENT event to: qolsys/panel/zone_event
2021-04-27 19:10:06.753072 INFO qolsys_panel: publishing ZONE_EVENT event to: qolsys/panel/zone_event
2021-04-27 19:10:10.172231 INFO qolsys_panel: publishing ZONE_EVENT event to: qolsys/panel/zone_event
2021-04-27 19:10:10.242330 INFO qolsys_panel: publishing ZONE_EVENT event to: qolsys/panel/zone_event
2021-04-27 19:10:33.611880 INFO qolsys_panel: publishing ZONE_EVENT event to: qolsys/panel/zone_event
2021-04-27 19:17:23.163432 INFO qolsys_panel: publishing ARMING event to: qolsys/panel/alarming
2021-04-27 19:17:35.363029 INFO qolsys_panel: publishing ARMING event to: qolsys/panel/alarming

I can’t say what should or should not be in your overview. What I would recommend is going to your HA Developer Tools | States and where it says Filter Entities type in alarm_control_panel. If it shows up there, you’re good ! You just need to add an alarm control panel card to your UI.

You can also filter for binary_sensor to see your zones.

@crazeeeyez

I haven’t done anything to change the Overview at this point. It’s still in the original configuration and I have not done anything to tweak it or take it out of the auto-generated version.

When I go to developer tools, and filter for alarm_control_panel, nothing comes up. When I search for binary_sensor – I see ones for my door that are on z-wave, binary_sensor.pending_system_alerts and binary_sensor.updater and that’s it. Should I see more? Where is the alarm control panel UI? Thanks!

Update: I started editing the overview and went to add the alarm card. When it asks for entity, I try:

alarm_control_panel or alarm_control_panel.house_alarm (saw someone using this on quick google) and the response from the system is entity not available for both. Other things I type, it just says invalid configuration

It also shows used states arm_home and arm_away

Update 2: I included the below code from @Smwoodward in configuration.yaml and can now add Qolsys Alarm Panel to the overview but it is disconnected from anything that I actually do with the Qolsys panel. What am I missing?

alarm_control_panel:

  • platform: template
    panels:
    qolsys:
    name: Qolsys Alarm Panel
    unique_id: qolsys_alarm_panel
    value_template: “{{ states(‘alarm_control_panel.qolsys_alarm’) }}”
    arm_away:
    service: alarm_control_panel.alarm_arm_away
    target:
    entity_id: alarm_control_panel.qolsys_alarm
    arm_home:
    service: alarm_control_panel.alarm_arm_home
    target:
    entity_id: alarm_control_panel.qolsys_alarm
    disarm:
    - service: alarm_control_panel.alarm_disarm
    target:
    entity_id: alarm_control_panel.qolsys_alarm
    alarm_control_panel Qolsys:
  • platform: manual
    name: Qolsys Alarm
    arming_time: 0
    delay_time: 0
    trigger_time: 0
    disarmed:
    trigger_time: 0
    armed_home:
    arming_time: 0
    delay_time: 0

The Overview uses the entity alarm_control_panel.qolsys. There is also an entity alarm_control_panel.qolsys_alarm. It also doesn’t work, meaning it shows that you can arm and unarm but it is not reflected on my actual qolsys.

@dinman you do not need that template alarm_control_panel. If you’re not seeing the alarm_control_panel show up in your HA, I need to get more logging. Part of the magic is not having to template it out.

you can add

log_level: "DEBUG"

(see Errors in AppDaemon logs and no entities being created. · Issue #5 · roopesh/ad-qolsys · GitHub) to the configuration for this app in apps.yaml.

I don’t see the INFO being published from the panel. Can you confirm the namespace defined (in appdaemon.yaml) for the MQTT plugin is mqtt?

---
secrets: /config/secrets.yaml
appdaemon:
  latitude: zzz
  longitude: yyy
  elevation: z
  time_zone: America/Los_Angeles
  plugins:
    HASS:
      type: hass
      namespace: default
    MQTT:
      type: mqtt
      namespace: mqtt
      client_host: 192.168.x.y
      client_port: 1883
http:
  url: http://127.0.0.1:5050
admin:
api:
hadashboard:

Here’s what I have:

secrets: /config/secrets.yaml

appdaemon:

latitude: zzz

longitude: yyy

elevation: z

time_zone: America/New_York

plugins:

HASS:

  type: hass

MQTT:

  type: mqtt

  namespace: mqtt

  client_host: 192.168.86.141

  client_port: 1883

http:

url: http://127.0.0.1:5050

admin:

api:

hadashboard:

It looked like you have a username/password associated with your mosquitto add-on config. I don’t see any authentication happening in your plugin setup.

Here’s what my mosquitto add-on config looks like:

logins: []
anonymous: true
customize:
  active: true
  folder: mosquitto
certfile: fullchain.pem
keyfile: privkey.pem
require_certificate: false

Mine looks like:


logins:

  • username: mqttuser
    password: mqttpass
    anonymous: true
    customize:
    active: false
    folder: mosquitto
    certfile: fullchain.pem
    keyfile: privkey.pem
    require_certificate: false

If I input yours, I get the following errors:


[s6-init] making user provided files available at /var/run/s6/etc…exited 0.
[s6-init] ensuring user provided files have correct perms…exited 0.
[fix-attrs.d] applying ownership & permissions fixes…
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts…
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[00:15:08] INFO: Setup mosquitto configuration
[00:15:08] WARNING: SSL not enabled - No valid certs found!
[00:15:09] INFO: No local user available
[00:15:09] INFO: Initialize Home Assistant Add-on services
[00:15:09] ERROR: Can’t setup Home Assistant service mqtt
[00:15:09] INFO: Initialize Home Assistant discovery
[00:15:09] INFO: Start Mosquitto daemon
1619583309: Error: Unable to open include_dir ‘/share/mosquitto’.
1619583309: Error found at /etc/mosquitto.conf:33.

So… I’m no MQTT expert, but what I can tell you is you’re going to have trouble using this to arm/disarm or get statuses till your AppDaemon and MQTT are working nicely. It looks to me like the qolsys client can’t publish to MQTT.

I would suggest running a listener (subscriber) on # and see if the messages are being published from the qolsys client app. They’d look like

# Request the INFO to be published
{"event":"INFO", "token":"blah"}

# Arm stay:
{"event":"ARM", "arm_type":"stay", "partition_id": 0, "token":"blah"}

# Arm away
{"event":"ARM", "arm_type":"away", "partition_id": 0, "token":"blah"}

# (Variant) Arm away - Instant
{"event":"ARM", "arm_type":"away", "partition_id": 0, "token":"blah", "instant": true}

# Disarm
{"event":"DISARM", "usercode":0000, "token":"blah"}