Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for InfluxDB v2.x and Token authentication #68

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Konnichy
Copy link

@Konnichy Konnichy commented Aug 1, 2022

Hello,

I just switched to InfluxDB v2.3 and thought I'll provide you with the required modifications.

@Konnichy
Copy link
Author

Konnichy commented Aug 1, 2022

While at it, I just realize I also made modifications years ago to support multi-byte characters.

@Ja50n-Kru
Copy link

I have just tried these modifications, and they don't seem to work. Is the problem that the Organisation is not passed in the PostToInfluxDB? I get a 'not found' log response.

@Konnichy
Copy link
Author

Hello,

Are you sure you provided these 3 parameters in the SmartApp configuration?

  • bucket
  • organization
  • token

The Organization and Bucket are sent via URL, while only the Token is sent via header.

@Ja50n-Kru
Copy link

Hi Konnichy - yes I have provided all parameters. I guess if you have this working, then it must be an error my end - I'll keep digging/playing! Thanks for your quick reply.

@Konnichy
Copy link
Author

I confirm it does work for me.
All the required request info is passed to PostToInfluxDB() via the state variable.

Also, it's not visually obvious, but you can click on the first line in the SmartApp configuration panel to change the logging level. Setting it to "trace" could provide more information.

@Konnichy
Copy link
Author

Also, with Groovy being phased out, don't get your hopes too high. This SmartApp is expected to stop working before the end of the year in any case.

@AllegrettoA
Copy link

With Groovy being phased out soon, does anyone know an alternative solution for data logging?

@Konnichy
Copy link
Author

Have a look here: https://github.com/eargollo/smartthings-influx
This is the "InfluxDB topic" on SmartThings: https://community.smartthings.com/t/smartthings-data-visualisation-using-influxdb-and-grafana/44946/141.

I recently experimented with SmartApp development (and NodeJS, and Javascript) and I may try something on my side too. The downside of the app linked above is that it only polls. I'll use event subscriptions if I write it myself.

@AllegrettoA
Copy link

@Konnichy, looking forward to your solution - it will likely be more simple and perform better than what I’ve seen so far. NodeJS type solutions seem too complex, require server setup, and as you stated only polls.

@Konnichy
Copy link
Author

Unfortunately, with SmartThings abandoning Groovy, they also stop running services on their cloud. Device drivers now run on the hub, but it is now left to us where SmartApps are hosted. They provide guidelines for hosting on Amazon AWS or our own servers. So it doesn't simplify the hosting process at all.
Also, although the SmartThings API could be used from any development language, libraries provided by SmartThings are based on Node.js. So, any SmartApp development will likely be Node.js code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants