Skip to content

Read real-time energy data from smart meter and write it to an external API for processing.

Notifications You must be signed in to change notification settings

skoander/smartmeter-p1-dongle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart meter P1 Dongle

Read real-time energy data from ESMR 5.0 smart meter and write it to an external API for processing. Based on earlier work from @gejanssen.

Hardware used to read smart meter

Getting started

  1. Clone this repository
git clone https://github.com/notredamstra/smartmeter-p1-dongle
  1. Run db_setup.py to create SQLite3 database
python config/db_setup.py
  1. Create new config.py file from config.sample.py with your specific information
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
DB_NAME = "example.db" <-- Setup assumes a sqlite file located in root of project
DB_PATH = os.path.join(BASE_DIR, DB_NAME)
DB_TABLE_NAME = "snapshots" <-- Rename DB table if you think of a cooler name

# set serial port config
SERIAL_BAUDRATE = 115200 <-- This might be different for older smart meters, check the supplier documentation
SERIAL_XONXOFF = 0
SERIAL_RTSCTS = 0
SERIAL_TIMEOUT = 20
SERIAL_PORT = "/dev/ttyUSB0" <-- This depends on the USB port connected to the smart meter, check your Raspberry

# API endpoint
API_ENDPOINT = "https://example-api/v1/endpoint" <-- This setup sends energy data to an external API
  1. Run meter_listener.py as a background service. The script will continously read the P1-port on the smart meter and process the energy data.

  2. Run remote_sync.py as a background service. This script will search the SQLite database for new entries and send them to the remote API.

About

Read real-time energy data from smart meter and write it to an external API for processing.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages