My integration sensor named sensor.office_energy shows Wh instead of kWh. I am using a Zigbee plug that provides a constant W measurement. The documentation of the integration sensor states that if the device provides a power reading in W that the integration sensor will provide a readout in kWh. As I am writing this I am using 116 W through the Zigbee plug. I don’t have any high current devices connected to it. They are a PC, printer, RPi4, phone charger, and speakers. So I never use a whole kWh in any hourly period. Since I use about 230 Wh the integration sensor seems to assume that there device is reporting kW and doesn’t have to divide by 1000 to give me 0.230 kWh. Is this a bug with integration sensor ? Does documentation need to be updated to correct this error? How do I fix this so that sensor.office_energy reports the kWh correctly? This error affects the utility meter since it expects the source to be in kWh.
I am also using an Aotec Zwave Smart Switch 6 that has readings for voltage, current, power and energy. It is connected to the living room entertainment center. The voltage shows to be 124.15 V. The current shows 1 A. The power shows 137.02 W. For some weird reason the device itself shows 238.54 kWh. Since energy measured in W is voltage x current which in this case is 124.15 x 1 then the W is 124 W I can accept the 137.02 W. However, the kWh is way off. What gives?
So why does the documentation say the following? Does the documentation need to be updated?
Energy
An integration sensor is quite useful in energy billing scenarios since energy is generally billed in kWh and many sensors provide power in W (Watts).
If you have a sensor that provides you with power readings in Watts (uses W as unit_of_measurement ), then you can use the integration sensor to track how much energy is being spent. Take the next configuration as an example:
So why is my integration sensor not reporting correctly if we basically have the same setup? Is there something else in my HA setup that messes up the calculation?
I have also recently created a integration sensor for the same purpose. Initially without the prefix and the sensor reported Wh. I have updated the sensor, it is now correctly stating kWh, but I believe it took some time and maybe a reboot to be correct. Unfortunately there is no way to reset the integration, so it is showing a huge number now.
I am more concerned about the number than the displayed prefix. I can easily ignore the prefix. The number is what I need to be accurate.
I guess I will have to live with data and add a division by 1000 in the value template that the utility meter feeds. I guess the band aid is my only option.
Yes, but I think that T1ppes pointed to the likely cause. It seems that the integration sensor doesn’t start reporting a lower number when it is edited with unit_prefix: k So I guess I didn’t always have unit_prefix: k and was so long ago that I added it that I initially thought that I always had it.
Now I am really confused. The utility meter office_kwh_energy_hourly reports correctly even though the integration sensor does not. Since utility meter uses the integration sensor as a source I figured it would show the amount with the decimal in the wrong location but it does not. So I don’t need to adjust my value template after all.
I knew you had a small error in your understanding.
Watts are the measure of the instantaneous power that you are using right now. it’s calculated by volts x current (basically, ignoring the power factor)
Watthours are the measure of how much energy you have used over time. It’s calculated by watts x hours
1 kwh = 1000 watts for 1 hour
So if you are using 137 watts and that is constant for 1 hour then you would have used 137 wh or .137kwh.
And if you maintained that power consumption for the next hour you would have used a total of .274 kwh.
If you want to delete a thread, flag the post. Don’t change the title. Also, why do you want to delete this when others can find the information useful?
I’m surprised that the thread could be found useful. I feel it is too simple a problem that almost no one else would jump to the conclusion that I did. I just wasn’t thinking clearly until I realized that the integration sensor is cumulative.
If one (you) can make that “mistake”, anyone could do so as well…
In Germany we have a saying: “No one is useless, he can always be a bad example!”
Just leave it, it will help someone, I’m 100% sure. And don’t take it personally, HA can be complicated, and it is always better to ask, then going further without knowing. The most dangerous people are the ones, that don’t ask.
Hi, Im pulling my hair out over something that I know when I find the answer I will feel silly but here goes:
I have two sensor values, one is in Wh and the other is in kWh. I want to add the two values together to be a sensor ‘solcast_latest_today_forecast’ value. Here is my yaml:
This gives me the wrong total value, lets say that sensor #1 has a value of 18,820 Wh and sensor #2 has a value of 0.03kWh. Then with the above is get a total value of 18,820.03 rather than 18,850 Wh (or 18.82kWh). The numbers get bigger at the start of the day for the Solar forecast so this seemingly small difference will make big errors at other times.
I have tried many versions of the above value_template to ‘/ 1000’ the Wh value and then ‘* 1000’ the kWh value in my attempts to normalise the two values, I can get it and I would really appreciate some help on this probably silly little thing.