Klonk0
(Klonk0)
January 6, 2024, 3:56am
1
Dear HA Community,
I am a bit confused on the Period attribute in the Statistic Card. When exactly does ‘day’ begin? 0:00 of the current day or does it cover the last 24 hours ?
Same for year, ist it the last 365 days or starting at 1.1.202x.?
What I am looking for is static values for the current day starting at 0:00 and the last 365 days.
odwide
January 6, 2024, 4:17am
2
It’s a calendar period , ie, 1 day is from 0:00:00 - 23:59:59.
But it also supports a fixed period of arbitrary duration.
mainmind
(mainmind)
October 21, 2024, 8:02am
3
Using fixed period:
type: statistic
entity: sensor.myhouse_kwh
stat_type: change
name: House
period:
fixed_period:
start: "2024-09-21"
end: "2024-10-21"
But… with input_datetime (helpers) show error:
type: statistic
entity: sensor.myhouse_kwh
stat_type: change
name: House
period:
fixed_period:
start: "{{ states('input_datetime.selected_start')}}"
end: "{{ states('input_datetime.selected_end')}}"
Y try with:
“{{ states(‘input_datetime.selected_start’)}}”
“{{ states(‘input_datetime.selected_start’ | string)}}”
“{{states(“input_datetime.selected_start”) | as_timestamp() | timestamp_custom(‘%Y-%m-%d’)”
Showing always error:
Invalid datetime specified: {{ states(‘input_datetime.selected_start’}} for dictionary value @ data[‘fixed_period’][‘start_time’]. Got “{{ states(‘input_datetime.factura_inicio’ | string)}}”
Some suggestion?