Core: AlarmDecoder Broken in 0.104.0 and 0.104.1

Created on 17 Jan 2020  ·  19Comments  ·  Source: home-assistant/core

Home Assistant release with the issue:

0.104.1

Last working Home Assistant release (if known):

0.103.6
Operating environment (Hass.io/Docker/Windows/etc.):

Hass.io running in Proxmox VM
Integration:
https://www.home-assistant.io/integrations/alarmdecoder/

Description of problem:
AlarmDecoder started returning “Unknown” state after upgrade from 0.103.6 to 0.104.0. This issue corresponded with repeated log entries as below:

AlarmDecoder unexpectedly lost connection.

The issue was not resolved by upgrading to 0.104.1.
Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

alarmdecoder:
  device:
    type: serial
    path: '/dev/ttyUSB0'


Traceback (if applicable):


Additional information:

alarmdecoder

All 19 comments

@lexam79 could you please take a look at this issue? :) Your PR #30002 was the only one for this component in 104.

@AcidGambit , does the issue go away if you add "autobypass: True" or "autobypass: False" in your Alarmdecoder configuration? It's a new configuration option that I added in this release and maybe I haven't implemented something properly

No, unfortunately. I tried both values for the autobypass configuration variable.

@AcidGambit, does this happen all the time after you updated to 0.104 or randomly?

@springstan, is it possible that this is related to the update of alarmdecoder dependency that also happened in this release (#30303)

Both could be the root cause of this error.
@AcidGambit or @lexam79 could you test it with version 1.13.2 of alarmdecoder?

This issue occurs all of the time. I've never seen this error message before and the integration has not returned a valid state since the upgrade.

I'd be happy to test, but I don't know how to change the alarmdecoder dependency.

You can test it by creating a custom_component for alarmdecoder which will override the built-in component.
Please see this guide: Loading components
Then change the following line https://github.com/home-assistant/home-assistant/blob/4b67508330ac970608df43302f103a9d1eedb37a/homeassistant/components/alarmdecoder/manifest.json#L5 to

"requirements": ["alarmdecoder==1.13.2"], 

and restart your HA instance.

@AcidGambit what errors do you have in your logs? Please add anything to the issue template that seems to be important.

I get many repeats (maybe once per minute) of the error I listed in the template:

AlarmDecoder unexpectedly lost connection.
7:12 PM components/alarmdecoder/__init__.py (WARNING) - message first occurred at 7:11 PM and shows up 25 times

Debug level logging does not provide any additional information. Updating to 0.104.2 did not resolve the issue. I'll try loading the custom component.

It appears to be functioning correctly with alarmdecoder dependency 1.13.2.

I just want to note that I created the custom component by pulling the code from the 0.104.2 release of HA on Github and copying the alarmdecoder folder over from homeassistant/components to /config/custom_components on my machine.

I'm not sure what version it happened at, but alarmdecoder is not working on my machine either after a recent upgrade. Let me know if there is anything you want me to test.

Reverted to 1.13.2 and it fixed my problem.

Prior to .104, my alarmdecoder was working perfectly. After .104 (when the alarmdecoder component started using 1.13.9), I was experiencing the same symptoms as described by others here.

For anyone out there who is a total n00b like me... note that you have to copy over all of the files from the HA Git into your custom component folder, not just manifest.json. I took the following steps to resolve, and hope this helps somebody out there. It's entirely possible that I did something wrong and am over complicating this, so I'm totally open to feedback :).

  1. Using whatever method you prefer (Configurator, Cloud9 IDE, etc.), create a new folder within your Home Assistant config directory called "custom_components" then, within that folder, a new folder named "alarmdecoder".

  2. Copy each of the files from the following into your new folder.
    [https://github.com/home-assistant/home-assistant/tree/dev/homeassistant/components/alarmdecoder]

  3. Like @springstan instructed, open manifest.json and edit the existing line:

"requirements": ["alarmdecoder==1.13.9"],

to

"requirements": ["alarmdecoder==1.13.2"],

Make sure that you saved this change.

  1. Restart Home Assistant. You should now be reverted back to alarmdecoder 1.13.2 and everything is like it was before. NOTE: if you continue to have an issue, you may need to check to ensure that your device path is accurate. I believe this only applies for those using the "serial" method (e.g. plugging your AD2USB directly into your HA box). Instead of using the "dynamic" path (something similar to "/dev/ttyUSB2" for example), try putting the static/persistent path of the device. Prior to doing this, I experienced occasional issues on reboot or plugging in other USB devices resulting in my path changing, so this was the most resilient mitigation that I discovered.

From my current configuration.yaml:

alarmdecoder:
device:
type: serial
path: /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A101A44B-if00-port0
#path: /dev/ttyUSB2
baudrate: 115200
panel_display: true

I'm assuming that, when this issue is resolved at a parent level (i.e. alarmdecoder and/or HA release is updated and fixes the issue), we should just delete the entire alarmdecoder folder to revert back to default configuration for this component.

@garbled1 could you please take a look at this issue? :)

I'm looking into this issue currently due to a CI error on my PR #32965.

Haven't made too much progress, but I did notice the original AlarmDecoder integration PR #6900 left out USB support (read the comments in his PR body). I guess people have used the serial interface option as a workaround. I'm wondering if we can just add the USB support and drop serial support altogether :grin:. That would let us drop the pyserial dependency which is what I believe broke during this update.

https://github.com/nutechsoftware/alarmdecoder/commit/2311c45f8b9b470e1fd107ac154506a929deb5b5

I'm using a socket connection currently for my AlarmDecoder config, but I might see if I can find time this weekend to switch to a serial connection and continue debugging.

I've successfully replicated this issue. i'm currently investigating a fix

image

Looks like it's a problem with the AlarmDecoder library. I opened an issue with the stacktrace here https://github.com/nutechsoftware/alarmdecoder/issues/47.

It looks like the issue I opened could be related to https://github.com/nutechsoftware/alarmdecoder/issues/40 which currently has an open PR pending (https://github.com/nutechsoftware/alarmdecoder/pull/41).

That PR has been opened since September though, so I'm not sure how quickly it might be merged.

As an alternative solution, I'm going to see if I can get the _USB_ configuration working for H.A. later in the week.

I'm eager to get us bumped up to AlarmDecoder 1.13.9 so that we can get rid of the pinned dependencies from 1.13.2.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bdraco picture bdraco  ·  3Comments

sh0rez picture sh0rez  ·  3Comments

moskovskiy82 picture moskovskiy82  ·  3Comments

kirichkov picture kirichkov  ·  3Comments

Elmardus picture Elmardus  ·  3Comments