bwssytems / ha-bridge

Home automation bridge that emulates a Philips Hue light system and can control other systems such as a Vera, Harmony Hub, Nest, MiLight bulbs or any other system that has an http/https/tcp/udp interface. This is a compact impl to run on small format computers. This is impl started from this project https://github.com/armzilla/amazon-echo-ha-bridge.
Apache License 2.0
1.45k stars 198 forks source link

Home Assistant gets null exception during initialization #1150

Closed tjedmunds closed 3 years ago

tjedmunds commented 4 years ago

I am using the most recent version of hassio (Home Assistant). After entering IP, port and a long lived access token (not a legacy password) for authentication ha-bridge fails to initialize the hass information. Further digging in the logs finds the following:

Nov 05 19:30:17 smarthouse.lan java[31933]: 2019-11-05 19:30:17,156 [main] ERROR com.bwssystems.HABridge.plugins.hass.HassHome - Cannot get hass (smarthouse) setup, Exiting with message: null Nov 05 19:30:17 smarthouse.lan java[31933]: java.lang.NullPointerException: null Nov 05 19:30:17 smarthouse.lan java[31933]: at com.bwssystems.HABridge.plugins.hass.HomeAssistant.isLegacyAuth(HomeAssistant.java:111) Nov 05 19:30:17 smarthouse.lan java[31933]: at com.bwssystems.HABridge.plugins.hass.HomeAssistant.(HomeAssistant.java:31) Nov 05 19:30:17 smarthouse.lan java[31933]: at com.bwssystems.HABridge.plugins.hass.HassHome.createHome(HassHome.java:53) Nov 05 19:30:17 smarthouse.lan java[31933]: at com.bwssystems.HABridge.plugins.hass.HassHome.(HassHome.java:34) Nov 05 19:30:17 smarthouse.lan java[31933]: at com.bwssystems.HABridge.HomeManager.buildHomes(HomeManager.java:82) Nov 05 19:30:17 smarthouse.lan java[31933]: at com.bwssystems.HABridge.HABridge.main(HABridge.java:92)

bwssytems commented 4 years ago

Will need to take a look at that

tjedmunds commented 4 years ago

A workaround for this issue is to click the Legacy Password checkbox even though it isn't a legacy connection. Click Save. You will get a 500 error. Uncheck the checkbox and click Save again. Then it connects. Go figure.

ceefin commented 4 years ago

Can verify, had to go through this process myself after a recent upgrade to 0.102. Was previously using 0.96.x and the upgrade forced me to ditch the legacy password.

sidenote: thank you BWS!!!!

JesusArmy commented 4 years ago

A workaround for this issue is to click the Legacy Password checkbox even though it isn't a legacy connection. Click Save. You will get a 500 error. Uncheck the checkbox and click Save again. Then it connects. Go figure.

I confirm that this workaround did also the trick for me. Thanks tjedmunds and thanks a lot bwssystems for this wonderful lightweight piece of software!

aristosv commented 4 years ago

I can confirm that this issue still exists, and the workaround also works.

I am using Debian buster and I followed this installation method

https://github.com/bwssytems/ha-bridge#manual-installation-of-ha-bridge-and-setup-of-systemd-service

sanderlv commented 3 years ago

I have a major down again... It worked and then I had no devices in habridge anymore. So I restarted, redid, retried... nothing... even not the trick from above. Sorry: SUCKS.

I think a recent upgrade to 0.118 did break my habridge - homeassistant relation

bwssytems commented 3 years ago

This is an issue with the initialization of the legacy auth setting. This will be in 5.4.0