I did some survey around power metering ICs.
There are low cost power meter modules from China: PZEM-004 but their accuracy and safety is an issue. I decided to use very low cost chip from Microchip that has already support for many platforms.
There are also low cost modules available. Low cost means that it is far less expensive than Microchip devkit.
So I connected things together and started playing with software.
I didn't wanted to use software UART. Anyway, for some strange reason it didn't wanted to work.
So I modified the code to work with hardware serial port on Arduino Leonardo.
Another thing I discovered with this code is that it needs plenty of iterations to calibrate to board. First you have to flash CPU, connect load, ampmpeter, voltmeter, power meter, read values, enter into the code, flash CPU again, then read checksum that the ATM90E26 produces, put it into the code and flash again. Definitely not the way to go.

Current measurement is done using split-core transformer. I ordered different models from Aliexpress and tested one of them so far.
Voltage measurement was done via two 1M resistors connected between L and VIP, N and VIN. In this way I don't need an isolation and module can be on the safe side because leakage current is very low, far below 1mA.
I added Cayenne code and get some measurements via web application. So this approach seems to work well.

I did some survey around power metering ICs.

There are low cost power meter modules from China: PZEM-004 but their accuracy and safety is an issue. I decided to use very low cost chip from Microchip that has already support for many platforms.
There are also low cost modules available. Low cost means that it is far less expensive than Microchip devkit.
So I connected things together and started playing with software.
I didn't wanted to use software UART. Anyway, for some strange reason it didn't wanted to work.
So I modified the code to work with hardware serial port on Arduino Leonardo.
Another thing I discovered with this code is that it needs plenty of iterations to calibrate to board. First you have to flash CPU, connect load, ampmpeter, voltmeter, power meter, read values, enter into the code, flash CPU again, then read checksum that the ATM90E26 produces, put it into the code and flash again. Definitely not the way to go.
Current measurement is done using split-core transformer. I ordered different models from Aliexpress and tested one of them so far.

Voltage measurement was done via two 1M resistors connected between L and VIP, N and VIN. In this way I don't need an isolation and module can be on the safe side because leakage current is very low, far below 1mA.
I added Cayenne code and get some measurements via web application. So this approach seems to work well.