TLS Errors when Konnected firmware calls Home Assistant

Hey Nate, I have set up a test server and sent you a pm on the home assistant forums with the server info.

Good news, folks. I think I've got this working. Please help me test by re-flashing your device firmware and filesystem from the 2.2.1 release candidate binaries on this branch: https://github.com/konnected-io/konnected-security/tree/homeassistant-fixes/firmware

It turned out just needing some tweaks to the SSL_BUFFER_SIZE. Details in this pull request if you're interested:
https://github.com/konnected-io/konnected-security/pull/63

I've flashed my two devices... and got some minor improvements, buts its patchy and not really useful. For example, sometimes it correctly detects, but doesn't then register when the state changes back again. Other times it does. Sometimes it starts up with the correct state, sometimes it doesn't.

I can see all the zones on HA.... but they just aren't accurate.

My setup:

hass.io on a RaspPiB3, using duckdns and letsencrypt.

Thanks everyone for your feedback on this and continued help debugging. 

I've update the firmware again, this one is labeled 2.2.1.beta1 and has a few more improvements that may help with this issue:

https://github.com/konnected-io/konnected-security/tree/beta/firmware

Also, Hass 0.72 beta should now be available. Please update, and add the api_host option to point to the local network IP and port of Hass on your Raspberry Pi (include https). Example:

konnected:
 access_token: REPLACE_ME_WITH_A_RANDOM_STRING
 api_host: https://192.168.86.201:8123
 devices:
   - id: 8bcd53
     binary_sensors:
     - zone: 1
       type: door

Please let me know how this works out for you. I don't think it's perfect yet, but should be an improvement. I'm still working on a few other things for a 2.2.2 release.

 

Just checking back in to see if anyone has tried this and has any feedback. I'm about to release the 2.2.1 firmware/software update today.

I also just published a new article regarding Hass.io and SSL/TLS setups: https://help.konnected.io/support/solutions/articles/32000023964-using-konnected-with-hass-io-and-ssl-tls

I flashed my NodeMCU board with the 2.2.1 firmware and filesystem. Do we still need to put the api_host under the Konnected? If so I'm running into an issue validating my configuration file


  "Invalid config for [konnected]: [api_host] is an invalid option for [konnected]. Check: konnected->konnected->api_host. (See /config/configuration.yaml, line 98). Please check the docs at https://home-assistant.io/components/konnected/"


Also off topic but will i hurt my Konnected board if I flash the Nodemcu while still connected to the Konnected board?

I get this error when I tried to add the api_host


Invalid config for [konnected]: [api_host] is an invalid option for [konnected]. Check: konnected->konnected->api_host. (See /config/configuration.yaml, line 98). Please check the docs at https://home-assistant.io/components/konnected/

I switched mine to using a reverse proxy soon after starting this thread and spending that evening debugging  - it seems like the best approach for the ESP8266 hardware. It has been working awesomely since - and I don't fancy switching back.

On your article -  typo "publicly facking" :)

I saw "publicly facking" as well and thought it was a new term I had to google later. 

@MDinh The api_host option will be available in Hass 0.72. You can get it from the dev channel now, but I think it's scheduled to release tomorrow. Also it should be ok to flash the board while connected, but honestly I don't know if I tried it.

@Malcom what are you using for your reverse proxy? one of the add-ons mentioned or something else? any tips I should add to the article?

Thanks for pointing out the typo.

@Nate, I'm using a standard nginx reverse-proxy implemented outside of the hass.io environment (on my firewall), but the HA folks provide some configuration guidelines here https://www.home-assistant.io/docs/ecosystem/nginx/  you might also direct people deploying in a non hass.io environment there.

Oh yeah, I am running Hass 0.71. It took a a while to get Hass.io set up on my Pi 3B+ so not quite sure I'm ready to upgrade the Hass.  I gave the nginx addon a trying to get the reverse proxy to work but it still didn't fix it. I reflashed the original  2.2.0 and I'm going back through to disable all my SSL stuff in hopes to see the Konnected board real time update on my overview page. =/

@MDinh After you've set up the reverse proxy with Nginx, you'll need to re-sync Konnected to get it to recognize the updated base_url. In 0.72 this will be automatic. In Hass 0.71 and earlier the easiest thing to do is wipe it by re-flashing it and then it will re-sync the first time Hass discovers the device again.

 That makes a lot of sense Nate. I will give that a try. I am going to do a clean start and try to get this all going again tomorrow. I'll be back with an update if I can get it running. 

I'll try and reflash my devices tomorrow after the 0.72 update. @Nate those of using hass.io aren't able to update to beta versions, so we have to wait for official releases.

I don't have a Hass.io instance running right now, but I think you can enable "dev" channel releases to get the beta. There wouldn't be much value in releasing a beta if nobody using Hass.io could test it.

This is mentioned here: https://www.home-assistant.io/blog/2018/03/24/new-release-schedule/

Hass.io users will be able to enable the dev channel in the system settings.

To enable the beta you go to the hass.io menu then into system and click join beta channel.

Thanks. Didn't know that. Apologies for the inaccuracy!

I got the 0.72.0b5 update now. wow that was easy!

@nate, i flashed both devices with 2.2.1beta that you linked to (which I think is now your stable release?). I noticed that it was only the `filesystems` file that was updated, the `firmware` file hasn't changed for 9 days? I also upggraded hass.io to 0.72 and added the `api_host` to the configuration.yaml file.


I am getting pretty reliable and quick detection, but then variable clearing. Once the sensor in one room changed to "clear" as soon as the detector on my wall indicated clear, but mostly it stays "detected" for a variably long period of time... clearing eventually it seems over a matter of 10-20 minutes.


Has this been anyone else's experience?