Qolsys IQ Panel 2 and 3rd party integration

Yeah that’s apparently an integration that qolsys and alarm.com have. Haven’t found anything so far to do that directly.

This is awesome! Everything was all working great for a day or so, but then the AppDaemon log has been flooded with:


2021-05-30 01:43:56.093063 CRITICAL AppDaemon: Thread will be restarted
2021-05-30 01:43:56.092728 CRITICAL AppDaemon: Pinned apps were: ['qolsys_panel']
2021-05-30 01:43:56.092289 CRITICAL AppDaemon: Thread thread-1 has died
2021-05-30 01:43:56.091837 INFO AppDaemon: --------------------------------------------------
2021-05-30 01:43:56.091458 INFO AppDaemon: thread-1 - qsize: 212 | current callback: idle | since 2021-05-29T17:06:39-10:00, | alive: True, | pinned apps: ['qolsys_panel']
2021-05-30 01:43:56.091007 INFO AppDaemon: thread-0 - qsize: 0 | current callback: idle | since never, | alive: True, | pinned apps: ['hello_world']
2021-05-30 01:43:56.090371 INFO AppDaemon: --------------------------------------------------
2021-05-30 01:43:56.090054 INFO AppDaemon: Total Q Entries: 212
2021-05-30 01:43:56.089629 INFO AppDaemon: Last activity: 2021-05-29T05:55:10-10:00
2021-05-30 01:43:56.089266 INFO AppDaemon: Most used threads: 1 at 2021-05-29 05:55:10-10:00
2021-05-30 01:43:56.088835 INFO AppDaemon: Currently busy threads: 0
2021-05-30 01:43:56.087865 INFO AppDaemon: --------------------------------------------------
2021-05-30 01:43:56.087480 INFO AppDaemon: Threads
2021-05-30 01:43:56.087168 INFO AppDaemon: --------------------------------------------------
2021-05-30 01:43:56.086765 WARNING AppDaemon: Queue size for thread thread-1 is 212, callback is 'idle' called at 2021-05-29 17:06:39-10:00 - possible thread starvation

The entities are all listed as unavailable in AppDaemon now. Any idea what’s going on?

Doesn’t include any issues with the qolsys app. I suggest a swift restart of AppDaemon.

Found any ideas to get appdaemon to auto reboot when that happens?

