Home Assistant "setup failed" -- AD2USB / RPi3

General Discussion

Home Assistant "setup failed" -- AD2USB / RPi3

Postby maser228 » Tue Jan 02, 2018 10:13 pm

I have Home Assistant installed in a virtual environment on an RPi3, and I just installed the AD2USB. When I start Home Assistant, it's failing to setup the AlarmDecoder component, but gives no indication of why in the logs.

Code: Select all
2018-01-03 00:47:41 ERROR (MainThread) [homeassistant.setup] Setup failed for alarmdecoder: Component failed to initialize.
2018-01-03 00:47:41 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=persistent_notification, service=create, service_call_id=1973460720-2, service_data=message=The following components and platforms could not be set up:

 - [alarmdecoder](https://home-assistant.io/components/alarmdecoder/)

Please check your config., notification_id=invalid_config, title=Invalid config>


Note that despite the message about checking my config, the config checker reports that my config file is valid -- the alarmdecoder section consists of only this:
Code: Select all
alarmdecoder:
  device:
    type: usb
  panel_display: on


The AD2USB works when I use the AlarmDecoder Keypad app installed on the Pi. I can see my system's status correctly. (DSC)
HA was throwing errors about missing pyftdi and pyusb -- I installed them.
HA was throwing errors about 'no langid' -- I fixed that by adding a .rules file to give my "users" group access to the USB devices.

I tried attaching a debugger and stepping through the setup. This snippet of code in the setup() function of alarmdecoder.py was confusing to me:

Code: Select all
    controller = False
    if device_type == 'socket':
        host = device.get(CONF_DEVICE_HOST)
        port = device.get(CONF_DEVICE_PORT)
        controller = AlarmDecoder(SocketDevice(interface=(host, port)))
    elif device_type == 'serial':
        path = device.get(CONF_DEVICE_PATH)
        baud = device.get(CONF_DEVICE_BAUD)
        controller = AlarmDecoder(SerialDevice(interface=path))
    elif device_type == 'usb':
        AlarmDecoder(USBDevice.find())
        return False


In the second to last line, when I step into the creation of the AlarmDecoder() object, it appears that the code is able to find and return an object -- but then setup() returns False regardless. Immediately after this is when HA throws the "failed to setup" message.

Any idea what's going on?
maser228
newt
newt
 
Posts: 2
Joined: Tue Jan 02, 2018 9:33 pm

Re: Home Assistant "setup failed" -- AD2USB / RPi3

Postby kevin » Wed Jan 03, 2018 5:47 am

Hi,

I would ask on the HomeAssistant community - since the device is working and it is a HomeAssistant issue, I think they will be better off to help you

I do notice that for the USBDevice implementation they are not using a SerialDevice, which I think we swapped to a while ago due to the pyftdi dependency or some other weird underlying usb issue.

For all intents and purposes, it should be treated just like a serial device now.
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am

Re: Home Assistant "setup failed" -- AD2USB / RPi3

Postby maser228 » Thu Jan 04, 2018 8:11 am

Ah, okay, my apologies -- I thought you guys wrote the HA component, not just the Python library. :oops:

In any event, switching it from USB to serial immediately fixed the problem. Thank you!
maser228
newt
newt
 
Posts: 2
Joined: Tue Jan 02, 2018 9:33 pm

Re: Home Assistant "setup failed" -- AD2USB / RPi3

Postby kevin » Thu Jan 04, 2018 7:48 pm

Glad it's working

If you're only going to use it for HomeAssistant then that will work fine - if you want to use it with HomeAssistant and still use the virtual keypad or webapp software - I'd recommend going the 'socket' route with ser2sock
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am


Return to General

Who is online

Users browsing this forum: No registered users and 49 guests

cron