Skip to content

MartinHeinz/aranet4-exporter-go

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aranet4-exporter-go

aranet4-exporter-go is a Prometheus exporter for the Aranet4 environmental sensing devices. Use this to add the CO2, temperature, and humidity readings from your Aranet4 devices to your Prometheus dashboards.

Requirements

aranet4-exporter-go should work on most modern Linux system with Bluetooth support.

It has been tested on these platforms:

  • x86 Ubuntu 22.04
  • Raspberry Pi / Raspbian 3b 32-bit

Installing

Debian-based distributions can download .deb packages from the releases.

Setup

These instructions assume you are on a system using systemd and bluetoothctl.

  1. Use bluetoothctl to pair with your Aranet4 device as follows:

    $ systemctl start hciuart  # or enable
    $ bluetoothctl
    > power on
    > agent on
    > scan on
    # find the MAC address of the Aranet4 device in the output:
    # [NEW] Device DD:...:1F Aranet4 26D0F
    > scan off
    > pair DD:...:1F
    # ... enter passcode shown on Aranet4 ...
    > trust DD:...:1F
    > agent off
    > quit
  2. If bluetoothctl is not installed, you may need to install it:

    # Raspbian
    $ sudo apt-get install --no-install-recommends bluetooth pi-bluetooth bluez
    # Other distros
    $ sudo apt-get install --no-install-recommends bluetooth bluez
  3. Add the MAC address and optional nickname of your devices to /etc/default/aranet4-exporter.

  4. Run systemctl restart aranet4-exporter.

  5. Run systemctl status aranet4-exporter to get the port that the daemon was started on, and add the URL to your Prometheus collector.

Releasing

Building release with goreleaser

To add a new versioned release:

$ git tag -a v0.1.0 -m "v0.1.0"
$ git push origin v0.1.0

Building snapshot release with goreleaser

Snapshot build:

$ podman run --rm --privileged \
    -v $PWD:/go/src/github.com/user/repo \
    -w /go/src/github.com/user/repo \
    -e GITHUB_TOKEN \
    docker.io/goreleaser/goreleaser release --snapshot --rm-dist

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 93.6%
  • Shell 6.4%