Automation not working with trigger time

I need help with my automation. Where is my mistake? What is it that i don’t see?
The sensor readings are fine and a manual trigger works also fine. But automatic trigger by time in the morning at 06:30 does not work.


alias: Heizung aufwärmen  (time only)
description: ''
trigger:
  - platform: numeric_state
    below: '21'
    above: '12'
    entity_id: sensor.fritzdose
condition:
  - condition: time
    before: '22:00'
    after: '06:30'
action:
  - service: notify.ting
    data:
      message: Aufheizen
  - service: climate.set_temperature
    data:
      temperature: 29.5
    entity_id: climate.eq3bt_wohnzimmer
  - service: climate.set_temperature
    data:
      temperature: 29.5
    entity_id: climate.eq3bt_kueche
  - service: climate.set_temperature
    data:
      temperature: 29.5
    entity_id: climate.eq3bt_schlafzimmer
mode: single

You don’t have a trigger for time 6:30, only for the sensor.
A sidenote on you trigger, it will only trigger when the value goes outside of the range 12-21 and then inside the range. It will then only trigger again once the value goes out of the range and in the range again. Meaning if it changes from e.g. from 14 to 15 it will not trigger.

1 Like

Yes, understand. The automation should only be triggered between 06:30-22:00, so this is the condition to be met. And temperature as a trigger only if the temp goes below 21. the below value was just for testing and does not matter.
So what I want is: if temp is below 21 and it is after 6:30 in the morning and before 22:00 evening the heating should be turned on.

Your current automation will do this:

temp changes from above 21 to below 21 -> time is between 6:30 and 22:00 -> heating turns on

temp changes from 20 to 18 -> nothing happens

The problem you have is probably that the temp is already below 21 before 6:30, then it will only trigger once the temp goes above 21 and then below 21 again.

What I would do is:

  • trigger on any temperature change
  • condition and:
    • time between 6:30 and 22:00
    • temperature < 21
    • heating currently OFF
  • action -> turn on heating

Thank you for your input.

How to trigger ˋanyˋ changes on the temperature sensor? Does it work if it says: below: 21?

trigger:
  platform: state
  entity_id: sensor.fritzdose
1 Like

Thanks.
So finally, tomorrow it will be warm when I wake up :crazy_face:

2 Likes

Warm like in Aruba! :beach_umbrella: :slight_smile:

1 Like