#history stats bug?

1 messages · Page 1 of 1 (latest)

plain plover
#

in the history it cuts off at midnight and it doesnt continu beyond that point

solemn barn
#

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
plain plover
#

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

solemn barn
#

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
plain plover
#

thanks alot