hi @ all, mey someone help me:
the sensor in pic was imported by a scrape,
HA write sensor states in database with today timestamp but sensor’s stases refer to tomorrow,
I need to add 1 day to that timestamp (but is impossible in HA), can I mod X axis to display +1 day?
Hi. I have a display bug with line charts. First, the first data of the day doesn’t show and then tooltip box show only one information point for one line, normally the information of all the line will be show in the same tooltip.
EDIT : When I am in “Dashboard Edit” I have no bug. But when I exit “Dashboard edit”, so in normal, the bug is here.
Got it (RTFM).
Group By features a methods as delta or diff, which give exactly what you want in such situation for total_increasing sensors, respectively:
Will return the delta between the biggest and smallest state in each bucket
Will return the difference between the last and the first entry in the bucket
(as for utility meters you have ever increasing values, so both functions are identical for this use case)
So what I have is now just
hi @benm7 im with @Airyphyla on this. However the code/link you’re referring too doesn’t help me too much. I struggle getting everything right, and the example doesn’t seem to have the doughnut thingy on the right. My skills are not sufficient to make something similar myself. Could you paste your code so i can copy/paste it into my setup? Heck, ill buy you a coffee
Can the transform function return the result of sensor.hive_heating_reported_target_temp for the same point in time? This would result in the grey areas only going as high as the top of the green area. It would also be great if the !='heating' result was the y-axis min, but that’s secondary.
I have tried the following but the graph will not render.
transform: "return x === 'heating' ? states['sensor.hive_heating_reported_target_temp'].state : 5;"
Thanks.
Edit:
So - typically - as soon as I posted the above, I saw what I think is the answer in the docs:
Your javascript code will receive:
x: a state or a value of the attribute if you defined one (it can be a string, null or a number depending on the entity type you’ve assigned)
hass: the full hass object (hass.states['other.entity'] to get the state object of another entity for eg.)
entity: the full state object of the entity from the history entry currently being transformed
So I wrote this:
transform: "return x === 'heating' ? hass.states['sensor.hive_heating_reported_target_temp'] : 5;"
…but nothing renders (for that sensor).
Edit 2:
A bit of a wild guess, but I added .state to the end as follows:
transform: "return x === 'heating' ? hass.states['sensor.hive_heating_reported_target_temp'].state : 5;"
Just in case this helps anyone, I think I’ve figured out a way of making this graph display what I want. I don’t fully understand why this is working but so far so good!
I can only get this working with Group_By and not Statistics; I noticed that playing around with the duration started making all the X-axis labels for all days of the week show (including today). If I set the duration to 1d, then the current day label was missing. Setting the Func to Max and duration to 23h59m59s has sorted this out. The max value of this sensor for each day is always going to be the maximum amount of energy used and configuring the duration like this still seems to work out the usage per day as accurately as it did when setting it to 1d. My assumption is that because “today’s” usage isn’t complete yet, i.e. there isn’t 1 day’s worth of data yet, it hid the X-axis label. I don’t know why setting it to 23h59m59s works though! If anyone can shed light on that, it’d be good to understand better
Im trying to record the amount and duration of times that my boiler is heating our house. However, im stuck, i need a second pair of eyes on this because im unable to generate data here.
you’re using a binary_sensor which can only ever be ‘on’ or ‘off’. You’'ll need to use the transform function to change ‘on’ into ‘1’ and ‘off’ into ‘0’. Take a look at my post above where I am doing exactly the same thing.