- 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?