Konnected not working after 0.106.0 update

You missed a step:

  1. Update firmware on Konnected devices to latest.

Or else you won’t see any Konnected integrations in step 2.

For me, the onboarding completely ignored my existing configuration and I had to fill in everything all over again.

AND the punch line is, now nothing works. All of my sensors are stuck in the off state.

Just a heads up on this.

I spent last weekend integrating a v2 add on board (replacing a fault v1 interface board) into my 0.106.5 HA and tripped over an issue with the Konnected v2.3.3 release relating to relays.

With 2.3.3 installed, every time I restarted the Konnected board or restarted HA, the relay triggered.
I’m using the relay as a momentary switch to arm / disarm the alarm, so this was a major issue.

It’s already an open issue on github.

Rolling Konnected back to 2.3.1 resolved it.

Rolling back to 2.3.1 did not fix my problem. It looks like the konnected units are rebooting every 5-6 minutes based on device_tracker losing contact. Tomorrow I’ll look at the logs on the konnected devices and see if I can figure out what’s triggering the reboot cycle. After that I may try rolling back to Hassio 0.105.5

Frustrating that after 13 months of being rock solid, everything has gone to hell with 0.106.

Sorry to hear that - my issue may well be relay-specific - I’ve never seen konnected units rebooting repetitively (my v1 interface just short circuited as far as I can tell).

After looking at the console out, the konnected devices are trying to connect to my home assistant server using port 80 and failing. After ten 400 errors, it reboots. So no wonder it’s not reporting any open/close events. I don’t see anywhere in the new integration to set the api_host key, which is how I had it set via the YAML file. Can I just leave that in YAML and have the new integrations work?

I tried to make a quick fix by enabling port 80 in the nginx addon, but that has wedged nginx and now I have not HTTP or HTTPS access. Trying to get creative via the ssh connection and using the hassio CLI tools.

So far I haven’t figure out how to reconfigure an addon via CLI. I need to disable port 80 in nginx.

This is the thing about Docker that drives me crazy. I know I just need to edit one file, but it’s on some docker image I cannot cd into.

Gack. Totally forgot that nginx is just forwarding to port 8123 so I am not locked out of HTTP/HTTPS. Just 4 levels deep in debugging this and losing my mind.

I’m afraid that’s outside my understanding and I can’t see any reference to api_host in my integration settings.

konnected:
  access_token: !secret konnected_access_token
  api_host: http://10.29.30.20:8123
  devices:
    - id: 807d3a3e221e
      host: 192.168.1.121
      port: 12071
      binary_sensors:
        - zone: 1
          type: door
          name: 'Front Door'
        - zone: 2
          type: door
          name: 'Garage Entry Door'

From my configuration.yaml file. api_host tells the konnected device what URL to use to phone home. I looked at the source code and if this isn’t set it falls back to use the Home Assistant value for base_url For me me was pointing at port 80, which has nginx bouncing to port 443 using HSTS (HTTP Strict Transport Security). This was causing all of the konnected devices to receive a HTTP 400 error code for every request.

So here is a chronology of what I tried and didn’t work.

Day 1. Just upgrade to 0.106 and expect things to work. This didn’t work because.
a) I did not get any automated onboarding or notice that konnected stopped working, I had to notice that some automations stopped working and eventually track the problem back to konnected.
b) why did it not work? First I was on an older firmware (2.2.5). Secondly, I was missing port: settings in my configuration.yaml. Thank you @kit-klein for explaining that. For some reason I didn’t think to look at that until much later. Maybe having a non-conforming configuration breaks onboarding. (that is just a guess)

Day 2: Upgraded to firmware 2.3.3 and tried again. I managed to get onboarding to run, however it did not import anything from my configuration.yaml. I manually added all my sensors. After this no konnected sensored worked. This was because all three konencted devices were in a reboot loop.
Cause was because there is no way to set api_host in the new onboarding. I didn’t realize that at the time, and latched on to reports of problems with firmware and installed firmware 2.3.1
Day 3: This was when I diagnosed the reboot loop. (why so long? Partially because I’m still in denial about how much of a shit show this is, but now it’s getting personal. Especially after nginx went sideways on me and then my sql database got corrupted in one of the many reboots.) By the end of Day 3, I have 2 out of 3 konnected boards reporting doors opening and closing again. Time to run the console on board 3 and see what’s up.

Follow up. My third konnected wasn’t connecting because I failed to reconfigure Wifi on my last firmware update.

With the configuration.yaml fixed, ie with host and port set for every konnected device AND with firmware 2.3.1 I was able to successfully use the onboarding flow and have it import all my sensors from configuration.yaml into the integration.

@randomstring I apologize for all the frustration and thank you for posting such a detailed write up. The api_host was definitely an oversight. A couple notes that might help others in the future.

  1. All of the UI based config only cover settings specific to each device. The configuration.yaml has two global Konnected settings (api_host and access_token) that were left out of the UI configuration. They are now always derived unless imported from a configuration.yaml entry.

  2. If you need to specify either of these globals you can do so in a minimal configuration.yaml (see below). The globals are loaded every time HA starts so you shouldn’t need to reconfigure your Konnected integrations if you were able set them up.

konnected:
  access_token: somesupersecretaccesstoken
  api_host: http://10.29.30.20:8123
2 Likes

Hi @kit-klein

Thanks for all your hard work and providing the following code example.

 konnected:
  access_token: somesupersecretaccesstoken
  api_host: http://10.29.30.20:8123

Would it be possible to include an example for those of us that have more than a single konnected board?

Thanks!

@Nickolaos since the access_token and api_host values are global this example will apply to one or multiple boards.

You should only need this content in configuration.yaml if you are experiencing issues related to forwarding or konnected postbacks reaching your HA instance. Otherwise it’s best to utilize the UI for everything.

@kit-klein thanks again for the rapid fire response!

Thanks to this thread I’ve got Konnected back up and running on the current release of HA.

Running on HassOS 3.12, HA 0.107.1 and just updated the Konnected firmware to current version. While all sensors (entities) are now showing available and working correctly, I’m unable to get the switch (siren) to work. It still shows “unavailable”. I’ve gone through the “import” process a few times now with no luck.

image image

Am I missing something simple? Thanks.

I just resolved this. Unknown to me, after the import was complete, a new switch.siren_2 was created. So I deleted the old one and corrected the automations.yaml and we’re good!

Same… I had to deleted my Konnected in the config and set up as an integration.