I bought a hubitat to monitor and log sump pumps in my house. While I've the local logging and go do querries, I want to keep data in cloud DB, build a couple of reports etc. I've seen a discussion and seen some Grafana graphs from some users a few years ago. is there sampe sample code for different use cases anywhere across this site?
Rule Machine- logging /on and off state of device - different approaches and why? I did this painfully via ChatGPT4.
Storing logs for future queries - multiple ways to do it - but why not sample code for an on-premises use case and cloud-db?
Graphs and querries of log data?
These seem like foundational blocks for many uses cases - not just sump pumps.
1 - how long is x,y,z device running in my house (runtime / on/off instance)
2 - how much power is it consuming
3 - trends over time for either On state or on/off states
I'm happy to contribute as I build my stuff, but just wondering if use cases and code are centralized anywhere or it's just search and pray or using an LLM.
Thanks,
Peter
Please provide your hub model (C7, C8, etc.) and its platform version from Settings>Hub Details.
Check out the following post for help troubleshooting problems and gathering details that will help others to identify and solve the problem you are experiencing: ‼ READ FIRST - Before Posting in Get Help
That's why I like sending logs to Google Sheets. Once the data is there, I can query it, sort it, or graph it however I want to.
People don't like my method since it uses a public sheet to avoid having to deal with Google login, but I've never had any issues with it for years. I really should just get AI to write a Google login to the driver I am using at this point, but I've just been letting it roll.
I don't have any data on there that would be of interest to anyone, I only log data that doesn't give away anything about my house being occupied or not, mostly tracking heating/cooling, temps, humidity, irrigation, and things like that.
Edit: The other nice thing about no login, is getting the charts back out the sheet. With a public sheet, I can publish my charts and then use the URL provided to put them on a dashboard as an image, or use the interactive link, and put that in a link tile on a dashboard to open the graph in a full window, where I can click on datapoints to see actual values and times.
Mine just run. The charts I create use a range to the last row, so as new data comes in, it automatically goes on the chart, and appears on the dashboards.
I also have a cleanup script that maintains X number of days current data for each tab, or things get out of control quickly. I have one public workbook sheet with different sheet tabs for different logs, the Sheets script I am using to send the data sends the data to the proper sheet tab.
I have about 20 tabs on that sheet now, each logging different things, with their own charts to display the data.
This came up in a previous post, where I posted the Apps Scripts I am using in Google for receiving and removing data, as well as the Hubitat driver I use to send the data. It should come up in a search in this forum if you are interested. I could hunt it down if you can't find it.
The influxdb logger smart app works with both cloud and local instances of InfluxDB. You can then use a cloud account of grafana to access it. That can then be used abd keep all the info and functions in the cloud.
Not really a rule machine issue if you use influx DB. Influx db logger would send the on off event to your remote DB.
I use a inflixdb syslog logger and a custom dashboard designed for log analysis. Works great just look up my post related to my driver and i believe the dashboard is listed as well
There are some dashboards shared already, but probably won't fit your ask above about tracking your sub pump
My post discussing how to setup the local and cloud instance of the grafana, influxdb stack.
Link to my thread with my virtual driver for sending the live logging to ainfluxdb and the Grafana dashboard to use with it