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.
- Add plugin .js as a module:
- url: /local/lovelace-graph-card.js type: module
- Add lovelace card to view:
- 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