Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 102998

Template as trigger never triggers

$
0
0

Hello :slight_smile:

I try to send a notification when the outdoor temperature is about to reach the indoor temperature (or vice versa).

I have 2 sensors and created a derivative helper from the outdoor sensor.

Now I made the following template as trigger but it won’t trigger the automation.

The template listen to the following events:

  • Entity: sensor.0x00124b0025031c97_4_temperature_2 → outdoor sensor
  • Entity: sensor.0x00124b0025033e5e_3_temperature → indoor sensor
  • Entity: sensor.derivee_temperature_sud → derivative from outdoor sensor
{## store temperatures in var ##}
{% set temp_int = float(states.sensor["0x00124b0025033e5e_3_temperature"].state) %}
{% set temp_ext = float(states.sensor["0x00124b0025031c97_4_temperature_2"].state) %}

{## calculate the difference between the two ##}
{% set temp_diff =  float(states.sensor["0x00124b0025031c97_4_temperature_2"].state) - float(states.sensor["0x00124b0025033e5e_3_temperature"].state) %}

{## predict the temperature in 30 minutes given the current temperature and the derivative (mili Celcius/minute) ##}
{% set derivate = float(states.sensor.derivee_temperature_sud.state) * 30 / 1000 %}
{% set predicted_temp_ext = temp_ext + derivate %}

{## if the predicted outdoor temperature (in 30min) is above the indoor temperature, trigger the actions. ##}
{% if predicted_temp_ext > temp_int %}
  true
{% endif %}

The result in dev tool is ‘true’.

Automation trace is empty (I also checked that notification is working using time pattern as trigger).

What am I doing wrong ?

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 102998

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>