thank you. seems to be some progress after making those changes, but still some oddities.
power1 & power2 aren’t reporting W as units, and though the general event lists the numerical value (1st pic), influx still shows the units as null (2nd pic).
while the current1 and current2 are showing units and numbers in the event list, they still show the “\ value” in influx - so they won’t graph in grafana.
also, unlike current1 and current 2, power1 and power2 do not seem to be reporting consistently. meaning that sometimes there is data, and sometimes there is a gap of several hours. {Rev: just figured out parameters Nos 5, 6, 9, or 10 are not addressed in the code. these are the ones that set the reporting times per clamp. HEM totals are 4 and 8. }
.
Check you’ve updated all the code. Look for instances of createEvent() as well as sendEvent().
Once you’ve created a measurement type in InfluxDB, all subsequent entries must use the same data type (string, int, decimal, etc). You have managed to create your measurements as strings by the looks of it, so you will need to delete the measurements and start again.
Also, check the DTH is raising events with decimal values and not strings.
modifying the parameters to report 5, 6, 9, and 10 based on cov or percent change seems to have solved the “W” matter for power1 & power2.
hmmm … need to figure out that one
modifying the parameters to report 5, 6, 9, and 10 based on cov or percent change seems to have solved the reporting frequency for power1 & power2 and current1 & current2
I just installed InfluxDB Logger following your instructions, and while I seem to be getting data, I see the following in the Live Logging of SmartThings:
Any idea what is causing this error?
ostToInfluxDB(): Something went wrong! Response from InfluxDB: Headers: [content-length:344, request-id:78debf6e-7ad9-11e7-809c-000000000000, http/1.1 400 bad request:null, content-type:application/json, date:Sun, 06 Aug 2017 19:00:11 GMT, x-influxdb-version:1.3.1], Body: {“error”:“unable to parse ‘_stHub,locationId=“479943b5-a196-48df-a303-d309b414ed3b”,locationName=“Home”,hubId=“1c3610cc-cb96-402f-98e1-232bacf343a7”,hubName=“Home\ Hub”,hubIP=“10.0.1.67” status=“ACTIVE”,batteryInUse=0i,uptime=nulli,zigbeePowerLevel=-6i,zwavePowerLevel=“full”,firmwareVersion=“000.017.00014”’: invalid number”}
It’s h.hub.getDataValue(“uptime”) returning null. I wasn’t able to find the “uptime” property/value in the API docs. Removing it from from the line that starts with "data += “status=” resolves the error.
I’ve setup with my Ubuntu server hosted on Azure and for some reason, I’m not getting any data logged to the database. There is no information in the Live Logging to indicate an issue but the database is empty.
Any suggestions where I should be looking?
I’m able to do curl http://RemoteIP:8086/ping
successfully and NC / telnet to the host on 8086 similarly shows that the service is accessible.
I have been setting up my influxDB+Grafana services on my local Ubuntu server this weekend and must say I have very glad with the result now. so first of all, thatk you very much for all of this.
I have an issue however with my level logging with the following error messages in the smartthings logs:
postToInfluxDB(): Something went wrong! Response from InfluxDB: Headers: [content-length:150, x-influxdb-error:partial write: field type conflict: input field “value” on measurement “level” is type string, already exists as type float dropped=1, request-id:8aa73f8a-2b94-11e8-9681-000000000000, http/1.1 400 bad request:null, x-request-id:8aa73f8a-2b94-11e8-9681-000000000000, x-influxdb-build:OSS, content-type:application/json, date:Mon, 19 Mar 2018 16:42:41 GMT, x-influxdb-version:1.5.0], Body: {“error”:“partial write: field type conflict: input field "value" on measurement "level" is type string, already exists as type float dropped=1”}
I haven’t had time to look deeper into that issue and this is most probably coming from my setup but if someone has any lead, where to look into or anything to help, I’ll take it !
Update for anyone interested / facing a similar issue.
I needed to add a “level” section in the handleEvent function to specify unit (%) and convert value to integer. Looks like there was a misinterpretation of 1 as a string or boolean instead of integer. This might be due to the Device Handler I use for my Flair vents.
Here is the piece of code I have added:
(...)
else if ('level' == evt.name) {
logger("handleEvent(): my trick: ${deviceName}, Event Name: ${evt.name}, Value: ${evt.value}","warn")
unit = '%'
value = value.toInteger()
data += ",unit=${unit} value=${value}"
}
(...)
Let me know if that doesn’t make sense or if there is a better fix.
Thanks
I’ve got a weird issue with some of my temp sensors logging the incorrect temperature.
In the SmartThings app, the temperatures are correct. In ActionTiles, the temperatures are correct. But in my Grafana dashboard they aren’t. I’ve looked directly in the influx database and Grafana is showing exactly what’s there. So the value change is happening in the data transfer from SmartThings to InfluxDB. And what’s even more weird, for temp sensors in cold areas (freezer/fridge) they aren’t doing this. All temp sensors are the exact same brand.
Some examples…
Temp in the attic:
SmartThings: 104f
Actiontiles: 104f
Influx/Grafana: 10f
Temp in the garage:
SmartThings: 82f
Actiontiles: 82f
Infux/Grafana: 8f
Temp in the freezer:
SmartThings: -2f
Actiontiles: -2f
Influx/Grafana: -2f
I don’t see anything in the influx logger code that would be causing this so I have no idea where it’s happening.
I figured it it out. InfluxDB is receiving the temperature as a string. Influx is noticing it is just a number and converting it to a float. So influx is converting it incorrectly, probably a bug in the current influx version. I modified the InfluxDB logger code to convert the temp to a float first and then send it to influx. This adds a .0 to the end of the temperature value (if it doesn’t already have a decimal) and now influx is converting it properly.
This is amazing!!! Thank you for this… I tried every other logging utility and this is by far the BEST! I am having trouble, however, getting my open/close and presence sensors to display. Guess I am not selecting the right options? Any insight anyone can shed?
Again, thank you for this awesome writeup and code!! Has anyone had any success using a server not on the same LAN? I really want to use this with an AWS instance, but cannot get the data to write to it… made sure all necessary ports were open etc. So I setup a local Ubuntu install, but I would prefer to be using this in the cloud! Any advice?