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 Baosong_Shan
You are a Rock Star . 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.
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 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
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:
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).
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
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