Adding support for Netatmo Thermostat

I first noticed that my sensor doesn’t work any more. It looks like this:

    netatmo_thermostat_mode:
      value_template: >-
        {% set devices = [  states.climate.netatmo_device1,
                            states.climate.netatmo_device2,
                            states.climate.netatmo_device3,
                            states.climate.netatmo_device4,
                            states.climate.netatmo_device5 ] %}
        {% set auto_amount = devices | selectattr('attributes.operation_mode','eq','auto') | list | length %}        
        {{ 'auto' if auto_amount == devices | length else 'manual' }}

It stays at manual, but it has to show auto, because all sensors are in “auto” mode.

After that I checked the climate entities. the following happens:

  • When I change a device in the netatmo app it DOESN’T get reported to home assistant any more. So it stays at auto even if it is in manual.

  • When I change the device in home assistant I can see the temp change in the App

So both systems are still connected but something is wrong.

Before opening a new issue, I’d like to ask if someone here can reproduce this behaviour.

Thanks

There is no attribute operation_mode since the climate refactor.

Try:

    netatmo_thermostat_mode:
      value_template: >-
        {% set devices = [  states.climate.netatmo_device1,
                            states.climate.netatmo_device2,
                            states.climate.netatmo_device3,
                            states.climate.netatmo_device4,
                            states.climate.netatmo_device5 ] %}
        {% set auto_amount = devices | selectattr('state','eq','auto') | list | length %}        
        {{ 'auto' if auto_amount == devices | length else 'manual' }}

1 Like

Thanks, this works. But I still have my second issue.

Hm, that works fine here also.

No issues for me either…change temp/schedule in App and it’s refelcted in HA after a few minutes

1 Like

There is a gap as we only query the netatmo api every 5 or 10 minutes.

1 Like

Even after an hour the state doesn’t get updated from “auto” to “manual”.

Any suggestions on how to fix this?

Edit: notices the following. The states of the entities stay at “auto”.
But when I look at the entities in Lovelace I can see the difference between a device in auto or manual mode. (With some delay as you mentioned).

So how to get that information back into the state of the entity. Could it be a translation issue?

How does that state look for you in Lovelace?

When the set point is set manually:

state: auto
hvac_action: idle
preset_mode: manual

When a schedule is dialed in:

state: auto
hvac_action: idle
preset_mode: Schedule

I see. So we don’t look at the state any more, because that’ what changed in the past.

So state will always stay at auto? If yes why don’t have the preset_mode in state as before

Well, there was a big refactoring effort some month ago across all climate components. state actually can be off, auto and heat.

1 Like

Ok, probably did not notice that because I don’t use those entities in summer.

With that information I was able to modify the sensor code above. It works again. It gives a fast overview if all thermostats are in auto or if at least one is set to manual.

    netatmo_thermostat_mode:
      value_template: >-
        {% set devices = [  states.climate.netatmo_device1.attributes,
                            states.climate.netatmo_device2.attributes,
                            states.climate.netatmo_device3.attributes,
                            states.climate.netatmo_device4.attributes,
                            states.climate.netatmo_device5.attributes ] %}
        {% set auto_amount = devices | selectattr('preset_mode','eq','Schedule') | list | length %}        
        {{ 'Schedule' if auto_amount == devices | length else 'manual' }}
1 Like

I just checked my other netatmo thermostat entities and noticed that my boiler state sensor doesn’t work any more.

It seems like the boiler state attribute is gone too? Do you know how to get that value?

- platform: template
  sensors:
    netatmo_boiler_status:
      friendly_name: 'Boiler'
      value_template: '{{ states.climate.netatmo_device1.attributes.boiler_status }}'
      icon_template: >
        {%- set boiler = states.climate.netatmo_device1.attributes.boiler_status -%}
        {%- if boiler -%} mdi:fire {% elif not boiler %} mdi:leaf {% endif %}

So the boiler state is gone right?

I think what you want is now called hvac_action.

{{ state_attr('climate.netatmo_device1', 'hvac_action') == 'heating' }}

Thanks, yes that’s what I was looking for.

Unfortunately I get an error:

Error loading /config/configuration.yaml: while parsing a block mapping
  in "/config/binarysensor.yaml", line 89, column 7
expected <block end>, but found '<scalar>'
  in "/config/binarysensor.yaml", line 90, column 40
    netatmo_boiler_status:
      friendly_name: 'Boiler'
      value_templates: '{{ state_attr('climate.netatmo_device1', 'hvac_action') == 'heating' }'

Couldn’t figure it out. Works fine in the devtool template section but not in the yaml file.

That is a quoting issue.

Try:

    netatmo_boiler_status:
      friendly_name: 'Boiler'
      value_template: >
        {{ state_attr('climate.netatmo_device1', 'hvac_action') == 'heating' }}
1 Like

This works, thanks.

Full working example to copy and paste:

- platform: template
  sensors:
    netatmo_boiler_status:
      friendly_name: 'Boiler'
      value_template: >
        {{ state_attr('climate.netatmo_device1', 'hvac_action') == 'heating' }}
      icon_template: >-
        {% if state_attr('climate.netatmo_device1', 'hvac_action') == 'heating' %}
          mdi:fire
        {% else %}
          mdi:leaf
        {% endif %}

Hi everybody !

I up this topic, especialy for @cgtobi !
Could you add the possibility to select a date and hour of endtime ?

thank you !!! :slight_smile: