best solution to monitor and log power usage

  • My wife and I have many conversations about how much power each device in our home consumes. I would like to take the guess work out of it and monitor/log each device plugged into outlets throughout our home, using Home Assistant as the controller. What hardware (and project, if available) would provide the best solution?

  • @mrhutchinsonmn For plug in items it would be easier and cheaper to get a power meter and use that to see how much power each item uses both when in use and standby. Then simply log the hours of use to determine overall power consumption.

    I have something like this.....

  • Some Sonoff switching devices has got power metering.
    Upload ESPeasy or Tasmota firmware and connect with HA....

  • I have given my project idea some thought and believe this non-invasive current sensor is what I am looking for: I would like to capture the data from multiple devices in my home and log/graph it on my home assistant controller or something like ubidots or thingspeak. Is there a current project available that can be modified to fit , or a recommended project, elsewhere? The logging/graphing feature is what I am most interested in. I found many other solutions that only display real-time info.

  • Mod

  • Hero Member

    @kimot said in best solution to monitor and log power usage:

    Some Sonoff switching devices has got power metering.
    Upload ESPeasy or Tasmota firmware and connect with HA....

    I'm in the hunt for the same as what the OP wanted. Although there are good sensors and apps for tracking temp and humidity on a minute/minute basis, shockingly there's almost nothing on amazon offering that level of granularity for power consumption in a simple inexpensive plug-in device for appliance measurement. From what I've read, the Sonoff SONOFF POWR2 can apparently be hacked, though, as it is based on ESP8266. At $20 each it seems overpriced, but I guess that's what the market is willing to pay for it.

    There are plenty of modules on amazon that can report instantaneous power consumption, but there's no easy way to get or log that info outside the associated apps, which, as near as I can tell, are all hot garbage. For instance, I purchased a topgreener module (which I'll be returning for the reasons that follow), which is typical of what's available and which costs an average of only around $6 if you buy a set of four and which reports the instantaneous power consumption and the daily consumption to the cloud, but I see no easy way to break that information out of its smartphone app prison. Very frustrating!

    An alternative would be to build a mysensors power sensing module from scratch, using either a split core transformer or a hall effect sensor, and maybe/probably that's the least effort way to collect the data. 10 bit resolution on a 20amp ACS712 sense module equates to 20ma resolution, or about 2.2 watt resolution on 110vac mains, which is good enough for my purpose, which is to monitor the power consumption/efficiency of my two kitchen refrigerator/freezers and compare them. They seem to be running a lot more than I think they should, but the one thing I have learned from the topgreener is that they're not drawing anywhere near as much power when running as I thought they were. Well, that is, assuming the topgreener module is accurate, which is something that these days I don't think one can take for granted.

  • Hero Member

    Reporting back: There's now a way to bring sonoff devices into home assistant without having to reflash them:

    Sonoffs can work with Home Assistant without changing the Firmware! – 09:41
    — DrZzs & GrZzs

    Whether or not that includes power/energy data, I'm not sure, but I'll give it a try and report back if anyone is interested.

  • Mod

    @NeverDie have a look at which lists all devices (including power monitors) supported by tasmota. Tasmota exposes all measured data for a device through mqtt, where you can hook into.
    I'm using a number of that way.

    Tuya devices can often be flashed with without opening them.

  • Awesome! Big thx for information and link!

  • Banned

    I suggest you purchased an updated monitor in which you can get an auto logging off facility and will not harmful to your electric unit.

  • Hero Member

    This looks like an interesting alternative to the Sonoff for power monitoring:

    Also based on ESP8266, it's smaller than the Sonof. The Shelly's dimensions are just: 39 x 36 x 17mm. i.e. Small enough to fit into an outlet box. No need to open it either: the ESP8266 reset and programming female pins are exposed on the back of it, whereas it appears that the Sonoff requires you to open its case and actually solder some programming wires onto PCB pads prior to uploading new firmware to it. If you end up not liking it, I don't imagine you can return a sonoff after doing a soldering procedure like that.

  • @NeverDie While I'm still sitting on a box full of various Shelly devices waiting to be installed (hardware stores are closed since months, due to lockdown...), I'd like to point out that the Shelly 2.5 models you linked are apparently not suitable for continuous loads. Lots of peope report that they get quite hot, unlike other models. They are meant to be used for roller shutter control or other momentary loads. With that in mind, I don't think they are very useful as a power meter. Shelly has dedicated power measuring relays like the 1PM, EM, the 3-phase EM3, or Pro4 for DIN rails, as well as the WiFi plugs Plug and Plug S.

    You don't have to use their cloud service, nor do you need to reprogram them. Use their mobile app, wire them up in your favourite home automation controller or use the provided REST or MQTT APIs directly to set them up and collect data. Regarding power meter measurement intervals: at least the Shelly 1PM seems to be able to report down to a per minute scale.

    But yeah, the fact that they fit into power outlets and that you can use them freely without any external services is pretty nice.

  • Hero Member

    @BearWithBeard said in best solution to monitor and log power usage:

    Lots of peope report that they get quite hot, unlike other models.

    I did see that one of the Amazon reviews reported it as being hot (85C), but he didn't say what his load was (just that his voltage was 220v), and I didn't see other reviewers (at least on amazon) mention it being hot. It does claim to have an overtemp cutoff and a UL rating, but I haven't verified whether either claim is actually true or not. I'd be using it to monitor a refrigerator/freezer, whose boilerplate says it's rated to draw 700w max.... That's less than half of what of what this Shelly is spec'd for....

    I suppose I could just try it and see, but instead I cancelled my order until I can get to the bottom of it.

  • Hero Member

    OK, I found both the problem description and also, allegedly, a fix for the Shelly 2.5 hotness. TL;DR: if you leave GPIO16 floating, then it sounds as though Shelly 2.5 will experience a partial short circuit and heat up to 62C, but if you simply configure GPIO16 as an input, it will, allegedly, avoid that problem and run at 15C instead! Well, I'm guessing that by 15C the blogger in the following link, which is where I got my information, means ambient temperature., or thereabouts:

    So, with that now sorted, I re-submitted my order. 🙂 I'd sleep better if the hardware had been designed to guarantee that such a problem could never occur, rather than allow a potential software bug to trigger it, but it is what it is. Hopefuly the UL certification is genuine, because their failsafe testing is even more important for a device harboring a potential hazard such as this. You never know if or when a lightning bolt or voltage spike (or cosmic ray for that matter!) might glitch it out. Perhaps, just to remove all doubts, it should be encased in intumescent putty inside the electrical box.... One could argue that it would/might be overkill, but aside from the sticky mess and the extra cost, I'm not aware of any other downsides to doing so. Plainly the alternative of planting it inside a full metal junction box to secure improved protection from Murphy's Law would defeat the whole reason for installing it in the first place. On the other hand, I seem to recall that even regular outlet boxes are tested to meet at least minimum performance standards and are therefore probably safe enough to contain a failure should one occur. After all, AFAIK, that's much if not their entire raison d'etre.

    @BearWithBeard Thanks for the heads up!

  • @NeverDie Interesting find. But according to this GitHub issue, that fix only concerns those Shellys that have been flashed with certain versions of Tasmota or ESPhome, where the GPIOs had been misconfigured. To me, that sounds like it was an issue on top of the inherently higher temperature of the Shelly 2.5, doesn't it? I assumed the Shelly 2.5 temperatures were higher because of the second power metering circuit on board, potentially dissipating more heat through resistors.

    Anyway - you are right that the Shellys have over-temperature protection which should kick in at 90 to 95°C and I can only assume that all components are rated for temperatures above that. So in that regard it should be fine if the Shelly 2.5 operates at higher temperatures than the other models. The device is completely encased, which lowers the risk of scorching wire insulations or terminals with lower temperature ratings that might touch it.

    It may just be that it triggers the OTP earlier than single channel Shellys when two (high?) loads are connected. Then again, installing two single channel Shellys in a single power outlet could potentially be even worse, as you then have two heat-emitting devices in close proximity. Giving it a try may be the only way to find out.

  • Hero Member

    @BearWithBeard One of the posts in the github you linked seemed to imply that much of the regular heat comes from the energized relay coil. I'm hoping it has an NC contact on the relay, since all I want to do is monitor energy consumption. I have no interest in switching it on and off, and for my use-case I'd rather it didn't even have switching capability. I can't tell from the cryptic markings on the case though whether it has an NC or not, but if it does, then hopefully much of the heat can be avoided, since the relay wouldn't need to be energized.

    [Edit: I found the manual. Regrettably, it has no NC contact: ]

    One good bit of news: Looks as though it really does have a UL listing:

    At least that much is promising.

  • @NeverDie Oh, if you refer to the second set of infrared images - those with the relay as the hottest spot - they are taken from a Sonoff Basic. The other set is the Shelly 2.5.

    In the meantime, I found some images of Shelly 2.5 with burnt spots and antennas pierced by the screw terminal pins. Reports of bad solder joints and such (German source with images). It seems that this was a faulty batch of devices from early 2019 which has been recalled. Never the less, I just opened the enclosure of my two Shelly 2.5 and I can confirm that they are obviously of a newer revision (bought in december 2020. the PCB was produced in July 2020, according to the silkscreen). The antenna is now attached to the upper part of the enclosure so that it can't be pierced by the pins and the cable is not touching the resistor R42 that is getting so hot in the FLIR images, although it's routed around the PCB in that corner. All pads and terminals look clean and nicely soldered.

    The relays are 10A 250VAC rated HF32FA-G/012-HSL1 models.

  • Hero Member

    @BearWithBeard It's all so ironic: my whole reason for buying something pre-made was to just slot something in without having to think about it. Now, with the cloud of doubt hanging over this thing, here I am having to spend time thinking about it. 🙄

    For my intended purpose the ideal solution is probably something like this: Even if it were to fail, it's all just low power low voltage stuff and my refrigerator would keep on working, as there's no on-off switching like with the commercially available pre-made products. No direct connection to mains, and no batteries to change either: it lives by soaking up just a tiny amount of parasitic power. I should probably just do it right the first time, and then I can just be done with it without having to worry about my refrigerator losing power, or whatever else might go wrong as it ages over a long future.

  • Hero Member

    What no one seems to mention but which certainly seems relevant is that the working temperature range for the Shelly 2.5 tops out at 40C:

    Does "working temperature" mean ambient temperature, or the temperature of the device itself? I'm not sure, but I believe it refers to the temperature of the device and the components therein, not ambient temperature. And if that is so, then looking at all the measurements people have done:
    it seems as though many of those measurements are above Shelly 2.5's own declared spec.

  • @NeverDie Working temperature means ambient in this case. Quoting the Allterco CEO:

    Max ambient temperature is 40 degree. With no load PCB temperature is 55-60 degree. At MAX load continuesly is 87-90 degree.
    Heating protection will switch off device at 95 degree.
    All parts inside are 105-120 degree certifed for continuous usage.

    Original source:

  • Hero Member

    Aha, good catch.

    I presume it's just measuring apparent power instead of real (true) power? Power factor is going to be relevant for a refrigerator. The Shelly 2.5 makes no mention of measuring power factor or true power, but the more pricey Shelly EM does:

  • Hero Member

    These peacefair energy monitors are fairly inexpensive and also appear to measure power factor:
    Fast review Meter PZEM-016 Modbus RTU RS485 with frequency y Power Factor: PDAControl – 05:29
    — PDAControl

    They use RS485 for communication.

    Aside from that, it's not easy to find a power meter that takes power factor into account and which has anything other than just an LCD for its output interface.

  • @NeverDie The power metering IC is an ADE7953 that can measure active, reactive, and apparent energy.

    The API states that it measures real power in the description:

    power | number | Current real AC power being drawn, in Watts

  • Hero Member

    This suddenly makes the Shelly 2.5 a whole lot more interesting! Do we know whether the Shelly 2.5 reports real power by default out-of-the-box, or does it require special configuration?

  • Hero Member

    Hmmm.. Apparently even the sonoff POW R2 can measure real power and power factor:

    Well, either the Sonoff or the Shelly 2.5 sound much easier to work with than the PeaceFair. I guess it's time I try them out! I can compare their measurements to my ancient kill-a-watt meter, which supposedly measures true power also, literally plug and play.

  • Nice one, thx!

  • Hero Member

    Found this Sonof IW100:

    If it measures real power, then it should be code compliant, easier to wire, and maybe safer overall, so I ordered one to test. It's ETL certified, which as far as I can tell is just as good as UL Certified, since ETL tests to the same standards as UL. I've also read it uses the same hardware as the Sonoff S31.

  • Mod

    @NeverDie IW100 uses the CS7598, according to
    You'll be alright!

  • Hero Member

    I hadn't known this before, but from recent reading it appears that relays are appropriate for switching resistive loads, but for inductive loads (like motors) a "contactor" is recommended instead. Apparently the reason is that opening a relay on an inductive load can cause voltages to jump beyond the relay's rating, resulting in arcing. Well, I suppose that does make sense. In contrast, from what little I've read, contactors are resistant to arcing.

    On the other hand, I thought the use of flywheel diodes was supposed to prevent these kinds of inductive voltage spikes, in which case I don't see what the problem is. Maybe there is no equivalent of a flywheel diode for an AC motor as there is for a DC motor? Not sure, but on first glance it looks as though it may require a snubber or similar:

    So, in principle it is possible, but I don't know whether sonoff's or similar account for that or not.

    Hmmm.. It's starting to look as though the Shelly EM may be the only sure-fire KISS solution for monitoring refrigerators, as there is no risk of it opening/closing relays, which is something I don't need and, if anything, would rather avoid anyway.

    Sorry for all my dithering on this thread, but by process of elimination I think I've may have finally arrived at a correct answer. Hopefully it's illuminating for others as well.

  • Mod

    @NeverDie If you only want to monitor and are worried about relays you could always open the shelly/sonoff/... and permanently shortcut/bypass the relay. And while you're at it, also disconnect the relay coil contacts (or remove the relay completely) to reduce heating of the unit and reduce power consumption.

  • Roll your own MySensors version can be surprisingly simple from a hardware perspective. I did this to monitor my electric car. Plug a split coil to the audio jack:


    The thinking about it part, not so easy! Good reference site:

    C and R depend on your split coil. Calibration is a real challenge. For my car, I know what it draws from plugging into commercial chargers, and I was not worried about precision. For unknown loads around the house, you would have to have something known to calibrate against. Also, the coil has to go around 1 leg of the power wiring. which means you need an adapter cable with the line and neutral split out (but still insulated).

  • Hero Member

    @nagelc said in best solution to monitor and log power usage:

    Plug a split coil to the audio jack:

    @nagelc What?! You're doing some kind of energy monitoring by plugging a split core to the audio jack of your electric car? I know you're a smart guy, but I just don't understand how that could work, even in principle--unless you were charging your car through your audio jack, and surely that can't be. What are you even measuring?

    Wait a minute. Are you referring to a real car, or a toy car?

  • Oops. I wasn't very clear.
    My split coil has a cable with an audio plug on the end. Like this one:
    So I used an audio jack on the board to plug the split coil into. That makes it easy to swap different rating coils. The picture above is 100A, but I'm using the 30A coil for the car charger.
    Then the coil goes around one of the power wires going out to the charger.
    A real car : )

  • Hero Member

    Reporting back: After watching some youtube reviews, I decided to settle on the Emporia Smart Home Energy monitor:

    The above reviewer had also done a teardown review of the Gen 1 version, where he was very vocal about the things he didn't like, and the manufacturer wrote a very thoughtful multi-paragraph response to his video to explain why it was that way and why Gen 2 would be better. I had originally dismissed it because some of the prominent amazon reviews had called it inaccurate, but the current offering is the second generation, and one of the youtubers compared the Gen2 measurements to his power bill and found it to be accurate to within 1% of what his utility company billed him.

  • Nice video, i will think about it too

  • Hero Member

    Reporting back: I installed the Gen2 Emporia Vue, and it "just works" on the first try. Ironically, it reports the same amount of power for my refrigerator as the far less expensive TopGreener power module, so I guess the TopGreener is more accurate than what I had thought. At least the Emporia Vue's built in graphing is far superior and involves no switching, so overall I'm glad I made the upgrade. 🙂

Log in to reply

Suggested Topics

  • 3
  • 7
  • 9
  • 7
  • 15
  • 5
  • 9
  • 3