mjmccans / hassio-addon-airthings

Home Assistant Add-on for Airthings devices that uses mqtt to integrate with Home Assistant via mqtt discovery.
MIT License
20 stars 3 forks source link

Stopped working #4

Closed dysphasi closed 2 years ago

dysphasi commented 2 years ago

Unfortunately stopped working all of a sudden. I’m using Home Assistant core-2022.3.4

All my sensor values are returning ‘unknown’

Checking the log file I note that it seems to pull humidity, but then comes up with the below error and subsequently shuts down:

Traceback (most recent call last): File "/src/./airthings-mqtt.ha.py", line 299, in <module> val = round(val) TypeError: type NoneType doesn't define __round__ method

mjmccans commented 2 years ago

Interesting. The addon works for me on core 2022.3.4 and 2022.3.5, so that may not be what is causing the issue. It appears that the sensors are returning a None value that I had not expected. I can include a check for None values (and perhaps I should have done so already), but it would be helpful if you could provide more details so we can figure out the cause because if I simply skip None values some of your sensors may not work. Can you please updated your addon configuration to set the log_level to "DEBUG", restart the addon, and then send me the output that you see in the addon log? Thank you.

dysphasi commented 2 years ago

So strange, fired up home assistant, there was a new update, 2022.3.5, updated, started the addon in debug log moded and boom, it worked. Glad it's fixed, sorry I couldn't help more to work out what the bug might have been!

mjmccans commented 2 years ago

No problem at all, and I should still probably watch for None value inputs. Either way, I am glad that it is working again for you.