core: Netatmo thermostat not working
Home Assistant release with the issue:
0.93.1+
Last working Home Assistant release (if known): 0.92.4 - althou it was a bit buggy and not loading with every restart.
Operating environment (Hass.io/Docker/Windows/etc.):
Hass.IO
Component/platform:
Netatmo Climate
Description of problem: When starting Hass.IO the Netatmo Climate is not loaded.
Problem-relevant configuration.yaml
entries and (fill out even if it seems unimportant):
netatmo:
api_key: !secret netatmo_api
secret_key: !secret netatmo_key
username: !secret netatmo_user
password: !secret netatmo_pass
discovery: true
webhooks: false
climate:
- platform: netatmo
Traceback (if applicable):
2019-05-19 15:31:44 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform netatmo
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
return fut.result()
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.7/site-packages/homeassistant/components/netatmo/climate.py", line 97, in setup_platform
for room_id in room_data.get_room_ids():
File "/usr/local/lib/python3.7/site-packages/homeassistant/components/netatmo/climate.py", line 345, in get_room_ids
if not self.setup():
File "/usr/local/lib/python3.7/site-packages/homeassistant/components/netatmo/climate.py", line 358, in setup
self.update()
File "/usr/local/lib/python3.7/site-packages/homeassistant/util/__init__.py", line 224, in wrapper
result = method(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/homeassistant/components/netatmo/climate.py", line 382, in update
homestatus_room['therm_setpoint_temperature']
KeyError: 'therm_setpoint_temperature'
Additional information: Screenshot from the Netatmo API App.
Original issue: https://github.com/home-assistant/home-assistant/issues/23990
I have found that when one or more thermostat is outside reach, then the platform will not load the ones within reach. If all thermostats is within reach no error is produced - need a fix so the platform will not crash if one or more thermostats is outside reach.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 81 (80 by maintainers)
Sorry 😄 I told you - I’m working on something myself, so I have my dev-environment up and running most of the day 😄
And everything is still OK, even with one thermostat offline. Nice work, sir 😃
Great. Thanks again for your patience and quick testing.
Nailed it again 😉
Ok, the default max temp was wrong. I hope that was the issue.
Nailed it - but…
New climate entity:
Old climate entity:
Is it on purpose it doesn’t show “Cool” as status and doesn’t show the option to switch between auto and cool?
And another round. Sorry if this is just tiny steps.
New day - new error 😉
https://pastebin.com/mhqYqjrH
Nope - now a new error occurs
https://pastebin.com/burK32Mw
Tested in my setup (I found the same problem when 2 of my Netatmo radiator valves ran out of battery and therm_setpoint_temperature wasn’t in the API). With the last PR from @cgtobi, Netatmo thermostat are working again (tested on 0.94.2). Thanks!
It wouldn’t be possible without you extensive testing. Thanks again for your patience.
Works like a charm - thermostats are added if they are out of reach as being off and becomes active once it get back online. Thumbs up for great work there 😃
OH! You already did add the feature to present the thermostats when they come online?! Will test when the connection drops again, but it looks like the missing one got added when it came back online.
BINGO!
Then it’s just the “nice to have” feature of adding the missing thermostats when they become available.
Nice work @cgtobi!
Still not quite there:
Yes - no disconnects for a few days. Really annoying when we are testing this 😄
Today it looks like my thermostats are behaving - they haven’t been offline untill now 😃
I’ll have an eye on the app, and test as soon as one of them goes offline.
Nah - that busted something with the native climate domain:
You are too quick to test. 😆
Bad bad bad 😄 Traceback and error was so long so I put it in hastebin:
https://hastebin.com/uqitucopab.sql
Better - now it does load the thermostats in range and “skips” the ones not in range.
But the KeyError is still present in logs:
Next to test is to see if the missing thermostats are loaded automatically when they connect/get in range.
Dev branch traceback is:
But again - the reason for the error is the same on dev and release branch.