diff --git a/source/_integrations/binary_sensor.template.markdown b/source/_integrations/binary_sensor.template.markdown index 81c298124fd..675eef2e95a 100644 --- a/source/_integrations/binary_sensor.template.markdown +++ b/source/_integrations/binary_sensor.template.markdown @@ -334,3 +334,21 @@ automation: - service: homeassistant.update_entity entity_id: binary_sensor.minute_is_odd {% endraw %} + +In the case where the template should be updated every minute, replacing `now()` with `as_local(states.sensor.time.last_changed)` +can achieve the desired result without the need to create an automation: + +{% raw %} +```yaml +sensor: + - platform: time_date + display_options: + - 'time' + +binary_sensor: +- platform: template + sensors: + minute_is_odd: + value_template: '{{ as_local(states.sensor.time.last_changed).minute % 2 }}' +``` +{% endraw %}