I was struggling with this for a long time so thanks for the pointer. I’m using an EmonPi which supplies float value for the Wattage, so this worked a treat for me…
- platform: mqtt
name: "Garage Electric"
state_topic: "emon/emontx/power3"
device_class: power
unit_of_measurement: "W"
value_template: "{{ value | round(0,half,0) }}"
- platform: integration
source: sensor.garage_electric
name: Garage Electric kWh
unit_prefix: k
round: 2
Hi everyone, I hope I don’t post in the wrong place with this question. I have a Frient/Develco electricity meter that works very well. It reads consumption from my semi-smart energy meter that the elecrical company uses to bill me. A very nice guy just helped me to show the instantaneous power being pulled (in W) and also to make a counter that shows total minutes the power has been over a certain threshold.
What I hope to achieve is to measure the consumption in kWh of my dumb heater. I know it draws 6000W when it switches on, so I want to use this for mapping the total consumption per day/week/month/year. Figure I should use a helper, counter, template sensor or whatnot… I searched the forums, documents and search engines but I can’t figure it out. I don’t have a really good knowledge of HA yet.
Something like: “Heater switches on (power being pulled suddenly increases with 5900W) → some sensor starts reading and recording this → translates the W to kWh → sends this to the UI of HA.”
Ideally it should be the actual W being read by the smart meter, but it could also be: "Power being pulled suddenly increases with 5900W → some sensor starts reading and recording this → the sensor is using the time between the increase and when it decreases with 5900W → translates the data to kWh, given that a full hour of “increased power” is 6kWh.
It would be very very good to get this into the “official” energy dashboard, but might not be possible atm…?
I think this solution could benefit a lot of people who want to brake down total household energy usage to separate devices. Some devices are permanently installed and can’t be put in one of the various existing smart plugs, and not so rarely it’s the “heavy consumers”. So if one knows the power that their device is pulling when active, one could use this solution to measure its consumption. As long as one does not have several devices that pull about the same energy when used that is.
Would appreciate some help here!
I use hassoss core-2021.10.6, HA 6.5, on a Rpi. Deconz for zigbee.!
Esentially, it’s the spikes on this I want to measure expressed in kWh used:
you have one major issue with your idea.
The meter, which is measuring the total usage of your household cannot be used to measure single devices.
Just imagine the following situation:
your meter is constantly measuring the energy usage of your household.
If you switch your heater on - the energy usage will be increase by x watt… but what happens, if another device will be switched on - or something will be switched off at the same time.
just going for a fix amount of increased power usage does not really help getting reliable information.
The meter is ofc not able to measure single devices by default. But i’m thinking it perhaps could be made “good enough” in some situations.
As for reliability/accuracy, if this could be done, it would get reliable enough information, atleast for me and surely for other ppl with about the same household setup as me. Ie few individual devices that constantly draws the same amount of power when switched on, and if that power is fairly large (6kW in my case).
I agree that if the sensor (or what might work best) starts to measure and “record” the energy usage if it’s increased by a certain W, also will “get” any eventual devices that are switched on after the one you want to measure. That might be counter measured in code or by some other magic I’ve seen users here do. But if not, thats where my thought came in of using “time between power usage in W increased by X amount until it decreased by X amount” and then translate it into kWh.
Yes I would suggest you look at the Powercalc custom component.
I would create a binary sensor heater_on and then create an automation that flips that to true when your consumption goes over 6000W.
Then you would set up Powercalc with your binary sensor and use a manual power setting of 6000W. Powercalc will then do everything you need (and probably more!)
Of course if anything else puts your consumption over 6000W then you will have inaccuracies….
I accidentally added the total grid use sensor as single device. Even after having deleted it from that section, all graphs and statistics still fail, everything is rendered useless
Anyone else have issues adding an Iotawatt calculated output to the Energy dashboard?
I created the outputs as described in the official HA docs but HA won’t let me add the accumulated Wh entities. As far as I know they have the correct attributes.
One thing I’m thinking though is that my entities are in Wh rather than kWh… It seems the Energy dashboard might only accept kWh? Even though the HA docs don’t say we need to create a conversion for the iotawatt sensors.
Well then I have no idea why I can’t add any of the iotawatt entities to the Energy dashboard then. It’s odd because I’ve simply followed the HA docs… It was easier using the custom component
Is there a way to manually correct the data on Energy Management? I had some networks issues yesterday and my Shelly EM3 was offline and came online one yesterday and twice this morning. So my daily, weekly and monthly are quite a bit off now. See the screens:
Turned out it was caused by Shelly EM3. After restar sometimes it will be unavailable and because of that calculation that sums three phases will be 0 for a brief moment and then back to where it really was. Trick was to add availability_template to the template sensor. More here: Shelly 3EM 3-phases Energy sensor - #56 by arva
But now i need to delete those spikes and I don’t know where.
My issue was that Shelly EM was unavailable few times after restarts and template sensor that sums up three phases went to 0 and theb back to real value.
When i investigated database with SQLite Web I saw the problem with some 0 rows and sum lines that were affected. I deleted the 0 rows and corrected the SUM values with UPDATE. Now everything in DB looks good, but Energy Dashboard still shows the wrong numbers.
Any ideas, where the Energy Management gets the (wrong) data?
EDIT: If anyone is using HA in a Docker stack, SQLite Web works neatly with Docker Compose:
I have posted a new topic in community forum to suggest to add Water Heating as new source/consumption of energy on the top of Grid, Solar and Gas, for those who are connected to district heating or have solar water panel.
I am not speaking about water consumption…
see Add Water Heating as source of Energy
Hi such a problem and I can not find a solution
database - mariadb.
1.After restart, HA added the entire value of the entity to me, not just the measured hour. How to avoid it, is there a way?
2. Is it possible to remove this result from the database so as not to disturb the whole?