I know that this question has already been asked several times and I have really tried many of the solutions described, but none of them work for me, although I have really tested many methods.
I have broken the task down to a minimum. As soon as a temperature sensor goes below 19 degrees during the day, a radiant heater should be switched on.
The problem: the automation is not triggered!
Attempt 1 via device:
alias: TEST
description: “”
triggers:
- type: temperature
device_id: b4c4cf81b145450bce0f5f00176d5b9c
entity_id: b08172f72103f37c3d4df4d1f4c02e01
domain: sensor
trigger: device
below: 19
conditions:
- condition: sun
before: sunset
after: sunrise
actions:
- type: turn_on
device_id: 03a6d229cb32012bd8bc885266c86e9c
entity_id: 971c63d8905b6786c06aec11845acd53
domain: switch
mode: single
Both wont trigger. I understood, that the reason might be, that the temperature at night will go below 19 degrees, and that the value on sunset maybe below 19 so that it will not cross again…
But that is not how template triggers work. Template triggers only trigger when they go from false to true. If its value is already true at the time the automation is loaded, it will not trigger until it goes false and then back to true again.