#history stats bug?
1 messages · Page 1 of 1 (latest)
It's a bug... in the start of the template. "today" changes at midnight and would be a future time
Maybe something like
{% set target = today_at('20:30') %}
{{ target if target < now() else target - timedelta(days=1) }}
``` for your start
like this ?
- platform: history_stats name: in bed entity_id: binary_sensor.test_still_target state: "on" type: time start: "{% set target = today_at('20:30') %} {{ target if target < now() else target - timedelta(days=1) }}" duration: hours: 17
Use this
- platform: history_stats
name: in bed
entity_id: binary_sensor.test_still_target
state: "on"
type: time
start: >
{% set target = today_at('20:30') %}
{{ target if target < now() else target - timedelta(days=1) }}
duration:
hours: 17
thanks alot