gpulido / homeassistant-airzone

Home Assistant Custom component to manage Airzone Climate installations
MIT License
27 stars 7 forks source link

TypeError: 'NoneType' object is not subscriptable #41

Open soccerarenadev opened 2 years ago

soccerarenadev commented 2 years ago

I'm getting this error and can't connect to Airzone. It was working fine before, but after updating and restarting HA it doesn't connect anymore. Any idea?

Error while setting up airzone platform for climate Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform await asyncio.shield(task) File "/config/custom_components/airzone/climate.py", line 69, in async_setup_entry devices = await async_get_devices(config, hass) File "/config/custom_components/airzone/climate.py", line 57, in async_get_devices devices = [Machine(machine)] + [Zone(z) for z in machine.zones] File "/config/custom_components/airzone/localapi.py", line 160, in __init__ self.airzone_machine = airzone_machine File "/config/custom_components/airzone/localapi.py", line 171, in airzone_machine if value.units == TempUnits.FAHRENHEIT: File "/usr/local/lib/python3.9/site-packages/airzone/localapi.py", line 159, in units return TempUnits(self.machine_state['units']) TypeError: 'NoneType' object is not subscriptable

gpulido commented 2 years ago

Hello, The error is raised because for some reason the communication with the localapi didn't return a proper state. Please review that you can connect with the localapi using curl for example.

soccerarenadev commented 2 years ago

It seems to work fine from the Home Assistant CLI: image

However, the integration still doesn't load.

soccerarenadev commented 2 years ago

It is now working... But I had to restart Home Assistant once again.

Is there a way to reload the integration without restarting the system?

esesen1 commented 2 years ago

Good night,

Same problem here. Airzone integration has stopped to work, today. I have the same report on the log file.

I don't know how to review if I can connect with the API using curl. I've tried from Terminal & SSH the same command as @soccerarenadev (with my own airzone URL) and I have an error...

Screenshot_1

Please, any help will be appreciated...

esesen1 commented 2 years ago

Could it have something to do with the summer hour change? I haven't made any changes to the system recently that might have anything to do with the climate and it has stopped working just the day we have changed the hour.

esesen1 commented 2 years ago

Ok... Searching on the old issues I have foud this one:

https://github.com/gpulido/homeassistant-airzone/issues/25

I'm not at home but this afternoon I will try restarting my AirZone. Hope this works!

esesen1 commented 2 years ago

Ok... Searching on the old issues I have foud this one:

https://github.com/gpulido/homeassistant-airzone/issues/25

I'm not at home but this afternoon I will try restarting my AirZone. Hope this works!

No luck. So I've reinstalled the component and magically it has started working again...

jpatriarca commented 2 years ago

Hi @gpulido. Would like to revive this topic and to refer that this issue has happened to me a couple of times in the past months. For every issue that I've detected, I needed to remove the configuration and set it up again and everything was back to working as expected. Last time I've detected the issue after a forced reboot I've done yesterday, and no matter I tried to do, removing and adding the integration was the only way to sort it out. Despite being a bug, fortunately it happens from time to time (weeks/months) but it is unpleasant trying to use back again the integration and have it unavailable. Anything can be done to avoid this? Thanks for your amazing work