[ESP32] Sonoff POWR316D energy meter with display - firmware change

Today I am presenting a rather unusual Sonoff energy meter, which is distinguished by the fact that in addition to sharing measurements via a mobile application, it also displays them on an LCD display. This allows you to quickly check how much electricity and energy the connected device consumes without reaching for your phone. Here, of course, I will also focus on changing its firmware, I will upload Tasmota so that it can be connected to Home Assistant, and at the same time I will analyze its structure.
Purchase Sonoff POWR316D
A friend of mine gave me the Sonoff set so I could upload the firmware. My friend simply doesn't know anything about electronics and doesn't even have soldering equipment, but for me the equipment was included in the review. However, I know that it was bought in a Polish mail order store, you can search for it by name Sonoff POWR316D Elite16A WiFi smart POWER MEASUREMENT R3 : :

Let's quote the product description:

By default, the device uses the eWeLink application:

Specifications and dimensions:

Let's see what we get in practice:





The set does not include screws, but includes the module itself and a plastic hook/mounting mat:


Instruction:








A short test without changing the firmware
To test, I connected an old lamp:



The display is not very readable, but it does its job. It alternately shows voltage, power, current and also the sum of consumed electricity, the counter of which can be reset in the application. Quite comfortable!
We look inside
Let's unscrew the screws. You can already see the transformer inside, there is probably a small impulse converter there, as well as some poor filters at the power input, this time there is probably even a varistor and a capacitor:



After unscrewing the screws, you can remove the board:


The display is controlled by TM1621:

The heart of the device is ESP32, on the PCB right next to it you can also see SPI Flash memory with the program and a programming connector with RX and TX, I will mention IO0 later.

The integrated circuit at L4 looks like a step down converter to me, it probably provides 3.3V for ESP:

The CSE7759B is responsible for energy measurement:

The main power supply is based on LP3667:

The high-current paths are additionally tinned, the photo also shows a resistor with a tolerance of 1% - shunt:

POWR316D firmware change
The device is based on ESP32, you can upload Tasmota, either via esptool.py or via the online installer:
How to easily install Tasmota - online installer tasmota.github.io/install via a web browser
This time we solder four wires, power supply (3.3V), ground, RX and TX:

IO0 is output to the button, so to enter the bootloader mode we must first press this button and then connect the power supply (3.3V power supply)
Of course, we perform all flashing operations away from the 230V network, everything must be completely disconnected, but this is rather obvious, as always.
I decided to use esptool.py because I always backup the firmware:

Then I loaded Tasmota:

I found the template ready on the Blakadder website:
{"NAME":"Sonoff POWR316D","GPIO":[32,0,0,0,0,576,0,0,0,224,9280,0,3104,0,320,0,0,0,0,0,0,9184,9248,9216,0,0,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":1}
Uploading:

After activation:


The display also works:




After changing the firmware, the device requires calibration:
https://tasmota.github.io/docs/Power-Monitoring-Calibration/
Summary
A very cool gadget. The price is slightly higher than in the case of regular smart sockets with energy measurement, but in exchange we get a display, which in my opinion is more convenient than constantly reaching for the phone or web browser to check the measurements in Home Assistant. In general, it's hard for me to get used to the phone and I much prefer gadgets that also work without WiFi, such as this energy meter from the topic or, for example, an LED strip controller with a button (as opposed to LED strip controllers without buttons - yes, such are on sale, and then the WiFi runs out and you can't turn on the lights...). To sum up, for me this gadget is worth attention.
Does anyone use these types of Sonoff products? I invite you to share your impressions.
Comments
A very interesting device due to its display. The price is also quite decent. I found something similar: Link . I wonder if it's not even the same display. [Read more]
It is tempting to check the measurement accuracy, especially for non-linear loads and PF [Read more]
Does anyone know how to control it themselves - without Tasmota ? Any API etc ? Because I'm struggling for the second day and it's lame. [Read more]
What exactly is the ESP32 chip in this device? [Read more]