You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using my alarmdecoder (AD) with a ser2sock front end in a home assistant installation (HA). When I just have a basic HA with AD and no other components, everything works fine. However, when I add a lot of other integrations into HA, then AD starts missing events - I have multiple wireless zones that report open and never close (or closed and never opened). Unfortunately there is no logging in the library so I can't easily debug where these message are being lost. But - because everything works fine with just HA+AD and it's only if I add more components to HA does it start to fail, I believe I know what the problem is.
HA works using async IO everywhere. The AD network code is very inefficient - it calls select() and reads one character a time when the select triggers. I'm not sure why that's the case but I'm pretty certain that's what's causing the issue as I believe the AD code isn't being run often enough to read all the messages.
A fairly simple change to recv() to read as much data as there and then split that into lines for processing should help. Switching to the the more efficient poll system or better yet, the selectors library would also help.
To help fix my HA problems, I wrote a small alarmdecoder->MQTT bridge app that runs outside HA so it doesn't have any problems with the HA event loop. You can find a the read/parse code I used there as an example if that helps.
The text was updated successfully, but these errors were encountered:
@TD22057 I am having a problem where HA can read alarmdecoder armed and zone statuses and it can send a single key alarm, but it has completely stopped letting me disarm/arm if i have to key in my whole code in home assistant. I suspect it has a similar cause as above. Thoughts?
No idea - w/o logging output in either the alarmdecoder HA component or in the alarmdecoder library itself there isn't any way to tell. IMO you should open a bug report in the home assistant github repo for that.
Not sure if it will help but you could enable verbose logging on ser2sock and maybe it will show what is happening in more detail. You can increase to the point where it will dump all TX/RX data raw into syslog.
I'm using my alarmdecoder (AD) with a ser2sock front end in a home assistant installation (HA). When I just have a basic HA with AD and no other components, everything works fine. However, when I add a lot of other integrations into HA, then AD starts missing events - I have multiple wireless zones that report open and never close (or closed and never opened). Unfortunately there is no logging in the library so I can't easily debug where these message are being lost. But - because everything works fine with just HA+AD and it's only if I add more components to HA does it start to fail, I believe I know what the problem is.
HA works using async IO everywhere. The AD network code is very inefficient - it calls select() and reads one character a time when the select triggers. I'm not sure why that's the case but I'm pretty certain that's what's causing the issue as I believe the AD code isn't being run often enough to read all the messages.
A fairly simple change to recv() to read as much data as there and then split that into lines for processing should help. Switching to the the more efficient poll system or better yet, the selectors library would also help.
To help fix my HA problems, I wrote a small alarmdecoder->MQTT bridge app that runs outside HA so it doesn't have any problems with the HA event loop. You can find a the read/parse code I used there as an example if that helps.
The text was updated successfully, but these errors were encountered: