Need to reboot Home Assistant a few times before it detects Konnected devices

I've got two Konnected devices that are only sometimes detected by Home Assistant. I usually have to reboot Home Assistant 2 or 3 times before the devices are found, then they work perfectly for days until I have to reboot, when it may or may not need to be restarted 2 or 3 times again.

I'm running Home Assistant in a Docker container on my unRAID system. The same issue was present when running it in a Docker container on my old Ubuntu server.

I've tried leaving it over an hour to detect them, but it never does.

I'm suspecting the Home Assistant is to blame here, since the two different Konnected devices are both having the same issue at the same time. Home Assistant is 0.73.1, both Konnecteds are 2.2.1.

Here are the Home Assistant logs, first for a boot that did not detect them, then a successful one. They're less than a minute apart, but like I said, I've left it for quite a while and they are never detected.

 

2018-07-13 16:43:15 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=homeassistant, service=turn_off>
2018-07-13 16:43:15 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=homeassistant, service=turn_on>
2018-07-13 16:43:15 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=homeassistant, service=toggle>
2018-07-13 16:43:15 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=homeassistant, service=stop>
2018-07-13 16:43:15 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=homeassistant, service=restart>
2018-07-13 16:43:15 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=homeassistant, service=check_config>
2018-07-13 16:43:15 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=homeassistant, service=reload_core_config>
2018-07-13 16:43:15 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=persistent_notification, service=create>
2018-07-13 16:43:15 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=persistent_notification, service=dismiss>
2018-07-13 16:43:15 INFO (MainThread) [homeassistant.bootstrap] Home Assistant core initialized
2018-07-13 16:43:15 INFO (MainThread) [homeassistant.loader] Loaded history from homeassistant.components.history
2018-07-13 16:43:15 INFO (MainThread) [homeassistant.loader] Loaded recorder from homeassistant.components.recorder
2018-07-13 16:43:15 INFO (MainThread) [homeassistant.loader] Loaded http from homeassistant.components.http
2018-07-13 16:43:15 INFO (MainThread) [homeassistant.loader] Loaded frontend from homeassistant.components.frontend
2018-07-13 16:43:15 INFO (MainThread) [homeassistant.loader] Loaded api from homeassistant.components.api
2018-07-13 16:43:15 INFO (MainThread) [homeassistant.loader] Loaded websocket_api from homeassistant.components.websocket_api
2018-07-13 16:43:15 INFO (MainThread) [homeassistant.loader] Loaded system_log from homeassistant.components.system_log
2018-07-13 16:43:15 INFO (MainThread) [homeassistant.loader] Loaded logger from homeassistant.components.logger
2018-07-13 16:43:15 INFO (MainThread) [homeassistant.setup] Setting up logger
2018-07-13 16:43:15 WARNING (MainThread) [homeassistant.components.http] You have been advised to set http.api_password.

