Hubigraphs Alternative

Since it appears the Hubigraph thread is lock, can someone please post a "How to install Hubigraph for Dummies" guide?
I have Hubitat Package manager installed
I have the link to Hubigraphs. I takes me to a page with a big long list of files. Do I have to open each one, copy and paste the code into Hubitat Package Manager?
Sorry for the newbie question - just not at all intuitive.

One of the reasons Hubitat package manager is so useful is it can install apps and drivers for you so that you donā€™t have to copy/paste code manually.

Itā€™s been a while since I installed Hubigraphs with HPM, but if I recall correctly, itā€™s no different than other apps.

Have you used HPM to install any other apps or drivers?

Yes, I used HPM to install either the one app or one driver that I have installed, but I did that at the end of last year, so it has been awhile, and it is NOT intuitive.

I recall that I either entered a website address, or I went to a file, copied code, and pasted it in a screen for HPM. I don't know which website address to enter for Hubigraph, or which file or files to open and copy/paste. You indicated HPM is useful so I don't have to copy/paste. So do I just enter the GitHub website in HPM? I don't want to do something that will mess up my Hubitat by entering the wrong website...

Alternatively is there a driver or app or whatever that I can install on the Hubitat that will automatically download data to a local spreadsheet (preferable) or online to a Google Sheet? In doing more reading I'm concerned the Hubitat's ability to keep a big log of Temp/Humidity data is limited. I'd like to obtain and graph this data for an entire year.

Is there a guide or set of directions for how to install Hubigraph?

And yes, I've done searches on this site and on Google using several versions of "How to install Hubigraph on Hubitat"

Take a look at Hubitat package managerā€™s documentation available here:

https://hubitatpackagemanager.hubitatcommunity.com/

It explains how to use it to install other community developersā€™ apps and drivers. Hubigraphs can be installed the same as any other app (if I recall correctly).

1 Like
  1. Install Hubitat Package Manager ā€œHPMā€). Documentation on how to do this is just above.

  2. In HPM, click install.

  3. Search by keywords, type in Hubigraph, then hit Next.

See screenshot:

You will get a single result. Click that result.

You will be guided through the steps.

2 Likes

:exclamation:
:astonished:

I am not sure Hubigraphs is the right tool for that. I do recall that some use Influx, but I have zero idea how to use it or what the requirements of it are. @sburke781 do you use Influx?

Here is a thread that may be helpful, there may be others.

2 Likes

I think Hubigraphs can do this with long term storage. Just not well.

I use influxDB and Grafana. The question for a external tool is how much effort do you want to put in to having this kind of data. If you use influx db or something else you will likely need a 24/7 device to run thr software. This could be a raspberry pi or a nas.

1 Like

@calinatl

I agree with @neonturbo. Hubigraphs is probably not the appropriate tool for the number of data points you wish to save and graph.

InfluxDB + Grafana would be the best way to approach this. They can run on a Raspberry Pi.

3 Likes

I agree with others, I actually used Hubigraphs for a short time and realized it was too limited. Influx + Grafana works great, hosted on a virtual server running on a windows Pro machine for me.

I wish there was a better way to get people up and running on this package. There are so many different ways to do it and versions of things instructions are fairly long.

What holds people back the most? Having an always on device to run it?

Here is what you can do:

Year to date gets a little messy, I don't usually view this but I am sure the settings could be adjusted to smooth it out more.

4 Likes

This is interesting to me, since I use Hubigraphs for a few things on my HE dashboard, and I was hoping to add something that tracks my Radon measurements, using a RPi to connect to it via Bluetooth and pull the data. However, I'll probably have at least a year of measurements eventually, and I'd like to see a long-term plot arranged with seasons.

Now I'm thinking I should keep the data on the RPi and use Influx + Grafana. Maybe also using that to plot the COVID numbers, humidity values, and HVAC activity that I'm using Hubigraphs to plot now.

Does anyone have a link to a good explanation of how to get plots out of Grafana and onto the HE Dashboard? I have the dashboard to view on tablets throughout the house, and I really don't want to change that set-up.

