Hi,
I made some progress with variables. As suggested, I’m using mini-graph-card wrapped with config-template-card. This is my variable “graph_hours” which calculates difference from two timestamp values in hours:
You misunderstood me.
The config-template-card accepts JS code in templates.
The code you posted looks like a HA template extension code. That is why I asked you is it a JS code.
I’m new in HA, so can you please assist me, how to check, if it’s JS code?
If this can help:
to checking calculated value, I also add the same formula (now().timestamp()-1643324400)/3600 into style parameter which successfully displays value in corner of mini graph card.
There is no style parameter inside the mini-graph-card.
Probably you mean card-mod style - then it is not JS, it is jinjia2 + HA template extension.
You need to find a JS analogue function for now().timestamp().
But the part (extrema) is as big as temperature. How and which part do I need to change to make the extrema smaller? I’ve got card-mod installed but I cant find the right div to alter.
The second one is statistic graph card with 31 days to show:
type: statistics-graph
entities:
- sensor.shellyem3_c45bbe6a86e2_channel_b_current
days_to_show: 31
stat_types:
- max
chart_type: line
On date 13.2.2022, the statistics graph card shows data from 28.2.2022 (date when sensor is added), but mini graph cards shows data from 3.2.2022 (last 10 days) which means that max value is not calculated from beginning but only from last 10 days.
Is it possible to set mini graph card to display all data from day, when sensor s added to HA?
Is it possible to set the displayed state to the (last) diff calculation? the bar-graph is showing the diff between readings (group by date) but the state is always showing the whole sensor reading. I want to display the last diff state there. Just the same when you hover on the graph :
For my understading the entity wz_h should not be shown?
(but how then get the last value?)
That’s why an other question - could it be possible to show a second value permanent at the right side? Then we could display as sample temperature / humidity values and show one or both graphs below
Last question - the time format - could it be taken from HA config? Or can I modify it?
(I’m not using AM/PM but the 24hour format …)