Testers needed for Netatmo climate (multiple thermostats or valves)

Hi Baosong_Shan,
Thanks for the quick fix, unfortunately it did not work. Now I get the follo> wing error:

Log Details (ERROR)
Fri Nov 23 2018 15:48:11 GMT+0100 (Centraleuropæisk normaltid)

netatmo2: Error on device update!
Traceback (most recent call last):
File “/usr/src/app/homeassistant/helpers/entity_platform.py”, line 251, in _async_add_entity
await entity.async_device_update(warning=False)
File “/usr/src/app/homeassistant/helpers/entity.py”, line 349, in async_device_update
await self.hass.async_add_executor_job(self.update)
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/climate/netatmo2.py”, line 267, in update
self._data.update()
File “/usr/src/app/homeassistant/util/init.py”, line 324, in wrapper
result = method(*args, **kwargs)
File “/config/custom_components/climate/netatmo2.py”, line 357, in update
if self.thermostat_type == ‘NATherm1’:
AttributeError: ‘ThermostatData’ object has no attribute ‘thermostat_type’

Hi briis, thanks again. Could you please re-pull once more and let me know the result?

Hi Baosong_Shan
You are a Rock Star :grin:. Finally we have a working solution for this. Fantastic. Thank you very much.
I can now see both my valves and I can control them independently. Thx.

You are welcome. Glad it works!

The modified netatmo2.py should go to custom_components/climate, the one under custom_components can stay.

However, personally I keep only the ['climate'] in domain list (line 62 of custom_components/netatmo2.py ) to avoid error messages (I don’t have other components from Netatmo).

    for component in ['climate']:
        discovery.load_platform(hass, component, DOMAIN, {}, config)

I have difficulties in following. I do have 3 thermostat and one weather station, now my configuration is as

climate:
  - platform: netatmo2
  - platform: netatmo
netatmo2:
  api_key: !secret netatmo2_api_key
  secret_key: !secret netatmo2_secret_key
  username: !secret netatmo_username
  password: !secret netatmo_password
  discovery: False
netatmo:
  api_key: !secret netatmo_api_key
  secret_key: !secret netatmo_secret_key
  username: !secret netatmo_username
  password: !secret netatmo_password
  discovery: False