I use a device driver (https://raw.githubusercontent.com/thebearmay/hubitat/main/tileIframe.groovy) that generates an iFrame attribute using the URL for the graph and then display that attribute using the attribute tile.

2 Likes

THANK YOU.
That did it. I thought since Hubigraph is a custom app by a community member, that I needed to be in the Apps Code section and click new app. I was very wrong. Appreciate your help! Thanks again.

Now I just need to figure out how to use it...

2 Likes

What holds people back the most? For me, it is indeed the myriad of different generic instructions that may not fully work with HE or the latest version of whatever component is required on th PI.

I have tried two times to install a influx + Grafana setup on the PI, but usually get stuck on some part of the process with little knowledge on how to continue.

I would love it if someone would be willing to write up a some good HE specific instructions, or offer a disk image of a working package, along with information on what to change. Alternatively a link to good instructions along with HE specific additional information could also work.

The current Influx + Grafana threads on this forum are difficult to follow ( for me).

Love your screenshot BTW :slight_smile:

Yes, I use Influxdb and Grafana, including the Node.js app you linked, which receives events posted from Maker API, storing these in InfluxDB, which I then visualise in Grafana charts that I embed in HE dashboards using iFrames.

I'd agree that the InfkuxSB / Grafana option does open a can of worms.... Not all bad ...Whether it be the options for the device to host these applications / services or how best to configure and use them, through to the use of iFrames with a touch of CSS, this can feel daunting, but hopefully in a good way for all that you can learn along the way. The flip side to this is that many people use these systems, not just here, but more generally, so there is a wealth of instructions available and people willing to help. But as you mention, the number of instructions can in itself be overwhelming and confusing.

Enough of my ramblings... :slightly_smiling_face: I agree that some instructions for those integrating these systems with HE would be useful, bud I feel like rather than re-writing these instructions, collating links to existing instructions from respected sources. Easy to say, I know... Just an idea...

1 Like

Yeah I had a heck of a time getting it going. I will see what I can do for instructions using the logger app since it is the easiest.

3 Likes

Hubitat package manager streamlines the process of pulling custom apps and drivers from community developersā€™ GitHub repos and downloading to your hub. When it has done its job, you will see the custom app or driver appear in your apps code or drivers code pages of your hub.

You still have to install an instance of the app (now that you have the code available on your hub thanks to HPM) in order to use it.

All of the above is true for Hubigraphs, and other apps/drivers downloaded by HPM.

4 Likes

See I didn't have an issues at all getting it working with Smartthings. That is where my setup originated from and i just used the directions I linked above. They should still apply with only two exceptions. The first being InfluxDb is now in the 2.x versioning and for authorization reasons I think you ned to load 1.8. The second would be you would likely want to specify Hubitat for your database instead of Smartthings.

The big problem is where to put the influxdb and Grafana environments. It needs to be a 24/7 system so it can always get the device updates. That can be as simple as a rasbperry pi for someone that doesn't have a always on system, If you have a 24/7 solution though it could be a VM, or a docker as well. Some systems like Unraid Server also have packages that cover both InfluxDB and Grafana. So it really depends on your home setup.

1 Like

I am going to see about updating codersaurs documentation and will post it here if i can get the minor stuff updated to be valid.

HubitatData Visualization using InfluxDB and Grafana

POSTED ON 2016-04-11 BY CODERSAUR updated Doc for Hubitat by mavrrick

Original Doc at codersaur.com

Overview

There are three key components to the solution:

  • Hubitat Hub: Hubitats home automation controller. Since youā€™re reading this article Iā€™ll to assume youā€™re already reasonably familiar with this platform. To get data out of Hubitat weā€™re going to use a custom SmartApp, more on that later.
  • InfluxDB: A free open-source distributed database for managing IoT time-series data. Itā€™s super-easy to install and natively supports compression, retention policies, and down-sampling.
  • Grafana: A free open-source platform for visualizing time series data. Grafana makes it easy to create dashboards and charts. As well as InfluxDB, it works with several other data sources such as Graphite, Elasticsearch, and OpenTSDB.

Installation

For this solution Iā€™musing Ubuntu Server 22.04 running in a virtual machine,however you could substitute this with a Raspberry Pi running Raspbian, or any other Linux distribution of your choice. If youā€™re not using Ubuntu or another Debian-based distribution you will need to use different commands to those shown below, follow the links to the official installation instructions for more information.

Installing InfluxDB

At the time of writing, the latest version of InfluxDB is v1.8.10, and the official installation instructions can be found here. If you use a different platform please confirm with that link the correct install directions for your platform.

Submit the below commands.

wget https://dl.influxdata.com/influxdb/releases/influxdb_1.8.10_amd64.deb

sudo dpkg -i influxdb_1.8.10_amd64.deb

Start the InfluxDB service:

~$ sudo service influxdb start

To verify InfluxDB is up and running we can run the influx CLI:

~$ influx

Connected to http://localhost:8086 version 1.8.10
InfluxDB shell 1.8.10

We can also browse InfluxDBā€™s web interface on port 8083, *http://localhost:8083/*:

InfluxDB Web UI

Next, we need to create a database for Hubitat and a user account for Grafana. From the InfluxDB CLI, issue the following commands (obviously, replace password with something a little more secure):

CREATE DATABASE "Hubitat"

CREATE USER "grafana" WITH PASSWORD 'password'

Installing Grafana

At the time of writing, the latest version of Grafana is v9.0.0, and the official installation instructions can be found here.

To install the latest OSS release:

sudo apt-get install -y apt-transport-https
sudo apt-get install -y software-properties-common wget
wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -

Add this repository for stable releases:

echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list

After you add the repository:

sudo apt-get update
sudo apt-get install grafana

Start the Grafana service:

Start the Grafana server with systemd

To start the service and verify that the service has started:

sudo systemctl daemon-reload
sudo systemctl start grafana-server
sudo systemctl status grafana-server

Configure the Grafana server to start at boot:

sudo systemctl enable grafana-server.service

We can verify Grafana is running by browsing to the web interface on port 3000, *http://localhost:3000/*:

Grafana: Log In Page

At this point, Irecommend Logging into Grafana and changing the default admin password.

So far, so good. We now have InfluxDb and Grafana running, but before we can start constructing some charts and dashboards, we need some dataā€¦

Installing the InfluxDB Logger SmartApp

To get data from Hubitat into our InfluxDB database, Iā€™ve written a custom Hubitat SmartApp. Once installed, we can use this SmartApp to subscribe to the devices we want to monitor and it will send data to InfluxDB using its HTTP API. The SmartApp uses the hubAction command,which means it will support the InfluxDB server being on the same privateLAN as our Hubitat Hub, so there is no need to make the logging server accessible from the internet.

Follow the standard procedures to install the InfluxDB Logger SmartApp in the Hubitat Hub. The raw link to the latest code is below

InfluxDB logger on Hubitat Community Github

InfluxDB LoggerSettings

Once weā€™ve added the InfluxDB Logger to the user app section of Hubitat, we must configure it. Enter the host name and port of the InfluxDB server(note that the InfluxDB HTTP API uses port 8086 by default, whereas the web interface uses 8083). Additionally we must specify the database name we created above.

The InfluxDBLogger also allows us to configure a Soft-polling interval. If enabled, this will cause the attributes of all devices to be sent to the InfluxDB database on a periodic basis. I implemented this feature because Hubitat will only generate an event when a device attribute actually changes in value.For attributes that donā€™t change very often, this can lead to big gaps in the data series, which in turn can lead to gaps in our Grafana charts. For now,I recommend setting the soft-polling interval to 5-10 minutes.

Finally, we must configure the devices we want to monitor. When finished, press Done.

Verifying Data Logging

The InfluxDB Logger SmartApp should now be sending events to InfluxDB via HTTP, we can verify this by checking the Hubitat logs and by running a query from the InfluxDB CLI.

From the Hubitat ,navigate to the Logging tab. After a few minutes, we should see some info events from the SmartApp, corresponding to changes of device attributes:

Hubitat: Logging

From the InfluxDB CLI we can query data in the database directly using the InfluxQL querylanguage. Remember to set the database first using the

use

command first.For example, to query switch measurements:

use Hubitat

SELECT * FROM switch

name: switch


time deviceId deviceName groupName unit value valueBinary

1460400903900824163 xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxxxxxEn-suite Towel Rail Bedroom switch off 0

1460401204143438152 xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxxxxx AVPower Lounge switch off 0

1460401204169860754xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxxxxx Computer Power Office switch on 1

We can see above that the InfluxDB Logger maps device attribute names (e.g. switch or power)to a measurement name in InfluxDB. Additionally, deviceId, deviceName and groupName (i.e.room name) are added as tags. Device attribute values are mapped to the value field. In cases where an attribute value can also logically be represented as a binary value, thenan additional field called valueBinary is also included. E.g.for a switch; off = 0 and on = 1. We will see later how these additional tags and fields are useful when building charts and dashboards in Grafana.

If you want to learn more about querying data using the InfluxQL query language,you can find a guide here.

Now we have data in our database we can begin building charts using Grafana. Happy days!

Configuring Grafana

To configure datasources, dashboards, and charts we must use the Grafana web interface on port 3000, http://localhost:3000/.

We will first need to login using the admin password that we configured earlier. Once logged in as admin you may wish to create additional users from the Grafana admin menu.

Data Sources

Next we need to define a data source that corresponds to our InfluxDB database. Click on the gear in the lower left corner of the browser and select Data Sources. Now click on the Add Data source button in the window that came up.

Grafana: Add Data Source

Select InfluxDB from the presented screen and you should be put on the page to configure the Data Source. Provide a valid name for the data source like Hubitat, Update the URL to point to our InfluxDB instance on http://localhost:8086. Scroll down to the bottom of the setup screen and set the database name to "Hubitat" and the username and password to what we set earlier. Save and test the connection.

We can now begin using the Dashboards sectionā€¦

Dashboards

Grafana supports the creation of multiple dashboards. Each dashboard can contain any number of graphs, tables, stats, and text panels.

Create a new dashboard from the top menu, give it a name, then click +Add Row to add a row to the dashboard.

Letā€™s start by adding a graph to our dashboard. From the row menu select Add Panel and then Graph:

Grafana: Add Graph Panel

Graph Panel

We are first presented with the Metrics tab of our new graph. In the bottom-right corner, ensure the data source for the graph is set to Hubitat.We should find a drop-down menu of available measurements when we click on Select measurement. In this example Iā€™ve selected temperature:

Grafana: Graph Query

If we have multiple devices with temperature attributes, we can add the tag deviceName into the GROUP BY clause, which will create an individual data series for each device. Additionally, Iā€™ve specified the deviceName tag in the ALIAS BY clause above so that each series name matches the device name. We end up with a chart looking something like this (obviously we have to wait a while for multiple data points to be logged):

Grafana: Basic Temperature Graph

Grafana supports a wealth of graph settings, most of which should be self-explanatory. We can customise the graphā€™s title, axes, legend, generate aggregate values, and overlay data series from multiple devices and measurement types. For the time being Iā€™ll leave you to experiment.

In future posts Iā€™ll share some of the more-advanced charts and dashboards Iā€™ve created, including use of the templating and annotation features. Weā€™ll also look at configuring data retention policies and down-sampling data in InfluxDB.

7 Likes

The above directions will walk you through the process to install Influxdb and grafana on a computer running ubuntu. You can install it on allot of different platfoorms, but the steps are basically the same.I just did it to validate the changes i made to the original document creatd by codersour. The longest part was installing Ubuntu on a VM The rest maybe took 20-30 mi since it was just running a few commands I hope this helps folks needing a walkthrough to do it.

2 Likes

The latest version of InfluxDB logger has been added to HPM to make it easier to install.

I have also found a fork that was updated to use InfluxDB2.x, but after testing it out i am not sure it is a wise direction to go. It isn't nearly as user friendly to setup initially or use in Grafana.

5 Likes