Solar install, part 2 (tasmota/shelly EM)

Read part 1 for more background. See my blog on power monitoring.

I installed monitoring for power usage a few months ago. This is using Shelly EM power monitoring modules with current clamps, reflashed with tasmota code. It works well, I have some nice graphing stuff (all on GitHub).

Now I have the solar panels I have to allow for "negative" power flow, i.e. exporting to the grid.

Sadly it did not work, and my googling did not help. I raised a question, and apparently this has come up before #15315#12861, and a merge #12874, great. So the current code should handle the ADE7953 sign bits and do negative power.

The problem was that I was not seeing negative values at all, so my graphing is all messed up as all export shows as import. Very frustrating. I even went to building tasmota code myself, and no joy.

However, I found a clue, in the later source code (after that merge), it has a model flag to indicate if Shelly 2.5 or Shelly EM, and it only does the negative power on the Shelly EM. This has to be a clue.

I tried the config template from the code, and nothing happened. Still not working. After a lot more reading of the code I worked out the issue.

It is subtle, but the "2" next to the ADE7953_IRQ, rather than "1" seems to be the trick here. Of course, changing to "2" did not fix it - because I was exporting AND I had the clamp backwards so still seeing +ve (import) figures only. Fixing the clamp as well, and now it looks good.

Now I have graphs that show negative (export) power, at last. I have to tweak my graphing code to allow for that next...

And yes, the sun is shining a bit now...

Part 3


  1. Hi Revk, I am using my Shelly EM with the original firmware, my intention to move to tasmota is to be able to directly see the I and the P Q S values.

    Did you update via OTA? over here https://github.com/yaourdt/mgos-to-tasmota

    Have you tried going back to the original firmware?

    Thanks for your help.

    1. I used a serial lead, https://github.com/revk/Shelly-Tasmotizer-PCB
      I have not tried going back, no.


Comments are moderated purely to filter out obvious spam, but it means they may not show immediately.


As some of you know I use JLCPCB a lot for my PCBs. Why not UK? We do use UK manufacturers for our FireBrick products, but for the small che...