Goal: record number of hours the Tv is ON, and display a per day chart of the previous week.
TV ON/OFF is available through media_player.living_room_tv (LG). the data is more or less already there, but i’m stumped on how to get it translated to a per day chart.
I have set up a history sensor (today) but I’m not confident in that it will give me what I want.
I already use that component elsewhere, but for some reason its not fond of me
(I just coped the exact code into an empty card and replaced the sensor)
Throwing sensor.TV_ON_Today onto a mini-graph-card that worked previously just yields a blank card.
The example is for pasting into a Lovelace file, not a UI card.
Remove the leading “-” and adjust the indentation of each line 2 spaces to the left. title should be against the left margin and the relative indentation of the lines below should remain.
So far so good, I have a graph, and it displays data. but the bars don’t group by date. instead its grouped by 2 hours
- type: 'custom:mini-graph-card'
entities:
- entity: sensor.tv_on_today
name: TV Consumption
hours_to_show: 168
aggregate_func: max
group_by: date
show:
graph: bar
Unless my eyes trick me, only the entity is different from the one in the docs.
I’m also only able to get the graph to work if its inside another control - like the swipe card in the picture - I wonder if there has been a breaking change that hasn’t been reflected in the docs yet - all the mini-graphs I have that are “standalone” are broken like this: