Request: Trending / Graphing / Analytics

I have been looking for a way to do some basic analytics on my hubitat data, mainly temperature etc. I wonder if Sharptools.io could do this? Not sure how things work in the background. Is Information requested from my Hubitat when I load my dashboard or is it on an interval?

2 Likes

What kind of temperature analytics were you hoping to do?

Behind the scenes, SharpTools sets up event subscriptions in Hubitat. So whenever events happen they are pushed to SharpTools and down to your browser (no polling involved).

Maybe Analytics is too strong a word. I was looking more towards graphing of data.

My HA is in my summerhouse. I have temp probes in all rooms and my additional shed etc. I would like to record these values in some kind of historical database and do correlation between outside temp and inside. Going a bit further than this it would be good to be able to graph on/off events of my heaters as well. Perhaps even on/off of events of other devices and deliver total on time etc.

I come from Vera and there I had a local service called DataMine which easily fulfilled my needs. I had also previously used Thingspeak in the cloud, but there are nicer looking services than that.

I know that some have set up Grafana on Hubitat, but it seems to possibly make the system unstable, so therefore I am looking at alternative options and I started thinking that perhaps Sharptools may be able to do this as it is connected anyway, and since states seem to be pushed to you, then I assume you already have the ability to graph it or forward to a solution like Thingspeak or better?

Ah, thanks for the clarification!

We arenā€™t tracking historical data at this point, but I have been thinking about what it would take to achieve some sort of historical trending of data.

Thereā€™s some short-term things we could do where we could ā€˜startā€™ a trend as soon as you open the page and each event that comes through would add a new plot on a trend (basically just recorded in your browser, but not stored), but I felt like thatā€™s really just not good enough even as an initial release.

How far into history are you looking to go?

1 Like

Anything really is better than nothing, but as soon as I have something I assume I will want moreā€¦ so letā€™s say that full storage of all data would be requiredā€¦this way one could run yearly analysis on the data. :slight_smile:

1 Like

I would love to see a trending feature.
Even if itā€™s like:
X Amount of days == free
Any more requires premium.
Or the entire feature requires premium.

As long as all of the awesome features are lumped into one low monthly fee Iā€™ll pay.

6 Likes

So, here I am again. Since I started this topic a lot has happened in camp Hubitat and there is now a good looking graphing application available calledHubigraph.

It only graphs data in the logs on Hubitat, but it is a start. However, I am not aware of any way to get this over to Sharptools for display.

Due to this I have been toying with moving my dashboard over to Hubitat (which would mean away from Sharptools), but the darn interface is so rigid that I just donĀ“t have the energy to do that and I still like the simplicity and power of Sharptools.

Is there any way to display Hubigraphs on the Sharptools dashboards, or are you working away on a similar logging solution internally that I could use instead ?

1 Like

Thanks for sharing! From a quick glance, it looks like theyā€™re using Google Charts (cloud charting library) to chart the history data from Hubitat and then embedding that in an iframe to display in the Hubitat dashboard.

We donā€™t currently support arbitrary HTML / JavaScript for security reasons, so this wonā€™t work today. That being said, we do have it on our hit list to enable the ability to build and use custom components and I think something like this would fit into that quite well.

Update! :tada: Custom Tiles are now available and provide a secure / sandboxed approach for running custom code and building custom displays!

Custom Tiles - Third Party Integrations

In the meantime, Iā€™ve seen other people take a similar approach by logging the data to Google Sheets and generating charts can be displayed in the SharpTools Media Tile. (This approach works in both Hubitat and SmartThings)

If youā€™d like more details on the Google Sheets approach, Iā€™d be happy to write something up. The overall concept is:

  1. Install the Google Sheets Logging app in Hubitat and setup logging to a Google Sheet.
  2. In Google Sheets, create a Chart from the logged data
  3. Publish the Chart as an Image
  4. Copy the Link (to the published Image) and use the URL in a Media Tile with an appropriate refresh rate

image

2 Likes

That is interesting. I might take a look into that. I do wonder what will happen once you have amassed a lot of data ? On the other hand I guess you can do pivot tables and the like on the data.

Hubigraph has grown quite a lot over a very short period and it is nearly perfect, with the exception of not storing the data separately, so you are stuck with what is available in the logs at any given time. I know that it might be possible to go with Grafana or similar but I just want to keep things ā€œsimpleā€ :slight_smile:

I went the google charts route as suggested, and in theory it works, but the problem is that sometimes there is no change of temperature and then the line in the sheet is filled with empties so that ruins the graph. In addition the image is of course static so no nice hovering over anything etc.

For other graphing this might work well though

image

2 Likes

Thanks for sharing!

Perhaps you could use a formula to standardize the values across a time interval. Maybe some form of time series interpolation.

Yes, I am sure that would be possible, but still I am left with ā€œonlyā€ an image, and I wouldnĀ“t even know where to begin with formulaā€™s and such and that is the beauty of Hubigraph or cloud IoT platforms where this is all taken care of already. I am not a fan of re-inventing the wheel.

I think I will just start down the path of using the Hubitat dashboards for graphing with Hubigraph and continue with Sharptools for other dashboarding, even though ideally I would like one tool that does all and is available without VPN, but I guess I canĀ“t have it allā€¦

You know; you could just ask the HubiGraph creator to add long-term logging, I know the creator and he is always looking for ideasā€¦

1 Like

I have come full circleā€“building a number of Sharptools dashboards, only to try Home Assistant, then back to Hubitat native dashboards. One of the best things about HA is the Hubigraph app and its ability to create graphs like these

. Hubigraph creates its own device types for each graph using attributes from other devices. Is there any way to pull these devices into Sharptools? They donā€™t appear in the listing from HA when I manage the connection.

If I remember correctly, these tiles are injecting custom HTML into device attributes in order to display these in the HE dashboards. Itā€™s a security risk to allow arbitrary HTML to be injected, so we donā€™t allow it.

That being said, I would be open to a feature request for native gauges within SharpTools if you want to create it!

1 Like

I would love to have graphs in SharpTools. I have also been down the road of creating dashboards in HE, but the interface is just so clunky, and you must mess a lot with CSS to get something half-decent and Hubigraph will not work when connecting to the HE dashboard from outside, so you would need to VPN in to view the local dahsboards.

I wonder if we could just grab some images from Hubigraphs to display in SharpTools ? Now that HE has support to save files internally, you could imagine that a request from SharpTools to Hubigraph would save images internally and SharpTools would grab them from there?

Mark put together a feature request for the gauges here if you want to cast a vote:

Since it doesnā€™t have a dependency on historical data like graphing would, thereā€™s less technical barriers to an implementation. In other words, itā€™s more likely to get done if it gets enough community interest. :slight_smile:

The challenge with HubiGraphs is itā€™s actually a bunch of client side JavaScript that gets injected. Itā€™s a security risk to allow arbitrary HTML or JavaScript to be rendered directly in a tile.

That being said, Iā€™ve helped some people on projects that render SVGs from Hubitat and theyā€™ve used those to display custom graphics in their dashboards. In theory, a similar approach could be taken for charts like you alluded to.

One other thing weā€™ve been bouncing around internally is the concept of sandboxed custom components. These would allow you to run custom HTML + JS in a sandboxed environment, opening up a ton of flexibility.

1 Like

A graph tile support for Homey would be great. The Homey api provides the data, and is selectable for:
Last hour
Last 6 hours
Last 24 hours
Last 7 days
Last 31 days

This day
This week
This month

Etc.

Use case e.g. is a graphic showing the power production of a solar panel for today.

3 Likes