Skip to content

HomeKit, Grafana and Influx. That works!

HomeKit, Grafana and Influx. That works!

First I’m sorry for my English, I’m just studying, this is almost my first post and I’m fairly new to home automation, I searched on Google to find a way to view HomeKit data and get stats, but never find out how to do it in HomeKit. There is the possibility to do this in the home assistant, in red and maybe in a different system. But the HomeKit shortcuts allowed me to write data to the Influx database. The first time I used to get content from the URL with the POST method, but it only works for me when my phone was on the local network.
So what do you need:
-Raspberries with homebridge installed, Influx with the database and Grafana connected to the influx. There are a lot of instructions on how to install them on the internet.
To collect data and write it periodically in the database, we need to install automation switches for the homebridge plugin. A motion sensor is created that activates every x seconds. So, our shortcut will begin in which we will get data from the sensor we need (temperature, humidity, heater status, weather, etc.). And we use the “run script over SSH” input information to connect to Raspberry and the script to send data to Influx like this:

curl -i -XPOST ‘http: // localhost: 8086 / write? db = mydb ‘
–data-binar ‘cpu_load_short, host = server01, region = us-west value = 0.64 1434055562000000000’

So this is how you view your values. With the if statements you can change states such as on / off to numbers and view them.