Git Product home page Git Product logo

domoticz_exporter's Introduction

Domoticz exporter for Prometheus.io, written in Node.js.

This exporter provides metrics for the devices defined in Domoticz, rather than for Domoticz itself.

Usage

Arguments

--port     9486         Exporter listens on this port (default = 9486)
--interval 15           Polling interval in seconds (default = 15, minimum 2)
--hostip   127.0.0.1    Domoticz IP (default = 127.0.0.1)
--hostport 8080         Domoticz port (default = 8080, or 443 if using SSL)
--hostssl               Use SSL to connect to Domoticz
--collectdefault        Collect default Prometheus metrics as well (default = false)

Environment Variables

The arguments can also be set as env variables instead. Useful if you're using it in a Docker container.

  1. DOMOTICZ_PORT
  2. DOMOTICZ_INTERVAL
  3. DOMOTICZ_HOSTIP
  4. DOMOTICZ_HOSTPORT
  5. DOMOTICZ_HOSTSSL
  6. DOMOTICZ_DEFAULTMETRICS

Installation

From Source

Node 16+ is required to run it.

git clone [email protected]:wywywywy/domoticz_exporter.git
cd domoticz_exporter
npm install
npm start

Recommend npm version >= 6.

With Docker

docker run -d --restart=always -p 9486:9486 wywywywy/domoticz_exporter:latest

Prometheus Config

Add this to prometheus.yml and change the IP/port if needed.

- job_name: 'domoticz_exporter'
    metrics_path: /
    static_configs:
    - targets:
        - '127.0.0.1:9486'

Notes on Devices

There are 4 types of devices in Domoticz, and they are presented as separate metric groups.

  1. light = Get all lights/switches
  2. weather = Get all weather devices
  3. temp = Get all temperature devices
  4. utility = Get all utility devices

Unfortunately there is no standard in Domoticz how "levels" are presented. So for example on some devices battery level 100 means full, and others it will be 255.

The same goes for units - on some it may be Celsius others Fahrenheit, some it may be kWh others Ah, etc. It all depends on the device itself.

TODO

  1. Support for more edge-case devices
  2. Metrics of Domoticz itself maybe?

Contributing

Yes, contributions are always welcome.
Fork it, clone it, submit a pull request, etc.

License

This is licensed under the Apache License 2.0.

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.