Skip to content

Simple Python script to push readings from a Homewizard WiFi P1 meter to a Postgres database, for usage in e.g. Grafana. Watch your wallet drain!

Notifications You must be signed in to change notification settings

coderiekelt/P1Nuts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

P1Nuts

A simple Python tool to read data from a Homewizard P1 WiFi meter. The data is stored in a Postgres database for visualization in Grafana.

Setup

Modify docker-compose.yaml, change METER_HOST to the IP address of your P1 meter. It's recommended to assign a fixed address to the P1 meter so you don't have to come back and change this later :')

Run docker compose up -d and you should be good to go!

You may also want to modify pginit/init.sql with some initial values:

  • The values of public.p1_tariff, the order is as followed: tariff 1 (low tariff for me), tariff 2 (high tariff for me), gas tariff, UTC time at which the tariffs apply.
  • Do not modify public.p1_meta! The script will populate this as it does it's thing.

Unsure of which tariffs apply to you? Head over to http://<METER_HOST>/api/v1/data, check out active_tariff to see which tariff is currently active.

Accessing data

Since this script runs in a Docker container on the server Grafana also runs on, I added it to the grafana network (which is external.)

You may want to change things around, but by default these are the settings to add the database to Grafana:

  • Host URL: p1nuts-postgres
  • Database name: p1nuts
  • Username: postgres
  • Password: koekjes
  • TLS/SSL Mode: disable
  • Version: 15

You can also tinker around with the database, by default it's exposed to port 5509.

Your code is crap!

I know, this was hastily written to get something working.

Improvements through pull requests are welcome :-)

About

Simple Python script to push readings from a Homewizard WiFi P1 meter to a Postgres database, for usage in e.g. Grafana. Watch your wallet drain!

Topics

Resources

Stars

Watchers

Forks