Rebooting the panel got everything back. It’s working but the log is saturated with these messages:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/appdaemon/logging.py", line 140, in emit
    logger.warning("message: %s, args: %s", record.msg, record.args)
  File "/usr/local/lib/python3.8/logging/__init__.py", line 1458, in warning
    self._log(WARNING, msg, args, **kwargs)
  File "/usr/local/lib/python3.8/logging/__init__.py", line 1589, in _log
    self.handle(record)
  File "/usr/local/lib/python3.8/logging/__init__.py", line 1599, in handle
    self.callHandlers(record)
  File "/usr/local/lib/python3.8/logging/__init__.py", line 1661, in callHandlers
    hdlr.handle(record)
  File "/usr/local/lib/python3.8/logging/__init__.py", line 954, in handle
    self.emit(record)
  File "/usr/local/lib/python3.8/site-packages/appdaemon/logging.py", line 164, in emit
    logger.warning(traceback.format_exc())
  File "/usr/local/lib/python3.8/traceback.py", line 167, in format_exc
    return "".join(format_exception(*sys.exc_info(), limit=limit, chain=chain))
  File "/usr/local/lib/python3.8/traceback.py", line 120, in format_exception
    return list(TracebackException(
  File "/usr/local/lib/python3.8/traceback.py", line 493, in __init__
    context = TracebackException(
  File "/usr/local/lib/python3.8/traceback.py", line 493, in __init__
    context = TracebackException(
  File "/usr/local/lib/python3.8/traceback.py", line 493, in __init__
    context = TracebackException(
  [Previous line repeated 173 more times]
  File "/usr/local/lib/python3.8/traceback.py", line 508, in __init__
    self.stack = StackSummary.extract(
  File "/usr/local/lib/python3.8/traceback.py", line 336, in extract
    limit = getattr(sys, 'tracebacklimit', None)
RecursionError: maximum recursion depth exceeded while calling a Python object

2021-05-30 09:19:41.279754 WARNING AppDaemon: ------------------------------------------------------------
2021-05-30 09:19:41.279480 WARNING AppDaemon: Unexpected error occurred in LogSubscriptionHandler.emit()
2021-05-30 09:19:41.279252 INFO AppDaemon: Previous message repeated 1 times

EDIT: I see this issue was covered above. I’ll try the ACL route. Might want to add this to a FAQ / troubleshooting somewhere.

@Smwoodward I see this Help with setting state on HASS restart - #6 by Soul but I haven’t seen how I can use it (no effort). Since the qolsys app inherits from MQTT, I’d have to have a separate “watchdog” app inheriting from HASS.

I was thinking that there might need to be some sort of script/second watchdog app to restart the Qolsys app if all of the sensors become unavailable, then perhaps send a notification if they don’t come back as available after a certain number of restarts.

I do still wish there was a way to programmatically restore or prevent the alarm panel from locking out the connection, thus requiring a restart of the alarm panel.

I have never had the lockout happen. I have no idea why it happens. Is there an error that shows up in the logs when it happens?

I’m not sure but I can say that once I implemented Username / Password on my MQTT Broker the panel via AppDaemon has been rock solid. Something about using Anonymous was causing AppDaemon to spam errors and lock up constantly after only a few minutes! I’ll report back here if it locks up again but so far so good!

has anyone had success with using the entry_delay? trying to send a command to mirror what happens on the panel by selecting arm stay and no entry delay.

I tried adding the entry_delay with a 0 like is done for delay but that did not work. When i open the door i get the default entry timer.

I finally have some free time to set this up this week. Just wanted to thank you again for your amazing work. One thing I wanted to ask though - has there been any luck getting z-wave control? I really want to be able to use my lock without having to unpair it from the panel. My current workaround (because I use HomeKit as a front end) is to use the Alarm.com Homebridge plugin that uses web scraping. It’s pretty laggy, but works for my lock and garage door.

There doesn’t appear to be a way to do zwave control through local control.

That’s a shame. A little surprising too.

I do still wish there was a way to programmatically restore or prevent the alarm panel from locking out the connection, thus requiring a restart of the alarm panel.

Are you using MQTT authentication or anonymous? I had constant lockouts with anonymous and now 5 days after implementing user auth in MQTT Broker and AppDaemon I haven’t had a single lockout of the panel or the need to restart anything in the chain.

Looks like I spoke too soon. AppDaemon is getting log saturation again (this has been working reliably for almost a week prior to this). It should be noted that the Qolsys panel is the only thing I have using AppDaemon and MQTT.

2021-06-06 16:42:40	stdout	2021-06-06 06:42:40.433136 WARNING AppDaemon: ------------------------------------------------------------
2021-06-06 16:42:40	stdout	
2021-06-06 16:42:40	stdout	RecursionError: maximum recursion depth exceeded while calling a Python object
2021-06-06 16:42:40	stdout	    limit = getattr(sys, 'tracebacklimit', None)
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/traceback.py", line 336, in extract
2021-06-06 16:42:40	stdout	    self.stack = StackSummary.extract(
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/traceback.py", line 508, in __init__
2021-06-06 16:42:40	stdout	  [Previous line repeated 173 more times]
2021-06-06 16:42:40	stdout	    context = TracebackException(
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/traceback.py", line 493, in __init__
2021-06-06 16:42:40	stdout	    context = TracebackException(
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/traceback.py", line 493, in __init__
2021-06-06 16:42:40	stdout	    context = TracebackException(
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/traceback.py", line 493, in __init__
2021-06-06 16:42:40	stdout	    return list(TracebackException(
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/traceback.py", line 120, in format_exception
2021-06-06 16:42:40	stdout	    return "".join(format_exception(*sys.exc_info(), limit=limit, chain=chain))
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/traceback.py", line 167, in format_exc
2021-06-06 16:42:40	stdout	    logger.warning(traceback.format_exc())
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/site-packages/appdaemon/logging.py", line 164, in emit
2021-06-06 16:42:40	stdout	    self.emit(record)
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/logging/__init__.py", line 954, in handle
2021-06-06 16:42:40	stdout	    hdlr.handle(record)
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/logging/__init__.py", line 1661, in callHandlers
2021-06-06 16:42:40	stdout	    self.callHandlers(record)
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/logging/__init__.py", line 1599, in handle
2021-06-06 16:42:40	stdout	    self.handle(record)
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/logging/__init__.py", line 1589, in _log
2021-06-06 16:42:40	stdout	    self._log(WARNING, msg, args, **kwargs)
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/logging/__init__.py", line 1458, in warning
2021-06-06 16:42:40	stdout	    logger.warning("message: %s, args: %s", record.msg, record.args)
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/site-packages/appdaemon/logging.py", line 140, in emit
2021-06-06 16:42:40	stdout	Traceback (most recent call last):
2021-06-06 16:42:40	stdout	
2021-06-06 16:42:40	stdout	During handling of the above exception, another exception occurred:
2021-06-06 16:42:40	stdout	
2021-06-06 16:42:40	stdout	RecursionError: maximum recursion depth exceeded
2021-06-06 16:42:40	stdout	  [Previous line repeated 171 more times]
2021-06-06 16:42:40	stdout	    context = TracebackException(
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/traceback.py", line 493, in __init__
2021-06-06 16:42:40	stdout	    context = TracebackException(
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/traceback.py", line 493, in __init__
2021-06-06 16:42:40	stdout	    context = TracebackException(
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/traceback.py", line 493, in __init__
2021-06-06 16:42:40	stdout	    return list(TracebackException(
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/traceback.py", line 120, in format_exception
2021-06-06 16:42:40	stdout	    return "".join(format_exception(*sys.exc_info(), limit=limit, chain=chain))
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/traceback.py", line 167, in format_exc
2021-06-06 16:42:40	stdout	    logger.warning(traceback.format_exc())
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/site-packages/appdaemon/logging.py", line 164, in emit
2021-06-06 16:42:40	stdout	    self.emit(record)
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/logging/__init__.py", line 954, in handle
2021-06-06 16:42:40	stdout	    hdlr.handle(record)
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/logging/__init__.py", line 1661, in callHandlers
2021-06-06 16:42:40	stdout	    self.callHandlers(record)
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/logging/__init__.py", line 1599, in handle
2021-06-06 16:42:40	stdout	    self.handle(record)
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/logging/__init__.py", line 1589, in _log
2021-06-06 16:42:40	stdout	    self._log(WARNING, msg, args, **kwargs)
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/logging/__init__.py", line 1458, in warning
2021-06-06 16:42:40	stdout	    logger.warning("message: %s, args: %s", record.msg, record.args)
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/site-packages/appdaemon/logging.py", line 140, in emit
2021-06-06 16:42:40	stdout	Traceback (most recent call last):
2021-06-06 16:42:40	stdout	
2021-06-06 16:42:40	stdout	During handling of the above exception, another exception occurred:
2021-06-06 16:42:40	stdout	
2021-06-06 16:42:40	stdout	RecursionError: maximum recursion depth exceeded
2021-06-06 16:42:40	stdout	  [Previous line repeated 168 more times]
2021-06-06 16:42:40	stdout	    context = TracebackException(
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/traceback.py", line 493, in __init__
2021-06-06 16:42:40	stdout	    context = TracebackException(
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/traceback.py", line 493, in __init__
2021-06-06 16:42:40	stdout	    context = TracebackException(
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/traceback.py", line 493, in __init__
2021-06-06 16:42:40	stdout	    return list(TracebackException(
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/traceback.py", line 120, in format_exception
2021-06-06 16:42:40	stdout	    return "".join(format_exception(*sys.exc_info(), limit=limit, chain=chain))
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/traceback.py", line 167, in format_exc
2021-06-06 16:42:40	stdout	    logger.warning(traceback.format_exc())
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/site-packages/appdaemon/logging.py", line 164, in emit
2021-06-06 16:42:40	stdout	    self.emit(record)
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/logging/__init__.py", line 954, in handle
2021-06-06 16:42:40	stdout	    hdlr.handle(record)
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/logging/__init__.py", line 1661, in callHandlers
2021-06-06 16:42:40	stdout	    self.callHandlers(record)
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/logging/__init__.py", line 1599, in handle
2021-06-06 16:42:40	stdout	    self.handle(record)
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/logging/__init__.py", line 1589, in _log
2021-06-06 16:42:40	stdout	    self._log(WARNING, msg, args, **kwargs)
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/logging/__init__.py", line 1458, in warning
2021-06-06 16:42:40	stdout	    logger.warning("message: %s, args: %s", record.msg, record.args)
2021-06-06 16:42:40	stdout	  File "/usr/local/lib/python3.8/site-packages/appdaemon/logging.py", line 140, in emit
2021-06-06 16:42:40	stdout	Traceback (most recent call last):

In my case in order to get everything back, I had to first restart the panel and then restart AppDaemon. Restarting AppDaemon by itself did not restore communication, nor did restarting the panel after restarting AppDaemon. I think this suggests that the panel itself is getting locked up or locking out communication.

Does anyone know how to access the actual panel logs (@mzac maybe)? The only thing I see is an option to “upload logs to the server”, and there’s not much information about that in the manual.

@crazeeeyez @Smwoodward I have submitted a pull request that fixes the logging errors. Not sure if this will fix the AppDaemon lockups but it certainly cleans up the log to the tune of hundreds if not thousands of lines.

By the way, now that the log is cleaned up, I have noticed that restarting Home Assistant seems to make the connection to the panel close eventually. This would explain why the panel was running so well for me for about a week until I started messing with my config and restarting Home Assistant again.

Any idea why that may be? Perhaps we need some sort of timeout or better restart procedure in AppDaemon regarding HASS and Qolsys Apps?

I’ve noticed that too. If I restart HA, it does require me to frequently restart appdaemon. And it does seem like when restarting appdaemon it doesn’t close the connection to the panel, and after so many restarts of appdaemon, the panel stops responding to connections until it’s restarted.

Try the latest release. @SuperMega provided a fix for the logging spam. Thanks!

I have noticed that restarting Home Assistant still messes with the AppDaemon side of things, but I’m not having as much trouble with the panel like I used to. It seems a simple restart of AppDaemon now is all that is needed.