Testers needed for Netatmo climate (multiple thermostats or valves)

This simply means that you have not successfully replaced the smart_home/Thermostat.py file with the revised one:

I tried using the modified thermostat.py and deleted the pycache folder, it worked on the next reboot but afterwards it always gave me the same problem and I put the original thermostat.py back on.

Now the story is more complete. It should not have given you the same error messages.

It’s hard to follow the current version of this component.

My last version was one without thermostat.py (only two netatmo.py files).

I have two suggestions to make this a little more transparent @Baosong_Shan

  1. open another (your own) thread and update your changes in your first posting. This way everyone would know where to find the current version.
    Put the link to the new thread here and call this this closed

  2. add this component to the custom updater component. This way we could autoupdate your component.
    https://github.com/custom-components/custom_updater
    This would be nice but probably more work for you.

with the modified thermostat.py and pycache deleted this is the error:

2019-01-15 15:33:54 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform netatmo
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py”, line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/lib/python3.5/asyncio/tasks.py”, line 400, in wait_for
return fut.result()
File “/usr/lib/python3.5/asyncio/futures.py”, line 293, in result
raise self._exception
File “/usr/lib/python3.5/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/home/homeassistant/.homeassistant/custom_components/climate/netatmo.py”, line 74, in setup_platform
for room_id in room_data.get_room_ids():
File “/home/homeassistant/.homeassistant/custom_components/climate/netatmo.py”, line 327, in get_room_ids
if self.setup():
File “/home/homeassistant/.homeassistant/custom_components/climate/netatmo.py”, line 338, in setup
self.homestatus = pyatmo.HomeStatus(self.auth, home=self.home)
File “/srv/homeassistant/lib/python3.5/site-packages/smart_home/Thermostat.py”, line 126, in init
while ‘home’ not in resp[‘body’]:
KeyError: ‘body’

You are right, but in fact for the people who have had Netatmo thermostat working, you can ignore the later changes, especially the last one with roberto87, which is related to unstable HTTP request (it should be corrected, but that requires works in pyatmo module and will take me some time).

Following your suggestion, I opened a new thread New Netatmo climate component supporting multiple thermostats/valves .

So this thread now should be closed somehow.

I updated the gist according to your error message, please re-pull and try.

with new file this is the error:

2019-01-15 16:43:33 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform netatmo
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py”, line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/lib/python3.5/asyncio/tasks.py”, line 400, in wait_for
return fut.result()
File “/usr/lib/python3.5/asyncio/futures.py”, line 293, in result
raise self._exception
File “/usr/lib/python3.5/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/home/homeassistant/.homeassistant/custom_components/climate/netatmo.py”, line 74, in setup_platform
for room_id in room_data.get_room_ids():
File “/home/homeassistant/.homeassistant/custom_components/climate/netatmo.py”, line 327, in get_room_ids
if self.setup():
File “/home/homeassistant/.homeassistant/custom_components/climate/netatmo.py”, line 338, in setup
self.homestatus = pyatmo.HomeStatus(self.auth, home=self.home)
File “/srv/homeassistant/lib/python3.5/site-packages/smart_home/Thermostat.py”, line 131, in init
if ‘home’ in resp[‘body’]:
KeyError: ‘body’

the thermostat does not appear in the frontend :frowning:
p.s. i have the pyatmo 1.5 , is the correct version ?

Latest pyatmo is 1.6, but it is not essential, just focus on this issue first. I updated again and please re-pull and retry.

2019-01-15 18:12:33 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform netatmo
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py”, line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/lib/python3.5/asyncio/tasks.py”, line 400, in wait_for
return fut.result()
File “/usr/lib/python3.5/asyncio/futures.py”, line 293, in result
raise self._exception
File “/usr/lib/python3.5/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/home/homeassistant/.homeassistant/custom_components/climate/netatmo.py”, line 75, in setup_platform
for room_id in room_data.get_room_ids():
File “/home/homeassistant/.homeassistant/custom_components/climate/netatmo.py”, line 328, in get_room_ids
if self.setup():
File “/home/homeassistant/.homeassistant/custom_components/climate/netatmo.py”, line 341, in setup
self.update()
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/util/init.py”, line 324, in wrapper
result = method(*args, **kwargs)
File “/home/homeassistant/.homeassistant/custom_components/climate/netatmo.py”, line 357, in update
_LOGGER.debug(self.homestatus.rawData)
AttributeError: ‘HomeStatus’ object has no attribute ‘rawData’

That means after 10 retries, it still failed to get correct data, kind of very abnormal.

Could you please try the steps in the following thread to get some more detail of the errors?

how do I run a testing python script?

Just cd to the directory where the file lies, and run python test_netatmo_api.py

Which folder should I select?

Any, put it in any folder, and run it from there.

I updated the testing script and please re-pull and retry. https://gist.github.com/shanbs/b2551057792c651bd03f7d2b67f98242

Maybe we can try to fix this by PM (private message) and publish the resolution when done.

after this change i cannot see the data about the weather station,

Which change?

about the new version of netatmo.py in /custom_components and in _components/climate

But I have not changed it for a long time essentially, AND, I don’t think i’ve ever touched any code related to weather station. If you are sure this is related to my code, please let me know more details, like when you started to use this custom_component of netatmo and it worked OK, and since when not, with also log information. Otherwise it is essentially not possible to trace.