Dear Community, I have several power plugs that already track the consumption of my devices. Now I was wondering what is the best way to get devices into the energy dashboard if only the daily consumption is known. As an example my refrigerator. This one consumes 1.29 kW/h per day. What is the smartest way to integrate this? I have already created a helper and typed in the 1.29 - but how to proceed? Do I need a “utility meter”? Something like this or is it completly wrong?
utility_meter:
daily_energy_refrigerator:
source: input_number.energy_refrigerator
name: Daily Energy Refrigerator
cycle: daily
Hi Tom, thank you for your answer! I was thinking more of something without a “custom_components” to just stick to the default as much as possible. How else would you implement it in HA?
Oh, that’s very sad. I thought I would not be alone with my problem. But is it so fancy to implement my requirements in the standard HA? I can not believe that nobody has had the same problem… everyone has installed HACS or a custom-component?
I’m doing something similar withe devices that have a constant power consumption.
I add them all together but I’m sure you could adapt this.
I have a template sensor for the power. It updates every minute because the state attribute changes.
Hi everyone,
I want to share now my solution because this is the easiest way to implement it I guess:
template:
- sensor:
- name: "Refrigerator Energy"
unit_of_measurement: "kWh"
state_class: total_increasing
device_class: energy
state: >
{% set kwh_per_minute = states("input_number.energy_refrigerator") | float /24 /60 %}
{% set minutes = now().minute | int %}
{% set hours = now().hour | int %}
{% set kwh_diff = ((kwh_per_minute * minutes) + (kwh_per_minute * 60 * hours)) | round(6) %}
{{ kwh_diff }}
My input helper is the day consumption for my refrigerator. That’s it. I added also a daily utility meter to have a persistence. To calculate the value via minutes and hours will help when you restart HA. What do you think?