Good morning.
Sad, isn’t it? All these men (it’s usually men) sitting up into the small hours… Still, enough of that.
I use a HACS integration called Powercalc to monitor all my energy usage. You probably know it already - I’m sure you could get the same results with “official” methods, but Powercalc is much more compact and easy to maintain, and you can use estimated figures if you don’t have enough smart plugs. The docs are pretty thorough.
An annotated example. Say I want to monitor what I’m spending on the smart home… These devices all use power at a steady rate. Part of my configuration.yaml looks like this:
- platform: powercalc
create_group: smarthome # Groups devices together to give total energy usage
entities:
- entity_id: input_boolean.echo_dot # The entity to monitor.These devices are on all the time, so an input_boolean (always on) does the job.
fixed:
power: 1.7 # I don't want to spend a fortune on smart power monitoring plugs. This is the estimated wattage of the device from the manufacturer's docs.
multiply_factor: 5 # I have five echo dots.
- entity_id: input_boolean.hue_hub
fixed:
power: 1.5
- entity_id: input_boolean.lightwave_hub
fixed:
power: 1.5
- entity_id: input_boolean.home_assistant
fixed:
power: 4
- entity_id: input_boolean.broadlink
fixed:
power: 5
multiply_factor: 3
For my computers, I do have smart plugs, since their power consumption is irregular and they may be switched off:
- platform: powercalc
create_group: computers
entities:
# Dell
- entity_id: switch.tasmota_10
power_sensor_id: sensor.tasmota_10_energy_power
# Acer
- entity_id: switch.tasmota_15
power_sensor_id: sensor.tasmota_15_energy_power
# Laptop
- entity_id: switch.tasmota_17
power_sensor_id: sensor.tasmota_17_energy_power
Powercalc creates virtual power sensors (Watts) and virtual energy sensors (kWh) for each group, in this case:
sensor.smarthome_power (Watts)
sensor.smarthome_energy (kWh)
sensor.computers_power (Watts)
sensor.computers_energy (kWh)
It also has a utility meter function, which gives you more sensors to record energy usage on a daily, weekly or monthly cycle, in this case:
sensor.smarthome_energy_monthly
sensor.computers_energy_monthly
These give you the figures that you can see ticking up in a dashboard entities card. (I should warn you, though, that for most devices it’s like watching paint dry…).
To get costs, I have a set of templates:
- sensor:
- name: "smarthome monthly"
state: '{{ (states("sensor.smarthome_energy_monthly")| float(0) * states("input_number.electricity_rate")| float(0) / 100) | round (2) }}'
device_class: monetary
state_class: total_increasing
unit_of_measurement: "£"
icon: mdi:home
input_number.electricity_rate comes from my electricity bill (currently 32.6460 pence per kWh).
Hope this makes sense. I haven’t done much work on the dashboard itself. You can get a feel for comparative energy usage in the home with HACS cards like Lovelace power usage graph card with regular expressions.
This updates in real time, but it doesn’t store any data. Clicking on a segment gives you the total usage since the card was installed. Again, the data come from Powercalc.