Having my home filled up with zwave switches and dimmers that all provide energy sensors, I thought it would be nice to have a piechart that would provide insight in the realtime power usage.
Because I already hooked up my (DSMR) energy meter to homeassistant, I could use the total amount of energy consumed as a 100% value so that I can display an ‘unkown’ part in the pie chart.
Here’s the result.
Things that can be improved:
Rendering speed: sometimes it takes a second to display the pie chart. I’m not a front-end guy and don’t know why this takes longer sometimes. Maybe something with the shadow-DOM in relation with the graph-js code. Suggestions are welcome!
You can install the card from HACS and follow instructions on my github.
- type: "custom:power-usage-card" # Mandatory
title: "Actueel stroomverbruik" # Optional customized title
total_power_usage: sensor.power_consumption # Optional total power consumption (DSMR) sensor.
# If available then other measured values will be
# substracted from total to calculate 'unknown' value.
unknownText: "Onbekend" # Optional customized unknown text. Only applicable
# with total_power_usage option enabled.
entities:
- entity: sensor.dimmer_kitchen_power # One or more entities providing Watt (W) measurements
name: Keuken # Optional customized name for entity
- entity: sensor.dimmer_garage_power
name: Garage
- entity: sensor.wall_plug_livingroom_left
name: Huiskamer links
- entity: sensor.wall_plug_livingroom_tv
name: Huiskamer TV
I guess that won’t work right now. What kind of sensors do you have that provide realtime kWh data?
I think it’s a good idea to create another view to show the current day or last 24 hour totals but I guess that will still be based on (k)W sensors, don’t you think?
Hello,
can you share how dit you manage to install?
hacs do not alow to add this repository, and like @monkey-house I did not mange it to setup manual. files seems different like in read me info.
thanks
Later edit.
in git hub page you will see another 2 forks. one of this is working to be added in hacs.
Would it be possible to remove dependency from power metering in this card, please? Ability to feed it with any raw data would make it wonderful pie chart graph, that people are begging for! I tried to to feed it with data about consumption of RAM on my ESXi server per VM and it kinda work, though colors are missing, but whole logic seems to work perfectly, including calculation of available memory!
hey! ik found that card to work nice and cleen to! Now i have a problem with the colors not showing can this be the results of hass having the update? my card is white, when i use the power card i do get colors but only when I hover over the card. Any one have the same problem? i hav W10 and Chrome. and @mirekmal l did you manege to change color of the slices?
tnx for the reply! i wil try to have a look this weekend and se if i can find the problem but im not really a coder. I love the card to bad it is not used a lot in the hass community I wil give a update if i can fix it.
Okay I just worked on it for 4 hours but I think I’m too big a noob. I have read a lot and clicked through but adjusting small things does not work. I can’t go further thought at first it was due to the import of the chart.js but now I have no idea. hopefully someone else can find the problem. when I test with the power card I do have color when I hover above it.
update:
I cleared the power-usage-card.js and then my colors load. I am now looking for color adjustment in general.