panzerdev / smartmeter

Monitor an electricity smart meter (OBIS) with prometheus and persist to a db

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Smartmeter

Monitor an electricity smart meter (OBIS) with prometheus and persist to a databse

Image of Grafana Dashboard

Setup

What you need

  • A digital electricity meter with data interface
  • A IR reader with USB (ebay example device)
  • A Raspberry Pi (I use a Zero W in my setup)
  • Another Raspberry pi or other server able to run Grafana and Prometheus

Final setup

Run app

Compile

# for your current machine
$ go build -o smartmeter

# for Raspberry Pi zero w 
$ env GOOS=linux GOARCH=arm GOARM=6 go build -o smartmeter

Run

Usage of ./smartmeter:
      --db-flush duration    Flush after duration (default 1m0s)
      --db-host string       Db host (default "localhost")
      --db-name string       Db name (default "root")
      --db-password string   Db password (default "root")
      --db-port string       Db port (default "5432")
      --db-user string       Db user (default "postgres")
      --http-port string     Port for http server serving prometheus endpoint (default "8080")
      --persist string       type of persistence: [none, postgres] (default "none")
      --reader-port string   Device name of reader (default "/dev/ttyUSB0")

About

Monitor an electricity smart meter (OBIS) with prometheus and persist to a db

License:The Unlicense


Languages

Language:Go 98.2%Language:Shell 1.8%