Influxdb and Grafana
Short description of how to export data from Homey to influxdb using homeyscript.
let a = args[0].split(',')
let measurement = a[0].trim()
let device = a[1].trim()
let zone = a[2].trim()
let value = a[3].trim()
if (isNaN(value)) {
value = '"' + value + '"'
}
fetch("http://influx.yourhostname.com:30369/write?db=homey", {
headers: {
'Accept': 'application/json',
'Authorization': 'Basic xxxxxxxxxxxxx' // fill in with your credentials
},
method: "POST",
body: body
}).then((response) => {
console.log(response)
})
return true;


Questions for you.
Last updated