Disclaimer

Please, proceed carefully following the tips published in this blog, specially when Main Power is involved. I'm not responsible for any damages caused by what is written in this blog.
Thank you

Friday, 5 October 2018

Home Automation System - Two PZEM-004T and a single ESP8266




After my successful experiments with the PZEM-004T and a Nodemcu ESP8266 aim to monitor power consumption (devices are actually working well in my ground floor power monitoring system, see https://domoticsduino.blogspot.com/2018/05/home-automation-system-energy.html), I decided to update my photovoltaic production monitoring system, actually based on a Wifi 433Mhz receiver (see https://domoticsduino.blogspot.com/2017/08/home-automation-system-mqtt-and-rf433.html).

Actual system has a problem due to an invalid read of power values when the inverter is switched off. In fact it gives me about 250W power production...

My idea is to use the same devices used for the ground floor power monitoring system...so a PZEM-004T and a Nodemcu ESP8266.

These are the devices:

NODEMCU ESP8266

PZEM-004T

Because my inverter is near the electrical panel in the garage, I decided to let the things more complicated adding another PZEM-004T to also monitor the basement consumption with the same ESP8266.

Then I added also a temperature and humidity sensor to the same circuit.

My following step was to check that a single NODEMCU ESP8266 was able to control both PZEM-004T...My tests were successful

Here is it my first PZEM-004T linked to the main output cable of the inverter...on the right you can see the DHT11, temperature and humidity sensor (it's a not so accurate sensor, but it's right for my kind of measurement...)


This is the second PZEM-004T, linked to the main cable of basement power, inside the electrical panel


Complete view:


Now it's time to write the software and test it.

I decided names for the MQTT topics and I created items and sitemap objects for OpenHAB

This is what we could see in my OpenHAB BASIC UI



Energy Consumption value is the sum of all the sensor power (2 of them are already running)
Values are different related to the previous screenshot because they continuously change


Last step: I created some charts in the Grafana dashboard


My primary target was reached: my production monitor give about 0W when the inverter is switched off