You might try displaying the data in InfluxDB itself via the command line when you know the event has happened but Grafana isn’t displaying it. It the data is in the DB then you know it’s in the visualization stage where things aren’t keeping up. It might require some luck trying to catch the situation.
The timing of this pipeline can be tricky with data flowing through multiple steps and each step having intervals that don’t always sync up.
Is there an update to this write up? I’m trying to make this work on a pi w, but I can’t connect via /localhost:8086 or :3000 after installing each server.
It looks like @zcapr17 may not be active anymore? I’m hoping someone in here can guide me.
I’ve grabbed a free subscription to http://corlysis.com who hosts influxDB and Grafana and very reasonable.
I have installed the Influx datalogger and adjusted the section of the code at “def postToInfluxDB(data)” for sending to WAN hosts.
I see in Groovy that it’s trying to send data but it’s getting an error that I can’t track down:
7bb21d1c-769d-42a7-b567-XXXXXXX 10:15:20 PM: error postToInfluxDB(): Something went wrong when posting: groovyx.net.http.ResponseParseException:
7bb21d1c-769d-42a7-b567-XXXXXXX 10:15:20 PM: debug postToInfluxDB(): Posting data to InfluxDB: Host: corlysis.com, Port: 8087, Database: CabinHUB, Data: [humidity,deviceId=bf1412bf-47ae-45a5-96ae-XXXXXXX,deviceName=Weather\ Station,groupId=null,groupName=Home,hubId=null,hubName=null,locationId=a451ffb7-037f-4952-9068-XXXXXXX,locationName=Cabin,unit=% value=81]
Does that error mean anything to anyone?
Thanks,
Phil
The example code in postToInfluxDB() for WAN hosts doesn’t seem to use state.headers, which means it isn’t passing the username/password. I think that’s the reason for the failure.
You should be able to change the code to this to get it to work (untested):
// For reference, code that could be used for WAN hosts:
def url = "http://${state.databaseHost}:${state.databasePort}/write?db=${state.databaseName}"
try {
def params = [
uri: $url,
body: data,
headers: state.headers
]
httpPost(params) { response ->
if (response.status != 999 ) {
Also I think you can change the url string to have “https” and then you can use port 8086, which would encrypt the connection and avoid sending your username/password obfuscated by unencrypted.
Thank you for creating the logger. It was very easy to set up and use, even with the new ST app.
I copied the code over, created an instanced, filled in the details (including the locally hosted InfluxDB - SO handy!) and then created a visualisation in an existing Grafana instance I had. Very smooth.
Thank you so much for creating this Influx DB logger for SmartThings. It is excellent work and very useful for recording SmartThings data on my local instance of Influx and Grafana running on a Raspberry Pi 3B. I was pleasantly surprised that it ran on my v1 hub which performs its processing in the cloud. I don’t understand technically why it works when I provide the LAN IP address with a v1 hub, but somehow it works, and works great!
@zcapr17 I have had great luck with your SmartApp in conjunction with InfluxDB and Grafana. Do you have any plans to circulate an updated version that is intended to work with InfluxDB 2?
I couldn’t manage to make this SmartApp work with the new SmartThings App so I created a small program to gather data from SmartThings to InfluxDB and Grafana. It does not run as a SmartApp but it is working very well for me.