I’ve seen many threads/apps dealing with sending some metrics (temp and humidity sensors) to different backends.
I’m an Influxdb user and would like to create a smartapp to send data into a remote influxdb.
I’m actualy trying to push the data using a plain URL call but I’m not sure it’s really efficient. Also, I’m new to Groovy (while I’m good at python or Go).
IS there any Groovy binding to Influxdb ? Or is it possible to use the Java client within smartthings ?
The ST groovy environment is limited in what libaries it can use. You’re not going to be able to import any external libraries. If you can do it with an HTTP/REST call, that’s going to be the way to go. That’s what I’m using to get my data into Logstash and Graphite.
Sure. Both are linked below. It should be noted that the “Log to Graphite” SmartApp is actually sending its data to a Backstop instance, which then sends it along to Graphite.
Would you be able to ‘publish’ the influxdb shipper here - via Github similar to @btk above - so that we can try earlier than waiting for ST to go through its process - many thanks
I added a little bit more details and a picture of the result in the github repo.
I also added my Grafana Dashboard to ease the setup if you are using this dashboard…
@prune998 Were you able to get HTTPS working with influxdb and write from SmartThings SmartApp? I’m getting the following error in the SmartThings logs while using your smartapp. I confirmed I can write to influxdb from remote with curl although I need to pass a -k flag to ignore self signed cert issues.
something went wrong: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
EDIT: Doing some more digging. Looks like this is a SmartThings issue… It can’t accept self signed certificates. I wonder if it will take a Let’s Encrypt cert…
Thanks for the work on this - set it up this past weekend, and looks great so far!
I as well, ran into the SSL issue with SmartThings. I disabled https, and successfully had it populating influxdb.
I went as far as getting a valid cert issued from GoDaddy and installing, however, am still receiving the errors other have posted.
I have been searching which certs SmartThings will accept, with little success so far. Major browsers seem to be happy with the certificate. Will keep plugging away.
Thanks for the work!
EDIT: found the solution to my problem. Apparently with GoDaddy switching over from SHA-1 to SHA-2, not all java installations are updated. So I had to insert the crossover cert into the chain… now smartthings can connect without any problems. For reference, anyone hitting the same issue with GoDaddy certs: http://tozny.com/blog/godaddys-ssl-certs-dont-work-in-java-the-right-solution/
Sadly, It’s not the hub that connects to Influxdb.
The SmartApp is running in the SmartThings and no the hub. (as far as I know of)
So, yes, you need to expose Influxdb to the internet… That’s why I recommand using httpS and login/pass. You may also add a firewall rule to limit the IP range that can connect, but I don’t know if this is possible.
If anybody have knowledge of the IP range used by ST servers, you’re welcome to comment.
yep… local processing seems pretty limited right now, with almost “no way” to extend it… sounds like it wasn’t designed to work this way at the begining and developers are not able to deliver the marketing promises…