I know I can trigger an automation when a sensor is on for some period of time. But I would like to create a template binary sensor that is resolves to true if another sensor has been in an on state for x minutes.
Here is pseudo code, with the intention of turning on My Sensor when some other sensor has been on for 5 minutes. Can this be done? Easily?
my_sensor:
friendly_name: "My Sensor"
device_class: power
value_template: >-
{{ states('sensor.some_other_sensor') == 'on' for '00:05:00' }}