matteodri / owl-energy-monitor

Java application to expose Owl Intuition data through Prometheus and Grafana
MIT License
2 stars 0 forks source link

Owl Energy Monitor

jdk11 CircleCI Codacy Badge Codacy Badge License: MIT

Purpose

Java application that listens to multicast UDP messages generated by the Owl Intuition home energy monitor, saves them in Prometheus and makes the data available through Grafana. The application must run on the same network the Owl Intuition is connected to. This has been tested using a Owl Intuition-PV.

Example: Energy monitor metrics example

OWL Intuition

OWL Intuition is an electricity monitoring system that tracks electricity consumption and, in the PV version, records electricity produced from photovoltaic panels. Their software provides a way to monitor system electricity flows, keeping historical data that can be accessed, with some limitations, from their website. Measures are constantly published over multicast messages on the local network.

Because of the limitations with the search functionality and the short time period consumption stats are available on theowl.com, I decided to write my own tool to store, display and analyse consumption data.

Owl multicast messages

The Network OWL sends UDP packets to the following multicast group:

Address: 224.192.32.19
Port: 22600

Information on message format can be found here: Multicast and UDP API information.

Build

Check if code complies with formatting template:

mvn spotless:check

Apply Spotless code formatting:

mvn spotless:apply

Build the Docker image

mvn clean package

Required applications on host

Run

Run owl-energy-monitor Spring Boot application only with Java command:

java -jar target/owl-energy-monitor-<version>.jar

Build, create, start, and attach to the containers of the Owl Energy Monitor service with Docker Compose.

docker-compose -f docker/docker-compose.yml up

Build, create and start a specific container.

docker-compose -f docker/docker-compose.yml up -d prometheus

On the host this also needs to be running:

iperf -s -u -B 224.192.32.19 -p 22600 -i 2

This runs iperf in server mode binding to Owl multicast address. Allows the owl-energy-monitor to receive multicast packets while on the docker bridge network.

Default endpoints

Service ports as set in docker-compose.yml.

Owl Energy Monitor

cAdvisor

Prometheus

Grafana

E.g. Grafana web console when running in localhost: http://localhost:6001/

License

MIT License

Copyright (c) 2019 Matteo Dri

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.