-
Notifications
You must be signed in to change notification settings - Fork 39
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 capability to subscribe to Hubitat variables #60
Conversation
I get an error when I try to run this. I haven't set up any variables to monitor yet... perhaps that the reason.
It seems to be this block: // Subscribe to variables
(booleanVariables + numberVariables + decimalVariables + stringVariables + datetimeVariables).each { name ->
subscribe(location, "variable:" + name, handleVariableEvent, ["filterEvents": filterEvents])
logger("Subscribing to variable ${name}", logInfo)
} I'm running from https://github.com/aerickson/InfluxDB-Logger/tree/INTEGRATION-snapshot1 (both #60 and #61 are merged in). |
@aerickson As it sits, this PR isn't being merged. Please run from the production version. |
@sdachen Thank you for your PR. I like the idea of adding the ability to publish hub variables to InfluxDB. After looking at the code, I thought that the implementation approach could be a bit simpler, and variable registration / rename handling was missing. In the end, it was easier to re-implement the feature rather than suggesting changes to the PR. I hope you don’t mind. I am still in testing, but have created PR #69 that you can review. Please have a look and let me know what you think. Note that the output is not completely compatible with the previous PR. In particular:
The changes look like a lot more than they are because I unrolled a bunch of input statements, which you can ignore. There is also a small additional feature which is the ability to publish the queue length as a variable. |
@dennypage thanks for the detailed feedback and response - still new to developing on Hubitat and Influx so the feedback is appreciated. Please feel free to re-implement anything as you see fit. :) I'll review your PR and hopefully the community can start using the update! |
Version 3.3.0 is released |
This PR adds the following functionality to allow the user to subscribe to hub variables and write to InfluxDB.