A simple smartmeter based on ESP32. Supports the complete setup via web interface, MQTT and live monitoring via web interface.
Clone this repository and open it with platformIO. Remember, the SPIFF must also be flashed. On a terminal in vscode you can do it with
pio run -t uploadfs
pio run -t uploadAfter that, take a look at your monitorport ...
Read config from SPIFFS
scan for SSID "" ... not found
starting Wifi-AP with SSID "powermeter_aadee0"
AP IP address: 192.168.4.1
Start Main Task on Core: 1
Start NTP Task on Core: 1
Start Measurement Task on Core: 0
Start MQTT-Client on Core: 1
Start Webserver on Core: 1
NTP-client: renew time
Start OTA Task on Core: 1
Failed to obtain time
NTP-client: Thursday, January 01 1970 01:00:07
When the output look like this, congratulation!
After the first start an access point will be opened with an unique name like
powermeter_XXXXXand an not so unique password
powermeterAfter that you can configure the powermeter under the following IP-address with your favorite webbrowser
http://192.168.4.1 or powermeter_xxxxxx.localPlease pay attention to the Burden resistor. Some current sensors have a built-in Burden resistor. In this example a SCT-013-000 without a built-in Burden resistor was used. Please check the documentation for the right Burden resistor value.
At any time, 3 channels are read in simultaneously regardless of the settings. The individual power of each channel is calculated and the power of all channels together. If 3 channels are set, an additional virtual fourth channel is calculated with the sum of all currents. This enables us to measure the neutral conductor current indirectly. For more information about how three-phase current works, read here!
Every Contribution to this repository is highly welcome! Don't fear to create pull requests which enhance or fix the project, you are going to help everybody.
If you want to donate to the author then you can buy me a coffee.