Adding support for Netatmo Thermostat

@anon35356645
I’ve pushed new changes to my github.
https://github.com/gieljnssns/My_Home-Assistant/tree/master/homeassistant/custom_components/climate
https://github.com/gieljnssns/My_Home-Assistant/tree/master/homeassistant/deps/smart_home

Can you please test and let me know?

testing now

you’re fast

no, it chjanges temperature to only one thermostat. Values shown are ok

Is away mode correct?

no, I did away on one, and triggered:

  • away on all (in HASS)
  • away on one (in real).

I changed the real away back on normal, and did not update on HASS front end

can you test again?

you changed the files?

Soon arriving pizza break

yes a little bit, but it will not work. (i think)

rebooting ,

EDIT

it did make away al;so the other thermostat in HASS. But in real it did correclty the away mode.

It works only on one thermostat

I’ve pushed my final try for today

upgraded to 38.1

17-02-12 09:10:31 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform netatmo
Traceback (most recent call last):
File “/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py”, line 151, in _async_setup_platform
entity_platform.add_entities, discovery_info
File “/usr/lib/python3.4/asyncio/futures.py”, line 388, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.4/asyncio/tasks.py”, line 286, in _wakeup
value = future.result()
File “/usr/lib/python3.4/asyncio/futures.py”, line 277, in result
raise self._exception
File “/usr/lib/python3.4/concurrent/futures/thread.py”, line 54, in run
result = self.fn(*self.args, **self.kwargs)
File “/home/hass/.homeassistant/custom_components/climate/netatmo.py”, line 54, in setup_platform
add_devices([NetatmoThermostat(data, module_name, device)])
File “/home/hass/.homeassistant/custom_components/climate/netatmo.py”, line 80, in init
self.update()
File “/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/util/init.py”, line 296, in wrapper
result = method(*args, **kwargs)
File “/home/hass/.homeassistant/custom_components/climate/netatmo.py”, line 161, in update
self._target_temperature = self._data.thermostatdata.setpoints(module=self._name, device=self._device)
AttributeError: ‘ThermostatData’ object has no attribute ‘setpoints’

You have to replace the thermostat.py file again.

I did it, maybe I need to delete the directory pycache?

Do you have this:

def setpoints(self, module=None, device=None, mid=None):
    """
    Return the setpoint of a given module.
    """
    # print('setpoints')
    setpoint = None
    if mid:
        module_data = self.moduleById(mid)
        # print('mid')
    else:
        module_data = self.moduleByName(device=device, module=module)
        # print('iets')
    if module_data:
        print(module_data)
        if module_data['setpoint']['setpoint_mode'] == 'manual':
            setpoint = module_data['setpoint']['setpoint_temp']
        # elif module_data['setpoint']['setpoint_mode'] == 'program':
        #     setpoint = module_data['measured']['setpoint_temp']
        else:
            setpoint = module_data['measured']['setpoint_temp']
        # setpoint = module_data['setpoint']['setpoint_temp']
    return setpoint

on line 96?

I re did it.

I don’t understand why I need to redo the installation two times, all the time.

Now works (with errors as before but I have it in front end at least)

@anon35356645
I’ve tried something completely different, can you please test another time?

Thanks, tonight, CET

@gieljnssns

17-02-16 17:53:58 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform netatmo
Traceback (most recent call last):
File “/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py”, line 151, in _async_setup_platform
entity_platform.add_entities, discovery_info
File “/usr/lib/python3.4/asyncio/futures.py”, line 388, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.4/asyncio/tasks.py”, line 286, in _wakeup
value = future.result()
File “/usr/lib/python3.4/asyncio/futures.py”, line 277, in result
raise self._exception
File “/usr/lib/python3.4/concurrent/futures/thread.py”, line 54, in run
result = self.fn(*self.args, **self.kwargs)
File “/home/hass/.homeassistant/custom_components/climate/netatmo.py”, line 66, in setup_platform
for relay_name in data.get_relay_names():
File “/home/hass/.homeassistant/custom_components/climate/netatmo.py”, line 253, in get_relay_names
for relay in self.thermostatdata.relays.values():

Is this the whole error?