/pzem004t-to-emoncms

The worker reads the values from pzem004t and sends it to the EmonCMS

Primary LanguagePython

PZEM004T to EmonCMS with Raspberry Pi

Table of Contents

  1. Intro
  2. Hardware
  3. Software
  4. Example

Intro

Due to having spare parts at home, I decided to use one of my raspberry's to read the PZEM004t values and then post them to EmonCMS. It can be done in a different way, using a esp8266 shield but for this you would have to buy more pieces, you can see this alternative here: https://github.com/apreb/eNode

The worker will send for each second the Current (A) and the Power (W) to the EmonCMS. It will catch the errors and send it to the errbit (airbrake) service.

Hardware

  1. PZEM004t with serial usb cable
  2. Raspberry Pi or similar

Software

  1. EmonCMS service (it can be the emonpi)
  2. Python Packages required for the worker.py
  3. Optional airbrake or errbit service
  4. Optional OPENVPN serice with pivpn

Installation

$ pip3 install -r requirements.txt

$ clone the config_example.json to config.json and edit it

$ install the screen (apt-get install -y screen) and create a session (screen -R emonpzem)

$ python3 worker.py

Example