Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Ruuvitag to influxdb
from influxdb import InfluxDBClient
from ruuvitag_sensor.ruuvi import RuuviTagSensor
tags = {'F6:B4:FB:E9:7C:A8':'incubator'}
client = InfluxDBClient(host="localhost", port=8086, database="sensors")
def handle_data(found_data):
json_body = [
"measurement": "ruuvitag",
"tags": {
"mac": found_data[0],
"location" : tags[found_data[0]]
"fields": found_data[1]
RuuviTagSensor.get_datas(handle_data, tags.keys())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment