Several days ago I created a utility meter before realizing that I need to use the integration platform to convert from Watts to kWh.
I just created an integration name fridge_energy and restarted Home Assistant server. Based on the documentation I should have a sensor.fridge_energy but when I go to Developer Tools I don’t see sensor.fridge_energy
Did I do something wrong or is it not supposed to show up there?
I’m having trouble understanding why I would need to do that when the Integration platform specifically states it is useful for converting Watts to kWh.
" 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:
I had the integration sensor in a yaml file in the packages folder. I deleted it from that yaml and put into the sensors.yaml file and now it shows up in Developer Tools. I’ll have to see if the yaml file in the packages file has something that caused the problem.
Could you share with us, how a value template could be used right at source to convert a sensor providing power in Watt using the integration into a sensor providing kWh?
- platform: integration
source: sensor.e3dc_power_consumption
name: E3DC energy consumption
The problem I have is that the source sensor is providing a read out in W. This way my integration will provide Wh. I could define a unit_prefix of the integration to be k (kWh), but I still need to devide the overall value by 1000 and was wondering if this can be done straight in the integration sensor. This would spare another template sensor that is only there to convert my power sensor from W to kW.
Actually, after having added unit_prefix: k and monitored the energy consumption for a day, I believe it does not convert the value from Wh to kWh, but only prefixes the k, still outputting the same value So maybe I need to use an additional template sensor inbetween to convert the power consumption to kW, prior to integrating it into energy.
You are right, looking at the curve it did flatten. So it is converting correctly. It is the history that messed up the sensor. As the same sensor was used without the convertion the initial value (which was in Wh), was very large. From yesterday on it only added smaller values, as they have been calculated in kWh. I have reset the sensor to 0 and will monitor again, but I think the issue was only with myself
Really appricate the support. Thanks for your reply.
A manual reset of the value did not seem to help, the integration carried on…
Also deleting the sensor, restarting homeassistant, readding it does not seem to correctly to reset it.
is there any means to reset the sensor?
What if you were to make a new integration sensor with the name as E3DC energy then restart HA so that the integration sensor now looks like this -
- platform: integration
source: sensor.e3dc_power_consumption
name: E3DC_energy
unit_prefix: k
By doing that you should now have a sensor.E3DC_energy that will correctly have kWh that starts at 0 from the time HA is restarted. It shouldn’t matter that you have another sensor that uses the same source since it has a different name and therefore is a different sensor.