GithubHelp home page GithubHelp logo

andyhedges / rtl_433_prometheus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mhansen/rtl_433_prometheus

0.0 0.0 0.0 4.95 MB

Prometheus time-series DB exporter for rtl_433 433MHz radio packet decoder

License: MIT License

Go 91.47% Dockerfile 8.53%

rtl_433_prometheus's Introduction

A Prometheus exporter for radio messages received from rtl_433.

Hosted on Docker Hub: https://hub.docker.com/r/markhnsn/rtl_433_prometheus

You can configure locations using the name+channel like this:

$ ./rtl_433_prometheus --channel_matcher=Acurite-Tower,1,Bedroom --channel_matcher=Acurite-Tower,2,Downstairs

And using name+ID like this:

$ ./rtl_433_prometheus --id_matcher=Acurite-Tower,12345,Bedroom --id_matcher=Acurite-Tower,23456,Downstairs

You can also combine --id_matcher with --channel_matcher.

Example end-to-end usage, showing prometheus plaintext format:

$ go build
$ ./rtl_433_prometheus \
   --id_matcher "Acurite-Tower,1234,Study Balcony" \
   --id_matcher "Acurite-Tower,4567,Bedroom Balcony North" \
   --id_matcher "Acurite-Tower,7890,Bedroom Balcony South"


$ curl http://localhost:9550/metrics
...
# HELP rtl_433_battery Battery high (1) or low (0).
# TYPE rtl_433_battery gauge
rtl_433_battery{channel="A",id="1234",location="Study Balcony",model="Acurite tower sensor"} 1
rtl_433_battery{channel="B",id="4567",location="Bedroom Balcony North",model="Acurite tower sensor"} 1
rtl_433_battery{channel="C",id="7890",location="Bedroom Balcony South",model="Acurite tower sensor"} 1
# HELP rtl_433_humidity Relative Humidity (0-1.0)
# TYPE rtl_433_humidity gauge
rtl_433_humidity{channel="A",id="1234",location="Study Balcony",model="Acurite tower sensor"} 0.68
rtl_433_humidity{channel="B",id="4567",location="Bedroom Balcony North",model="Acurite tower sensor"} 0.6
rtl_433_humidity{channel="C",id="7890",location="Bedroom Balcony South",model="Acurite tower sensor"} 0.68
# HELP rtl_433_packets_received Packets (temperature messages) received.
# TYPE rtl_433_packets_received counter
rtl_433_packets_received{channel="A",id="1234",location="Study Balcony",model="Acurite tower sensor"} 65200
rtl_433_packets_received{channel="B",id="4567",location="Bedroom Balcony North",model="Acurite tower sensor"} 73440
rtl_433_packets_received{channel="C",id="7890",location="Bedroom Balcony South",model="Acurite tower sensor"} 70727
# HELP rtl_433_temperature_celsius Temperature in Celsius
# TYPE rtl_433_temperature_celsius gauge
rtl_433_temperature_celsius{channel="A",id="1234",location="Study Balcony",model="Acurite tower sensor"} 24.5
rtl_433_temperature_celsius{channel="B",id="4567",location="Bedroom Balcony North",model="Acurite tower sensor"} 25.6
rtl_433_temperature_celsius{channel="C",id="7890",location="Bedroom Balcony South",model="Acurite tower sensor"} 24.5
# HELP rtl_433_timestamp_seconds Timestamp we received the message (Unix seconds)
# TYPE rtl_433_timestamp_seconds gauge
rtl_433_timestamp_seconds{channel="A",id="1234",location="Study Balcony",model="Acurite tower sensor"} 1.5825398643534584e+09
rtl_433_timestamp_seconds{channel="B",id="4567",location="Bedroom Balcony North",model="Acurite tower sensor"} 1.5825398669721768e+09
rtl_433_timestamp_seconds{channel="C",id="7890",location="Bedroom Balcony South",model="Acurite tower sensor"} 1.5825398706426628e+09

Example docker-compose.yml config:

version: '3.4'
services:
  rtl_433_prometheus:
    image: markhnsn/rtl_433_prometheus
    restart: always
    ports:
    - "9550:9550"
    devices:
    - "/dev/bus/usb"
    command: [
      "--subprocess", "/rtl_433 -F json -R 19 -R 127 -R 40",
      "--channel_matcher", "Nexus Temperature/Humidity,1,Study",
      "--channel_matcher", "Nexus Temperature/Humidity,2,Bedroom",
      "--channel_matcher", "Nexus Temperature/Humidity,3,Balcony",
      "--id_matcher", "Acurite tower sensor,6543,Dining Room",
      "--id_matcher", "Acurite tower sensor,5432,Kitchen",
      "--id_matcher", "Acurite tower sensor,4321,Balcony",
    ]

Example prometheus.yml:

scrape_configs:
  - job_name: 'rtl_433_prometheus'
      static_configs:
            - targets: ['hostname:9550']

rtl_433_prometheus's People

Contributors

andyhedges avatar dependabot-preview[bot] avatar dependabot[bot] avatar mhansen avatar zopieux 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.