I’m looking for a way to create an entity (boolean) that should be true if a sensor has been below a certain temperature for a certain time. The closest I’ve come is the following, which I think becomes True if the sensor has been below 0C in last 8h … however I have not been able to test it … and additionally, I’d like to make it more generic so that any temperature can be given, not a state such as ‘below_zero’. Any advice? Thanks in advance,
sensor:
- platform: history_stats
name: Outdoor temp below 0C in the last 8h
entity_id: sensor.ute_temperature
state: 'below_zero'
type: time
start: "{{ as_timestamp(now()) - 8 * 3600 }}"
end: "{{ as_timestamp(now()) }}"
Edit: So, this sensor would count the time below a certain temperature (in this case zero - but again, I’d like it more generic, i.e. input a certain temperature), and then another (binary) sensor could be set to True if this sensor is >0…