Discrepancy with Shelly 1PM and a Tasmota flashed plug

I have had my coffee machine connected to a Shelly 1PM on the power lead to monitor power used.
As I wasn’t happy with the results from the Shelly, ( too lower reading) I used a power adaptor plug flashed with Tasmota to compare the power difference between devices.
Here’s the results from the machine being on for 5 hours.

The machine was turned on at 7:00am and then a coffee was made just before 8:00, and another one around 10:15. The rest of the spikes show the machine maintaining the temperature. There’s such a difference in measurements indicated on both devices.

I’m trying to use a daily energy utility meter with the shelly and the daily total energy as displayed in the tasmota integration and they are around a 1kWh out between them by the end of the day.

I’m using the Shelly and Tasmota integrations in the current version of home assistant.

Any explanation why this has happened or has anyone had similar issues.

Quite easy to spot is that the update frequency of the Tasmota plug is much lower than the shelly with stock FW. :chart_with_downwards_trend:

What are the power measuring hardware/chip in each device? Are they identical? :arrows_counterclockwise:

So you are integrating the power in HA? Or do you already sum up on the device? If you utilizing HA from the tasmota power sensor directly I would expect garbage values as the update frequency is much to low for a proper power energy measurement. :put_litter_in_its_place:

If you are up for another dive I would suggest to install esphome on your device and set the update_interval for the power metering component to a very low value (like
100ms for example). At the same time you should use the Total Daily Energy Sensor — ESPHome component to have power over time directly calculated on the esphome node for the highest precision possible. :1st_place_medal:

Very interesting, thank you for that @orange-assistant

Unfortunately, that information I can’t find without breaking open the case of the plug adaptor.

I will look at flashing esphome and using the TDE sensor.

Do you or anyone know if the Shelly 1PM gen1 can be flashed using the tasmota > esphome route over wifi or if not, it may be best to flash the plug adaptor with esphome.

I guess you use a off-the-shelf product so the information should be public available without crushing your device :wink:

Should have a hlw8012 (lower end) power monitoring chip.

Yes :point_down:

Template for your Shelly 1PM can be found here :point_down:

Do you have any more information about that device? Just to know if it :banana:s and :apple:s or something else :wink:

Thank you again.

I didn’t want to chance bricking the shelly so practiced on the power adaptor first.

Ive now got the power adaptor working in esphome. Found out the adaptor uses the CSE7766 power monitor. Only thing concerns me at the moment is using the Total Daily Energy Sensor on the ESP with all that writing of data so was thinking of using the HA integration Riemann and Utility Meter?

If it would be better to use the HLW8012 in the Shelly then I’ll flash that tomorrow.

Shelly got a serial connection broken out so that one is easy un-birck-able :tada:

This one offers greater accuracy compared to a HLW8012.

What writing of data? By default if your device is esp82xx based esphome doesn’t write any data to flash if that is your concern. And if you decide to do so you can easily limit the writes to conserve the lifetime of the flash chip :muscle:

The disadvantage using a the integration in HA is that in case your esphome node is not connected for whatever reasons HA stops counting even when your plug continuous to do so.

Combine the best of the two worlds and do the integration on the esphome node but the utiltiy meters in HA - that way if connection is lost the utitilty meter will “correct” it’s state the moment your esphome node connects again.

Well, if you want to compare the capabilities of both power monitoring chips running the same firmware and update_intervals on it would make sense.

Long story short:

In your first post it looks like the tasmota plug is the less accurate device but in reality the hardware offers better power monitoring capabilities and only tasmota was the limiting factor not the hardware :bulb:

Been playing around today with various options in esphome and all seems to be working well. The graphs now are a lot different, more like I would’ve expected them to be like.

I opted for the above method in the end.

Setting this to 100ms you can see in the logs this is incredibly fast and a lot of traffic. Does this cause an issue anywhere, like with HA storing so many data points or network traffic etc.? Would 1 second or even 10 second be better or is it not really a problem. BTW I’m running on a nuc.

Network traffic in terms of significant bandwidth not so much. On the storage side on HA it can definitely has an impact as instead of only one data point per minute like in tasmota with 100ms(0.1s) their could be up to 600 data points written per minute when the values also changed that often :bar_chart:

Yes, I expect that to be the ball park for a typical productive system. :basketball_man:

By default esphome will use the same update rate for the sensor and HA but it can also be set up to have a high internal update frequency of the power metering hardware that is not exposed to HA and instead have a template sensor with a slower update interval exposed. :stopwatch:

As an example this old yaml contains something like that Washing-Machine-Sonoff-Pow-R2-Esphome/sonoff_pow_r2_w_machine.yaml at 45346dc78b8459337c46d135bbfe9c67a34641c5 · Gio-dot/Washing-Machine-Sonoff-Pow-R2-Esphome · GitHub :point_left:

Obviously the higher internal update interval serves the propose of integrating the power over time as accurate as possible (kind of the opposite what tasmota did by the looks of it). :pinching_hand:

1 Like