Netatmo thermostat control override time

When setting the temperature manually via the Netatmo thermostat app you can choose how long you want the manual override to last before returning to the schedule.

It would be useful to be able to do this with home assistant automations.

The API supports it, and in fact the current Netatmo component does pass this into the API call - from netatmo.py:

def set_temperature(self, **kwargs):
    """Set new target temperature for 2 hours."""
    temperature = kwargs.get(ATTR_TEMPERATURE)
    if temperature is None:
        return
    mode = "manual"
    self._data.thermostatdata.setthermpoint(
        mode, temperature, DEFAULT_TIME_OFFSET)
    self._target_temperature = temperature
    self._away = False

It’s currently hardcoded to DEFAULT_TIME_OFFSET, which is 2hrs (7200 seconds).

It would be good to have this as an optional parameter for the service call.

I can see how this could be done using a new optional attribute (i.e. ATTR_TIME_OFFSET).

I think I can see the Python changes needed, but it would mean changes to the base climate component as well as the Netatmo platform.

I’m obviously wary of introducing issues for users of other thermostats, hence my reluctance to do this myself :slight_smile:

Hello,

Can you tell me which file you are looking in ?

I have netatmo.py and lnetatmo.py but can’t find this line in the files.

I also have this 2 hours hard coded so I should find it somewhere :slight_smile:

Thank you in advance,

Tibuski

It’s in homeassistant/components/climate/netatmo.py.

Function set_temperature (line 125) uses DEFAULT_TIME_OFFSET defined on line 28.

I’d assume that components/climate/init.py also needs changing to add ATTR_TIME_OFFSET to the SET_TEMPERATURE_SCHEME as an optional variable. Other climate components would ignore it, netatmo could use it if supplied, still defaulting to 7200s if not supplied.

Thank you sean ! I found it in the meantime and tried set it at 14 400 but it didn’t change anything …

The more I play with this thermostat, the more I notice missing functions through the API :slight_smile:

I’ve just tested mine by changing DEFAULT_TIME_OFFSET in climate/netatmo.py and restarting HA.

It worked for both 3600 and 14400 - changing the override to one hour or four hours.

Correct my bad :slight_smile: I probably forgot to restart HA when I did my tests …

No worries! I did wonder, hence me mentioning the restart :grinning: