Coder Social home page Coder Social logo

influxdb-udp-relay's Introduction

InfluxDB UDP Relay

Receives UDP messages with points in line protocol and forwards them to InfluxDB HTTP API.

Installation

  • Go to your Home Assistant Add-on store and add this repository: https://github.com/fl4p/home-assistant-addons Open your Home Assistant instance and show the dashboard of a Supervisor add-on.
  • Install influxdb-udp-relay add-on

Works with InfluxDB v1 or v2.

Configuration

There is not much to configure. You can set the UDP receiver port in the options.

The add-on reads Home Assistant's /config/configuration.yaml for InfluxDB credentials. Make sure you have an influxdb section similar to:

influxdb:
  host: a0d7b954-influxdb
  port: 8086
  database: home_assistant
  username: ha
  password: secret
  max_retries: 3
  default_measurement: state

If host is not specified it falls back to "homeassistant.local"

You can add additional remote / cloud servers through the add-on options array additional_servers.

additional_servers:
  - host: "example.com"
    port: 8086
    ssl: true
    username: ""
    password: ""
    database: ""

Note about loading Home Assistant configuration.yaml

HA implements custom yaml tags, that need to be registered with a constructor so the YAML loader knows how to construct objects from the tag. Otherwise you'll get an error similar to yaml.constructor.ConstructorError: could not determine a constructor for the tag '!secrets'. You find a list of HA specific tags in util/yaml/loader.py

Standalone

/usr/lib/systemd/system/influxdb-udp-relay.service:

[Unit]
Description=InfluxDB UDP relay

[Service]
Type=simple
Restart=always
User=alarm
WorkingDirectory=/home/alarm/influxdb-udp-relay
ExecStart=/usr/bin/env ../venv/bin/python3 main.py

[Install]
WantedBy=multi-user.target


influxdb-udp-relay's People

Contributors

fl4p avatar

Watchers

 avatar

influxdb-udp-relay's Issues

Cannot install this Add-On

supervisor_2024-03-14T08-56-45.167Z.log
I have new installation of HA on Hyper-V.vhdx:
Core 2024.3.0
Supervisor 2024.03.0
Operating System 12.0
Frontend 20240306.0
Just successfuly added Mosquito and InfluxDb.
But trying install InfluxDb-udp-relay I get error ERROR (MainThread) [supervisor.docker.addon] Can't build 2af0a32d/amd64-addon-influxdb-udp-relay:0.12: The command '/bin/ash -o pipefail -c pip3 install -r requirements.txt' returned a non-zero code: 1
Full log attached. Complete restart doesn§t help.

Installation and non-compatible packet issue

Home Assistant Core 2023.9.2 (std VirtualBox image) + InfluxDb Add-on 4.7.0
Installing this influxdb-udp-relay Add-on it does not connect to InfluxDb. Added manually as external server and working.
This Add-on works for regular UDP packets, but when a non-standard packet comes, it crashes on utf-8 error and program doesn't restart (watch dog enabled). I would guess that an exception handling is missing. It should be great to have this exception handled and log an info about wrong packet (l haven't log file now as it happens rarely, but happens).
btw - is this Add-on a must or is there any InfluxDb Add-on supporting InfluxDb UDP line protocol directly?

Missing Option Additional Servers

I believe I have installed this add on correctly, however when I attempt to start it I get the following error.

Missing option 'additional_servers' in root in influxdb-udp-relay (2af0a32d_influxdb-udp-relay).

I see that additional_servers can be added in the Optional Configuration Options on the config, but I have no idea what an additional server should be or how to format it. Any ideas?

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.