Giter Club home page Giter Club logo

adax-prometheus-exporter's Introduction

adax-prometheus-exporter

Prometheus exporter for Adax.no heaters. Retrieves current and target temperature for each home and room registered and returns in a format that Prometheus can read. Written in Go.

Installation

If you are on Debian or Ubuntu (or any of its derivatives), the easiest way to get the exporter running is using my apt repo.

Firstly, install the required dependencies.

sudo apt-get update
sudo apt-get install \
    ca-certificates \
    curl \
    apt-transport-https \
    gnupg \

Then, download the key used to sign the packages and add the repository to your /etc/sources.list.d/ directory.

curl -o /etc/apt/trusted.gpg.d/packages.hejduk.se.gpg https://packages.hejduk.se/apt.gpg
sh -c 'echo "deb https://packages.hejduk.se/hejduk stable main" > /etc/apt/sources.list.d/hejduk.list'

Finally, use apt to update the cache and install the package.

apt update
apt install adax-prometheus-exporter

Configuration

Once installed, create/open the file /etc/adax-prometheus-exporter/config.yml (if you used the .deb packages, this file should have automatically been created). You may use the config.example.yml as a reference if you are installing manually.

It will look something like this. Fill in the values for the options as required.

---
client_id: "0"
client_secret: ""
port: 8080

If you installed the .deb package, you may start the web app using systemctl.

systemctl enable adax-prometheus-exporter
systemctl start adax-prometheus-exporter

If you have built it manually, you can launch the binary with the following parameters.

adax-prometheus-exporter --config /etc/adax-prometheus-exporter/config.yml

Metrics will be available from http://localhost:8080/metrics. It will look something like this.

room_temperature{home="Home",room="Test"} 21.000000
room_target_temperature{home="Home",room="Test"} 24.000000
room_temperature{home="Home",room="Test2"} 18.000000
room_target_temperature{home="Home",room="Test2"} 17.000000
room_temperature{home="Cottage",room="Living Room"} 22.000000
room_target_temperature{home="Cottage",room="Living Room"} 23.000000

Building from source

To build the project from the source, make sure you have Go installed (Go 1.17.x is supported by other versions may work).

To just build the executable, use make build.

make build

To build the executable and the .deb packages (includes systemd unit file), just run make.

make

Author ✨

Created and written by Vilhelm Prytz - [email protected].

adax-prometheus-exporter's People

Contributors

vilhelmprytz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.