Graphing / Charting Temp/Power Data

Hi,

I know this has been asked a few times already, so my expectations for a new or different solution are low... I am expecting I will be looking at the InfluxDB and Grafana options, either on Windows or a variation of Linux (most likely Rasberry Pi)...

I want to produce a chart / graph of the recent history of the temperature within my home, using my existing Philips Hue Motion Sensors and SensorPush Sensors. I'm not concerned about "real-time" information for this outcome, more so the temperature / humidity in last few hours / days.

I only want the charts to display historical information for me to respond to personally (manually), any automation I will handle through a separate automation driver / app that I (others) will develop.

Thanks,
Simon

I have implemented this using InfluxDB and Graphana. I use a combination of data going from hubitat-->InfluxDB as well as directly from the sensors (mostly Pis in my case) to InfluxDB to cut the extra step out. The InfluxDB App is working well for me. I am mostly tracking temperatures, but also water flow rates and have doen some work with energy usage monitoring graphs.

A final step I am still working on is bringing some of the graphs back to Hubitat/Sharp.IO dashboards. I have to get Graphana image rending working on the Pi or another device to close that loop.

Thanks for the reply Brad. I think I'll end up with a similar solution, so good to hear there are others already implementing it. I'll probably stick to a Windows setup, but apart from that most things will be the same.

The influxdb app has a spotty history reading potential for slowing down the hub. They may have fixed it now by employing async calls, so this may no longer be an issue. You might consider going the MakerAPI, Event Socket, Node-red, Influxdb route instead that doesnt load the hub at all.

1 Like

Thanks for the tip Jon. Thankfully I'm not in any great hurry so can do some research and test out some different approaches, which is often half the fun.

The alternate setup you described, do you know if that is possible on a Windows platform, or is it typically run on a Linux / Pi setup?

Thanks

I originally had this running on a Win10 box and it worked perfectly. You just need to follow the Windows install instructions for each app ie Influxdb, Grafana and nodeRed. I also used NSSM to get each app to auto start as a service.

Influxdb:

Grafana:

Nodered:
https://nodered.org/docs/getting-started/windows

NSSM:
https://nssm.cc/

2 Likes

Thanks @stephack, I'll use your notes as a starting point. I'm working through accessing data from my sensors at the moment and will then start to look at recording the historical results. When I do I'll start with the instructions you've provided.

Simon

Has anyone gotten grafana graphs into dashboards yet?

The dashboard won’t accept an iframe and the image option for sharing doesn’t seem to update.

Hi @potts.mike,

I haven't got back to this yet. I was able to get live readings coming through for my sensors, but haven't looked at recording history or reporting that history on a chart. My time spent on HE has been sporadic and I have a few other things ahead of this in my list.

I would also be interested to hear anyone else's experience.

I’ve started down the path of installing the grafana-image-render Docker. It will generate a new .png every 15 min that I should be able to show in a dashboard.

1 Like

Any unraid docker experts here?

I need to do the below using environmental variables in unraid

*version: '2'*

*services:*
*  grafana:*
*    image: grafana/grafana:master*
*    ports:*
*     - "3000:3000"*
*    environment:*
*      GF_RENDERING_SERVER_URL: http://renderer:8081/render*
*      GF_RENDERING_CALLBACK_URL: http://grafana:3000/*
*      GF_LOG_FILTERS: rendering:debug*
*  renderer:*
*    image: grafana/grafana-image-renderer:latest*
*    ports:*
*      - 8081*

I've got it rendering the images that show in my browser alone. The image is not loading into the dashboard and the image isn't updating as I expected. I need to do some more research on how this should work.

It's taken me a while but I got around to reporting my temperature and humidity readings through grafana, ultimately on a Raspberry Pi (Debian) rather than Windows.

I followed @asj 's notes on the post New Hubitat to InfluxDB Bridge via MakerAPI+Node [beta]

Happy to share any experiences with anyone attempting the same setup.

Simon

1 Like

Hi @potts.mike,

I noticed your post from back in Jan trying to get Grafana charts on your dashboard. I was able to achieve this recently and thought I'd share my solution. I posted briefly about it here, showing the outcome, but didn't include any of the details. There would be a neater solution than this, but..

  1. I setup a new virtual device using the Tile Master tile driver. The normal use of this driver is for devices created using the App of the same name, but I simply created a new virtual device manually through the HE Web UI.
  2. In the Grafana web front-end I opened my dashboard, clicked the drop-down menu above any panel on the dashboard and selected "Share Panel", grabbing the embed code from the pop-up that appears. I then swapped the panel's URL in the embed code with the URL for the entire dashboard.
    Before we can use this embed code in HE, some configuration changes need to be made to Grafana, in my case on my raspberry pi.
    2.1) Update the Grafana config file to enable embedding, achieved by (in my case) updating the /etc/grafana/grafana.ini file, uncommenting and adjusting the settings shown below. Note, any hashes or semi-colons need to be removed, otherwise the changes will be ignored.
    allow_embedding = true
    cookie_samesite = lax
    See this article for more details
    2.2) Update the auth_anonymous section of the grafana.ini config file to enable anonyous login
    2.3) Remember to restart your grafana service once the configuration changes are saved
  3. Back in HE, on the device configuration screen for the virtual Tile Master device, paste the dashboard embed code into the parameter text field for the sendTile01 command button and click the button to run the command. An example of the embed code is shown below:

<iframe src="http://192.168.0.29:3000/d/fZew_iiRk/hubitat-climate-charts?orgId=1&refresh=30s&from=now-1h&to=now&var-Sensor=Kitchen %2F Dining&var-Sensor=Master Bedroom&var-Sensor=Study&var-Sensor=Third Bedroom&kiosk" width="900" height="2000" frameborder="0"></iframe>

In addition to the embed code from previous steps, the following adjustments may also be needed:

  • The width and height settings may need to be adjusted based on the HE dashboard layout where the tile will be displayed
  • The from and to settings can be provided as part of the URL, e.g. the last 1 hour
  • The &kiosk parameter will remove all the menus and other Grafana UI elements around the dashboard

  1. Lastly, add the Tile Master device to a HE dashboard, selecting the attribute template and the tm-tile01 attribute. Some adjustments may be necessary to some of the settings listed in the IFRAME from step 3.

Hope this helps,
Simon

3 Likes

I’m definitely trying this tonight

1 Like

What do you mean in step 2?

I added the embedded url from grafana but it’s not loading in the dashboard.

Grafana URL
iframe src="http://192.168.0.100:3000/d-solo/UO7rBG3Wk/washer-test?orgId=1&refresh=30s&from=1587242367912&to=1587263967912&panelId=2" width="450" height="200" frameborder="0"></iframe

Ah yes, I did miss a step, you need to enable embedding within Grafana. Give me a minute and I'll find the setting.

Hi @potts.mike,

I have updated my earlier post to include change I needed to make in the grafana config to allow embedding (steps 2.1 and 2.2). Hopefully this makes sense. From the article I listed, don't forget to remove the semi-colon from the beginning of the two config items in the grafana.ini file, so they are no longer commented out.

Simon

I believe I updated the auth_anonymous section to allow anonymous login as well, I'll update the steps again.

I need to do some research on how to change the settings in a docker, probably using environmental variables.