Skip to content

devauxa/mi_purifier_exporter

 
 

Repository files navigation

MiPurifier Prometheus Exporter

A simple exporter that can read a JSON with Xiaomi air purifiers exposes the data as prometheus metrics.

This is only tested with the Mi Purifier 3H, but should work with any purifier supported by python-miio.

For help on getting the ip and/or token please look at the python-miio docs.

If you are on iOS and find a 96 character token, please read the Decrypting iOS Token section

The format for the JSON file can be seen at example_purifiers.json

Usage

pip install -r requirements.txt
 
python exporter.py PATH_TO_JSON

or

make docker

Replace on docker-compose.yml with your TOKEN

docker-compose up -d

Decrypting iOS Token

pip install pycrypto

python decrypt_ios_token.py TOKEN

Thx to shrikantpatnaik

About

A prometheus exporter for Xiaomi Air Purifiers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 89.3%
  • Dockerfile 8.6%
  • Makefile 2.1%