I applied your code, and is still working on one thermostat, but second thermostat is decoupled (before with other code would follow, wrongly, the settings of the first thermostat, now with yuour code second thermostat does not change values

omg this worked.
You really are a rockstar, thanks!

Are your two thermostats configured in the same room or two different rooms? Basically my modifications will get the information as the unit of "room"s, so if they stay in the same room, only one item will display. I was thinking about to use the unit “module” instead of “room”, but when I tried to put my thermostat and valve in the same room, in Netatmo app I see only the thermostat temperature, the valve’s was gone. That’s why I decided to use “room”.

Anyway, please let me know your configuration and your Netatmo App display if possible, so that I can think how to improve.

Klagio, I added two lines of debugging information, so could you please re-pull the code, and enable the debugging information in your HASS configuration file by:

logger:
  logs:
    custom_components.climate.netatmo2: debug

Then, restart your HASS and find in the log file “Following is the debugging output for homestatus.rooms:” and paste the result in reply (removing any personal information, of course).

Thanks!

1 Like

Two different rooms: differently from valves it makes no sense to have two thermostat in the same room. Not sure how Netatmo original software handles rooms for thermostats

you mean screenshot of Netatmo app, or?

Can you try to search for “DEBUG” from your logger output?

2018-11-23 19:45:04 DEBUG (SyncWorker_18) [custom_components.climate.netatmo2] Starting to setup platform climate.netatmo2 …

2018-11-23 19:45:06 DEBUG (SyncWorker_18) [custom_components.climate.netatmo2] Setting up Living …

Is that all? What is the name of your “home”?

That’s all.

Room: Living Corridor Office

Home 1: Living (with room Living
Home 2: Corridor (with room corridor)
Home 3: Office (with room office)

strangely is not possible to have the same Home name for multiple thermostat

I had an old entry in the netatmo app which I now deleted, now the debug comes with more info. There are more lines, but seems to me with the same content. Is the below enough for you?

2018-11-23 20:28:16 DEBUG (SyncWorker_18) [custom_components.climate.netatmo2] Setting up Office (255078xxxx) ...
2018-11-23 20:28:16 DEBUG (SyncWorker_18) [custom_components.climate.netatmo2] []
2018-11-23 20:28:16 DEBUG (SyncWorker_18) [custom_components.climate.netatmo2] Adding devices for room Office (255078xxxx) ...
2018-11-23 20:28:16 DEBUG (SyncWorker_18) [custom_components.climate.netatmo2] Setting up Living ...

2018-11-23 20:28:17 DEBUG (SyncWorker_11) [custom_components.climate.netatmo2] Following is the debugging output for homestatus.rooms:
2018-11-23 20:28:17 DEBUG (SyncWorker_11) [custom_components.climate.netatmo2] {'255078xxxx': {'id': '255078xxxx', 'reachable': True, 'therm_measured_temperature': 19.3, 'therm_setpoint_temperature': 12, 'therm_setpoint_mode': 'away', 'therm_setpoint_start_time': 1542883948, 'therm_setpoint_end_time': 0}}
2018-11-23 20:28:17 DEBUG (SyncWorker_18) [custom_components.climate.netatmo2] Setting up Living Room (317096xxxx) ...
2018-11-23 20:28:17 DEBUG (SyncWorker_18) [custom_components.climate.netatmo2] []
2018-11-23 20:28:17 DEBUG (SyncWorker_18) [custom_components.climate.netatmo2] Adding devices for room Living Room (317096xxxx) ...
2018-11-23 20:28:18 DEBUG (SyncWorker_18) [custom_components.climate.netatmo2] Setting up Corridor ...
2018-11-23 20:28:20 DEBUG (SyncWorker_14) [custom_components.climate.netatmo2] Following is the debugging output for homestatus.rooms:
2018-11-23 20:28:20 DEBUG (SyncWorker_14) [custom_components.climate.netatmo2] {'317096xxxx': {'id': '317096xxxx', 'reachable': True, 'therm_measured_temperature': 20.1, 'therm_setpoint_temperature': 21, 'therm_setpoint_mode': 'schedule', 'therm_setpoint_start_time': 1542998588, 'therm_setpoint_end_time': 0}}


2018-11-23 20:28:20 DEBUG (SyncWorker_18) [custom_components.climate.netatmo2] Setting up Corridor (364331xxxx) ...
2018-11-23 20:28:20 DEBUG (SyncWorker_18) [custom_components.climate.netatmo2] []
2018-11-23 20:28:20 DEBUG (SyncWorker_18) [custom_components.climate.netatmo2] Adding devices for room Corridor (364331xxxx) ...
201

20:28:22 DEBUG (SyncWorker_0) [custom_components.climate.netatmo2] Following is the debugging output for homestatus.rooms:
2018-11-23 20:28:22 DEBUG (SyncWorker_0) [custom_components.climate.netatmo2] {'364331xxxx': {'id': '364331xxxx', 'reachable': True, 'therm_measured_temperature': 21.3, 'therm_setpoint_temperature': 24, 'therm_setpoint_mode': 'manual', 'therm_setpoint_start_time': 1542998916, 'therm_setpoint_end_time': 1543006116}}
2018-11-23 2

I noticed that the 2 thermostat that are not working have the above value, while the thermostat that is working (corridor) has the below value

‘therm_setpoint_end_time’: 1543006116}}

Interesting, why have you set 3 different "home"s? I thought one instance of HASS should have only one “home”. Let me think how this should be done…

This has nothing to do with it. The reason should be incorrect home_id.

I have multiple Home’s in Netatmo app,

Could you please paste your configuration segment for netatmo2?