2018-07-13 16:43:37 DEBUG (SyncWorker_7) [homeassistant.components.konnected] Discovered a new Konnected device: {‘host’: ‘192.168.1.13’, ‘port’: 13463, ‘ssdp_description’: ‘http://192.168.1.13:13463/Device.xml’, ‘name’: ‘Konnected’, ‘model_name’: ‘Konnected’, ‘model_number’: ‘2.2.1’, ‘serial’: ‘5463192’, ‘manufacturer’: ‘konnected.io’, ‘udn’: ‘uuid:8f655392-a778-4fee-97b9-4825918535c98’, ‘upnp_device_type’: ‘urn:schemas-konnected-io:device:Security:1’}
2018-07-13 16:43:37 DEBUG (SyncWorker_8) [homeassistant.components.konnected] Discovered a new Konnected device: {‘host’: ‘192.168.1.6’, ‘port’: 9674, ‘ssdp_description’: ‘http://192.168.1.6:9674/Device.xml’, ‘name’: ‘Konnected’, ‘model_name’: ‘Konnected’, ‘model_number’: ‘2.2.0’, ‘serial’: ‘1674609’, ‘manufacturer’: ‘konnected.io’, ‘udn’: ‘uuid:8f655392-a778-4fee-97b9-4825918198d71’, ‘upnp_device_type’: ‘urn:schemas-konnected-io:device:Security:1’}
2018-07-13 16:43:38 INFO (SyncWorker_7) [homeassistant.components.konnected] Initialized Konnected device 84f3eb535c98
2018-07-13 16:43:38 INFO (SyncWorker_8) [homeassistant.components.konnected] Initialized Konnected device dc4f22198d71
2018-07-13 16:43:38 DEBUG (SyncWorker_7) [homeassistant.components.konnected] Configuring Konnected device 84f3eb535c98
2018-07-13 16:43:38 DEBUG (SyncWorker_8) [homeassistant.components.konnected] Configuring Konnected device dc4f22198d71
2018-07-13 16:43:38 DEBUG (SyncWorker_7) [homeassistant.components.konnected] Set up sensor North Garage Door (initial state: None)
2018-07-13 16:43:38 DEBUG (SyncWorker_8) [homeassistant.components.konnected] Set up sensor Front Door (initial state: None)
2018-07-13 16:43:38 DEBUG (SyncWorker_7) [homeassistant.components.konnected] Set up sensor Side Door Lock (initial state: True)
2018-07-13 16:43:38 DEBUG (SyncWorker_8) [homeassistant.components.konnected] Set up sensor Back Door (initial state: None)
2018-07-13 16:43:38 DEBUG (SyncWorker_7) [homeassistant.components.konnected] Set up sensor South Garage Door (initial state: None)
2018-07-13 16:43:38 DEBUG (SyncWorker_8) [homeassistant.components.konnected] Set up sensor Garage Entry Door (initial state: None)
2018-07-13 16:43:38 DEBUG (SyncWorker_7) [homeassistant.components.konnected] Set up actuator North Garage Door Relay (initial state: None)
2018-07-13 16:43:38 DEBUG (SyncWorker_8) [homeassistant.components.konnected] Set up sensor Computer Room Windows (initial state: None)
2018-07-13 16:43:38 DEBUG (SyncWorker_7) [homeassistant.components.konnected] Storing data in hass.data[konnected]: {‘client’: <konnected.Client object at 0x1511e9cac128>, ‘binary_sensors’: {1: {‘type’: ‘garage_door’, ‘name’: ‘North Garage Door’, ‘state’: None}, 2: {‘type’: ‘lock’, ‘name’: ‘Side Door Lock’, ‘state’: True}, 6: {‘type’: ‘garage_door’, ‘name’: ‘South Garage Door’, ‘state’: None}}, ‘switches’: {5: {‘name’: ‘North Garage Door Relay’, ‘state’: None, ‘activation’: ‘low’}}, ‘host’: ‘192.168.1.13’, ‘port’: 13463}
2018-07-13 16:43:38 DEBUG (SyncWorker_8) [homeassistant.components.konnected] Set up sensor Kitchen Window (initial state: None)
2018-07-13 16:43:38 DEBUG (SyncWorker_7) [homeassistant.components.konnected] 84f3eb535c98: desired sensor config: [{‘pin’: 1}, {‘pin’: 2}, {‘pin’: 6}]
2018-07-13 16:43:38 DEBUG (SyncWorker_8) [homeassistant.components.konnected] Set up sensor Nook Window (initial state: None)
2018-07-13 16:43:38 DEBUG (SyncWorker_7) [homeassistant.components.konnected] 84f3eb535c98: current sensor config: [{‘pin’: 1}, {‘pin’: 2}, {‘pin’: 6}]
2018-07-13 16:43:38 DEBUG (SyncWorker_8) [homeassistant.components.konnected] Storing data in hass.data[konnected]: {‘client’: <konnected.Client object at 0x1511e8168e48>, ‘binary_sensors’: {1: {‘type’: ‘door’, ‘name’: ‘Front Door’, ‘state’: None}, 2: {‘type’: ‘door’, ‘name’: ‘Back Door’, ‘state’: None}, 5: {‘type’: ‘door’, ‘name’: ‘Garage Entry Door’, ‘state’: None}, 6: {‘type’: ‘window’, ‘name’: ‘Computer Room Windows’, ‘state’: None}, 7: {‘type’: ‘window’, ‘name’: ‘Kitchen Window’, ‘state’: None}, 9: {‘type’: ‘window’, ‘name’: ‘Nook Window’, ‘state’: None}}, ‘switches’: {}, ‘host’: ‘192.168.1.6’, ‘port’: 9674}
2018-07-13 16:43:38 DEBUG (SyncWorker_7) [homeassistant.components.konnected] 84f3eb535c98: desired actuator config: [{‘pin’: 5, ‘trigger’: 0}]
2018-07-13 16:43:38 DEBUG (SyncWorker_8) [homeassistant.components.konnected] dc4f22198d71: desired sensor config: [{‘pin’: 1}, {‘pin’: 2}, {‘pin’: 5}, {‘pin’: 6}, {‘pin’: 7}, {‘pin’: 9}]
2018-07-13 16:43:38 DEBUG (SyncWorker_7) [homeassistant.components.konnected] 84f3eb535c98: current actuator config: [{‘trigger’: 0, ‘pin’: 5}]
2018-07-13 16:43:38 DEBUG (SyncWorker_8) [homeassistant.components.konnected] dc4f22198d71: current sensor config: [{‘pin’: 1}, {‘pin’: 2}, {‘pin’: 5}, {‘pin’: 6}, {‘pin’: 7}, {‘pin’: 9}]
2018-07-13 16:43:38 DEBUG (SyncWorker_7) [homeassistant.components.konnected] 84f3eb535c98: desired api endpoint: http://192.168.1.21:8123/api/konnected
2018-07-13 16:43:38 DEBUG (SyncWorker_8) [homeassistant.components.konnected] dc4f22198d71: desired actuator config: []
2018-07-13 16:43:38 DEBUG (SyncWorker_8) [homeassistant.components.konnected] dc4f22198d71: current actuator config: []
2018-07-13 16:43:38 DEBUG (SyncWorker_8) [homeassistant.components.konnected] dc4f22198d71: desired api endpoint: http://192.168.1.21:8123/api/konnected
2018-07-13 16:43:38 DEBUG (SyncWorker_7) [homeassistant.components.konnected] 84f3eb535c98: current api endpoint: http://192.168.1.21:8123/api/konnected
2018-07-13 16:43:38 DEBUG (SyncWorker_8) [homeassistant.components.konnected] dc4f22198d71: current api endpoint: None
2018-07-13 16:43:38 DEBUG (SyncWorker_8) [homeassistant.components.konnected] pushing settings to device dc4f22198d71
2018-07-13 16:43:48 WARNING (MainThread) [homeassistant.setup] Setup of wemo is taking over 10 seconds.

Any help appreciated.

Is the discovery component loading in the instances when Konnected doesn't show up? Because Hass doesn't have any persistent state between reboots, Konnected needs to be re-discovered on every reboot, so it relies on the discovery component loading. This should automatically happen but I don't see it in the log that you posted above.

I believe discovery should be loading every time. There's no issue with my Belkin WeMo switches being detected each time, though it might take a minute or two for them to show up.


I can easily reproduce this problem, is there a logging level I should set to get a better log for you?

I take it back. There's definitely something hanging up discovery. It seems it's just a matter of whether or not Konnected gets discovered before that or not.


Thanks for giving me a push in the right direction, and thanks for the great project!

I see the same using hassio.  I have another issue as well using an add-on board, that I am creating a post for.  

 I'm experiencing the same issue.  Sometimes my Konnected zones show up in Home Assistant, but usually, they don't.  I have 3 other devices visible to HA - an Apple TV, a Yamaha receiver, and a Google Home.   Only the Google Home shows up consistently.  I pulled its power plug and restarted HA, and saw my Apple TV, but my receiver is not showing up. I plugged the Google Home back in, and it shows up readily.

I solved my issue by looking at the logs for the discovery service, and found that my WeMo switches seemed to be causing some issues and hanging discovery. I factory reset all of them and added them to my network again. After that, Konnected always gets detected, though sometimes it takes 4 or 5 minutes.

I'm having this issue as well.  Often Konnected does not show up after HA restart and takes 2-10 restarts to get them to show up.   I was originally on a ubuntu server running HA in a python virtual environment.  Rather than spending a lot of time troubleshooting that I decided to move to a dedicated Raspberry Pi running Hassio. I figured that would be more standard.   I'm now running a fresh clean install of Hassio however I'm still having this same issue. Here is my system log after restart when the Konnected sensors did not show up:

 

18-08-01 22:25:54 INFO (MainThread) [__main__] Initialize Hassio setup
18-08-01 22:25:55 INFO (MainThread) [__main__] Setup HassIO
18-08-01 22:25:55 INFO (SyncWorker_0) [hassio.docker.supervisor] Attach to supervisor homeassistant/aarch64-hassio-supervisor with version 121
18-08-01 22:25:55 INFO (MainThread) [hassio.utils.gdbus] Introspect org.freedesktop.systemd1 on /org/freedesktop/systemd1
18-08-01 22:25:55 INFO (MainThread) [hassio.utils.gdbus] Connect to dbus: org.freedesktop.systemd1 - /org/freedesktop/systemd1
18-08-01 22:25:55 INFO (MainThread) [hassio.utils.gdbus] Introspect org.freedesktop.hostname1 on /org/freedesktop/hostname1
18-08-01 22:25:55 INFO (MainThread) [hassio.utils.gdbus] Connect to dbus: org.freedesktop.hostname1 - /org/freedesktop/hostname1
18-08-01 22:25:55 INFO (MainThread) [hassio.utils.gdbus] Introspect de.pengutronix.rauc on /
18-08-01 22:25:55 INFO (MainThread) [hassio.utils.gdbus] Connect to dbus: de.pengutronix.rauc - /
18-08-01 22:25:55 INFO (MainThread) [hassio.host.info] Update local host information
18-08-01 22:25:55 INFO (MainThread) [hassio.utils.gdbus] Call org.freedesktop.DBus.Properties.GetAll on /org/freedesktop/hostname1
18-08-01 22:25:55 INFO (MainThread) [hassio.host.services] Update service information
18-08-01 22:25:55 INFO (MainThread) [hassio.utils.gdbus] Call org.freedesktop.systemd1.Manager.ListUnits on /org/freedesktop/systemd1
18-08-01 22:25:56 INFO (MainThread) [hassio.host.apparmor] Load AppArmor Profiles: {'hassio-supervisor'}
18-08-01 22:25:56 INFO (MainThread) [hassio.host.services] Reload local service hassos-apparmor.service
18-08-01 22:25:56 INFO (MainThread) [hassio.utils.gdbus] Call org.freedesktop.systemd1.Manager.ReloadOrRestartUnit on /org/freedesktop/systemd1
18-08-01 22:25:56 INFO (MainThread) [hassio.hassos] Detect HassOS 1.7 on host system
18-08-01 22:25:56 INFO (SyncWorker_1) [hassio.docker.hassos_cli] Found HassOS cli homeassistant/aarch64-hassio-cli with version 6
18-08-01 22:26:53 INFO (SyncWorker_2) [hassio.docker.interface] Attach to image homeassistant/raspberrypi3-64-homeassistant with version 0.74.2
18-08-01 22:26:53 INFO (MainThread) [hassio.addons.git] Load addon /data/addons/core repository
18-08-01 22:26:53 INFO (MainThread) [hassio.addons.git] Load addon /data/addons/git/a0d7b954 repository
18-08-01 22:26:53 INFO (MainThread) [hassio.addons] Load addons: 43 all - 43 new - 0 remove
18-08-01 22:26:54 INFO (SyncWorker_2) [hassio.docker.interface] Attach to image homeassistant/aarch64-addon-duckdns with version 1.5
18-08-01 22:26:54 INFO (SyncWorker_3) [hassio.docker.interface] Attach to image homeassistant/aarch64-addon-configurator with version 0.4
18-08-01 22:26:54 INFO (SyncWorker_0) [hassio.docker.interface] Attach to image homeassistant/aarch64-addon-samba with version 4.1
18-08-01 22:26:54 INFO (MainThread) [hassio.updater] Fetch update data from https://s3.amazonaws.com/hassio-version/stable.json
18-08-01 22:26:54 INFO (MainThread) [hassio.snapshots] Found 0 snapshot files
18-08-01 22:26:54 INFO (MainThread) [__main__] Run HassIO
18-08-01 22:26:54 INFO (MainThread) [hassio.misc.dns] Start DNS port forwarding for host add-ons
18-08-01 22:26:54 INFO (MainThread) [hassio.core] Ignore Hass.io auto updates on dev channel
18-08-01 22:26:54 INFO (MainThread) [hassio.api] Start API on 172.30.32.2
18-08-01 22:26:54 INFO (MainThread) [hassio.addons] Startup initialize run 0 addons
18-08-01 22:26:54 INFO (MainThread) [hassio.addons] Startup system run 0 addons
18-08-01 22:26:54 INFO (MainThread) [hassio.addons] Startup services run 2 addons
18-08-01 22:26:54 INFO (SyncWorker_5) [hassio.docker.interface] Clean homeassistant/aarch64-addon-samba docker application
18-08-01 22:26:54 INFO (SyncWorker_4) [hassio.docker.interface] Clean homeassistant/aarch64-addon-duckdns docker application
18-08-01 22:26:56 INFO (SyncWorker_5) [hassio.docker.addon] Start docker addon homeassistant/aarch64-addon-samba with version 4.1
18-08-01 22:26:57 INFO (SyncWorker_4) [hassio.docker.addon] Start docker addon homeassistant/aarch64-addon-duckdns with version 1.5
18-08-01 22:27:02 INFO (SyncWorker_8) [hassio.docker.interface] Clean homeassistant/raspberrypi3-64-homeassistant docker application
18-08-01 22:27:04 INFO (SyncWorker_8) [hassio.docker.homeassistant] Start homeassistant homeassistant/raspberrypi3-64-homeassistant with version 0.74.2
18-08-01 22:28:15 INFO (MainThread) [hassio.homeassistant] Detect a running HomeAssistant instance
18-08-01 22:28:15 INFO (MainThread) [hassio.addons] Startup application run 1 addons
18-08-01 22:28:19 INFO (SyncWorker_18) [hassio.docker.addon] Start docker addon homeassistant/aarch64-addon-configurator with version 0.4
18-08-01 22:28:24 INFO (MainThread) [hassio.tasks] All core tasks are scheduled
18-08-01 22:28:24 INFO (MainThread) [hassio.core] Hass.io is up and running

 

Tom, the system log isn't going to tell you anything useful in this case. You want to be looking at the home-assistant.log in /config.

Use the SSH add-on to access your Hass.io instance via command line and tail the home-assistant.log during boot.

 

2018-08-03 00:22:28 WARNING (MainThread) [homeassistant.setup] Setup of config is taking over 10 seconds.
2018-08-03 00:22:42 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 230, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp/_http_parser.pyx", line 297, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
2018-08-03 00:22:45 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-08-03 00:22:45 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 378, in start
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_app.py", line 341, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_middlewares.py", line 88, in impl
    return await handler(request)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/static.py", line 67, in staticresource_middleware
    return await handler(request)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/real_ip.py", line 34, in real_ip_middleware
    return await handler(request)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/ban.py", line 68, in ban_middleware
    return await handler(request)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/auth.py", line 62, in auth_middleware
    return await handler(request)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/view.py", line 105, in handle
    result = await result
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/konnected.py", line 319, in put
    device = data[CONF_DEVICES].get(device_id)
KeyError: 'devices'
2018-08-03 00:22:46 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 378, in start
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_app.py", line 341, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_middlewares.py", line 88, in impl
    return await handler(request)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/static.py", line 67, in staticresource_middleware
    return await handler(request)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/real_ip.py", line 34, in real_ip_middleware
    return await handler(request)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/ban.py", line 68, in ban_middleware
    return await handler(request)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/auth.py", line 62, in auth_middleware
    return await handler(request)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/view.py", line 105, in handle
    result = await result
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/konnected.py", line 319, in put
    device = data[CONF_DEVICES].get(device_id)

 

Here is the home-assistant.log

 

2018-08-03 00:22:28 WARNING (MainThread) [homeassistant.setup] Setup of config is taking over 10 seconds.
2018-08-03 00:22:42 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 230, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp/_http_parser.pyx", line 297, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
2018-08-03 00:22:45 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-08-03 00:22:45 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 378, in start
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_app.py", line 341, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_middlewares.py", line 88, in impl
    return await handler(request)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/static.py", line 67, in staticresource_middleware
    return await handler(request)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/real_ip.py", line 34, in real_ip_middleware
    return await handler(request)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/ban.py", line 68, in ban_middleware
    return await handler(request)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/auth.py", line 62, in auth_middleware
    return await handler(request)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/view.py", line 105, in handle
    result = await result
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/konnected.py", line 319, in put
    device = data[CONF_DEVICES].get(device_id)
KeyError: 'devices'
2018-08-03 00:22:46 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 378, in start
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_app.py", line 341, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_middlewares.py", line 88, in impl
    return await handler(request)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/static.py", line 67, in staticresource_middleware
    return await handler(request)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/real_ip.py", line 34, in real_ip_middleware
    return await handler(request)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/ban.py", line 68, in ban_middleware
    return await handler(request)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/auth.py", line 62, in auth_middleware
    return await handler(request)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/view.py", line 105, in handle
    result = await result
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/konnected.py", line 319, in put
    device = data[CONF_DEVICES].get(device_id)

 

Hi Tom,


Not sure why, but what I have noticed is that is I reboot with "hassio ho reboot" sometimes things don't get discovered when the system comes up.  If I reboot via the hassio panel it is consistent.  At times the discovery can take 20 to 30 seconds after the other devices are added and visible in the default panel.  


I just got everything finally wired yesterday, as there were many odd things with the wiring from when the alarm was terminated by the company that originally installed everything in this pre-wired house.   What version of hassio are your running?  I am on 0.73.1 currently and seems to be detecting everything well.  

I always use the hassio panel for reboots as well.  I have the latest hassio (HA 0.74.2) that I clean flashed yesterday to eliminate an other variables.  Only thing I've done is add samba to grab the logs.  I also getting this log error 11 times a minute.  If I unplug the Konnected boards then the error goes away

2018-08-03 05:44:00 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 230, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp/_http_parser.pyx", line 297, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
2018-08-03 05:44:05 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 230, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp/_http_parser.pyx", line 297, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
2018-08-03 05:44:10 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 230, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp/_http_parser.pyx", line 297, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
2018-08-03 05:44:15 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 230, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp/_http_parser.pyx", line 297, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
2018-08-03 05:44:20 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 230, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp/_http_parser.pyx", line 297, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
2018-08-03 05:44:25 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 230, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp/_http_parser.pyx", line 297, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
2018-08-03 05:44:30 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 230, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp/_http_parser.pyx", line 297, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
2018-08-03 05:44:35 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 230, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp/_http_parser.pyx", line 297, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
2018-08-03 05:44:40 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 230, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp/_http_parser.pyx", line 297, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
2018-08-03 05:44:45 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 230, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp/_http_parser.pyx", line 297, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
2018-08-03 05:44:51 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 230, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp/_http_parser.pyx", line 297, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
2018-08-03 05:44:56 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 230, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp/_http_parser.pyx", line 297, in aiohttp._http_parser.HttpParser.feed_data

 

I also followed this guide and flashed release v2.2.3 to my devices to ensure I was on the latest firmware.


 I get the same messages, so I don't think that has anything to do with the discovery issues:

 

aiohttp.http_exceptions.BadStatusLine: invalid HTTP method                                                                                                                     
2018-08-03 17:59:59 ERROR (MainThread) [aiohttp.server] Error handling request                                                                                                 
Traceback (most recent call last):                                                                                                                                             
  File "/usr/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 230, in data_received                                                                                  
    messages, upgraded, tail = self._request_parser.feed_data(data)                                                                                                            
  File "aiohttp/_http_parser.pyx", line 297, in aiohttp._http_parser.HttpParser.feed_data                                                                                      
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method                                                                                                                     
2018-08-03 17:59:59 ERROR (MainThread) [aiohttp.server] Error handling request                                                                                                 
Traceback (most recent call last):                                                                                                                                             
  File "/usr/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 230, in data_received                                                                                  
    messages, upgraded, tail = self._request_parser.feed_data(data)                                                                                                            
  File "aiohttp/_http_parser.pyx", line 297, in aiohttp._http_parser.HttpParser.feed_data                                                                                      
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method                                  

 

Try adding "logger:" and when the system is rebooted look for "konnected" entries.

Recovery after a reboot is much improved in Home Assistant 0.77. Please try the beta and let me know if you continue to have any problems like this. 

https://konnected.io/blogs/news/home-assistant-0-77-update

I just upgraded to 0.77.0b4.  After reboot I'm getting 


image


When I run check config I get this:


Invalid config for [konnected]: value 18FBFA does not match regular expression [0-9a-f]{12} for dictionary value @ data['konnected']['devices'][0]['id']. Got '18FBFA'. (See /config/configuration.yaml, line 100). Please check the docs at https://home-assistant.io/components/konnected/


Here is my yaml.  FYI Nothing has changed from working state before upgrading

 

konnected:
  access_token: xxxxxxxxxxxx
  api_host: http://192.xxx.x.xx:xxxx
  devices:
    - id: 18FBFA
      binary_sensors:
        - zone: 1
          type: door
          name: 'Front Door'
        - zone: 2
          type: door
          name: 'Back Slider'
        - zone: 3
          type: door
          name: 'Balcony Door'
        - zone: 4
          type: door
          name: 'Garage Door'
        - zone: 5
          type: motion
          name: 'Downstairs Motion'
        - zone: 6
          type: motion
          name: 'Kitchen GBD'
      switches:
        - zone: out
          name: siren
    - id: FDFD05
      binary_sensors:
        - zone: 1
          type: motion
          name: 'Up Motion'
        - zone: 2
          type: window
          name: 'Juliet Window'
        - zone: 3
          type: window
          name: 'Up Hall Window'
        - zone: 4
          type: window
          name: 'Robert Windows'

 

Please read our release notes here: https://konnected.io/blogs/news/home-assistant-0-77-update

You need to update the device IDs to the full 12-character MAC address in all lowercase letters and numbers starting in 0.77.

That was it.  Konnected it now getting discovered on reboot and no log errors.  Thanks