How to automate

Hi!

I use a netatmo thermostat, and would like to write a simple (?) automation that notifies me when the temperature go below a certain value.

Notification thorugh notify command (html5 that finally now works for me).

Any help?

How to poll the temperature? Once polled when to poll it again (to not give two notification for the same problem?

I hope I am clear.

Thanks!

Is the netatmo thermostat integrated in HA?
Do you see the temperature in the frontend?

Yes and this is my entity_id

climate.office_thermo

and this when I click on it in the States

{
“away_mode”: “off”,
“current_temperature”: 17.5,
“friendly_name”: “Termostato Ufficio”,
“max_temp”: 35,
“min_temp”: 7,
“operation_mode”: “heat”,
“temperature”: 19,
“unit_of_measurement”: “°C”
}

I did this in the past but it never works. Maybe automation is not the right tool? Because automation starts when you start it. For me it should always on … or?

  - alias: 'Temperature below'
    trigger:
      platform: numeric_state
      entity_id: sensor.netatmo_office_temperature
      # Optional
      #value_template: '{{ state.attributes.battery }}'
    # At least one of the following required
      above: 23
      below: 19
    action:
    - service: notify.push_html5
      data:
        message: Attenzione temperatura 
#

p.s. the sensor is a netatmo weather station. I don’t mind if I use the sensor orr the netatmo thermostat component (which also has a temp sensor inside)

Try something like

- alias: "Low temp"
  trigger:
    - platform: numeric_state
      entity_id: states.climate.office_thermo.attributes.temperature
      below: 17
  action:
    service: notify.push_html5
    data:
      message: Temperature is below ....

it never gets triggered … mmhh

The one I posted too?
Have you already tested it?

It will only trigger when the temperature goes from above 17 to under 17. It will NOT trigger if the temperature is below 17 when you start HA.

yes I see. ANy way to do an automatic poll once every X minute/hour?

Isn’t it the same as mine? Shall I take out the “above 23”?

Or you are reffering to change the entity_id (I don’t have it as states.climate.office_thermo.attributes.temperature when I check in the developer tools)

what would be the entity id to check the current_temperature?

climate.office_thermo.current_temperature???

Sorry. Try this:

- alias: "Low temp"
  trigger:
    - platform: numeric_state
      entity_id: states.climate.office_thermo
      value_template: '{{ states.climate.office_thermo.attributes.temperature}}'
      below: 17

Go to YOUR_IP:8123/dev-template, there you can verify what template gives the correct temperature.

You can also trigger the automation as often as you want: https://home-assistant.io/getting-started/automation-trigger/#time-trigger But I do not see why you would do that.

how does HASS work in that regard? I mean once an automation is in the automation.yaml file, and there is a trigger option … is it a poll system? Every how much is it checked?

This automation will trigger every 5 min:

automation 3:
  trigger:
    platform: time
    # You can also match on interval. This will match every 5 minutes
    minutes: '/5'
    seconds: 00

Then if the conditions are met, the action part will be done every 5 minutes.

1 Like

Remove

{%- if is_state("device_tracker.paulus", "home") and 
       is_state("device_tracker.anne_therese", "home") -%}
......

Add
{{ states.climate.office_thermo.attributes.temperature}}

1 Like

This is not necessary in this case - Home Assistant will check that automation every time the thermometer sends a change in value, there is no poll for the automation, it will react instantly. (The thermometer itself may or may not be polled depending on the component’s implementation but you don’t need to worry about that for the automation).

ahhhhh nice :))))

:slight_smile:

There you can test all templates, and probably save a lot of time debugging.

well I agree on the first part of the sentence, but since my current level of experience, not agree on the second part :smile:

If I needed to put in front end this value, how can it be done?

I mean it is not an entity_id, (not listed at least)

Make a template sensor: https://github.com/Danielhiversen/home-assistant_config/blob/master/sensors.yaml#L59

1 Like