Complete guide on setting up Grafana/InfluxDB with Home assistant using official Docker images

Thanks for the rapid feedback.

So I changed to the Direct link rendered image as suggested. Pasting the link into a browser leads to a timeout message in Grafana and when I restart Home Assistant, I get the message (Image not available)

You need to resolve that issue (image appearing in the browser), before you can get it working in HA. Not sure why it is giving you a timeout.

SOLVED: So your last reply led me to look more into the way Grafana works and the particular error message that I was receiving in the Docker container. After some googling and some trial and error, I realised the problem lay in the Grafana docker configuration. In Network mode of the Docker container, I had chosen NAT instead of Host. Changing the setting to the latter and restarting the docker container solved the problem. Thanks for your suggestions.

is anybody using PieChart? would be nice if someone could give me an example how to visualize the state of a device_tracker or input_boolean!

Hey guys!

I am having the same problem than Swiss - the ā€œcameraā€ doesnā€™t show any image. It seems that I created a direct link - I am using grafana v5.4.2 which doesnā€™t have a separate option for a direct link:

But when I open the link in a browser, I have to put in the username and password?! Is this the problem? Or do I miss something in the code:

camera:
  - platform: generic
    name: Grafana
    still_image_url: 'http://192.168.0.104:3000/d/5aSrEzymk/home?orgId=1&from=1545036703211&to=1545079903211&theme=dark'
    username: !secret grafana_user
    password: !secret grafana_pwd

Just wanted to give a heads up that if you are doing this on a Raspberry Pi to google around a bit for the fact that the pi run ARM processor.

I am running everything in Docker container on my QNAP NAS. This is using an Intel Dual Core CPU and 8GB RAM.

Any ideas ?

Using 5.4.1 this is the box that I get when I click share. Has the Direct link rendered image you click on, it opens in a new window, then you just copy the link from that window. Not sure if 5.4.2 is different.

@azrael783 You are probably trying to share the entire dashboard. You need to click on a panel where you would normally edit at the top and then select sharing from there. You should then see the option for the direct render image.

HTH

@tmorton: Thanks a lot! That was indeed the problem :wink:

1 Like

So Iā€™m getting a timeout error on the direct link rendered image. Anybody have a suggestion of what I can do?

I want to display some graphs in my dashboard (lovelace-ui)
I followed the instructions found here.

In configuration.yaml I have

camera 8:
  - platform: generic
    name: Grafana Power
    still_image_url: http://taditadida.duckdns.org:3000/d/JzhkcEggk/energie?orgId=1&from=now-24h&to=now
    
    username: usrname
    password: pwrd

and in lovelace-ui

  - title: Energie
    cards:
    - type: custom:mini-graph-card
      entities:
      - entity: sensor.power_consumption
        name: Actueel verbruik 

When I use the url in a browser the grafana-dashboard will be displayed
the state of this entity remains idle :

access_token: fe76beb21ba0af0xxxxxxxxxxxxxxxxxxxxxxx3697876bdc1989
friendly_name: Grafana Power
entity_picture: /api/camera_proxy/camera.grafana_power?token=fe76beb21ba0af0b56xxxxxxxxxxxxxxxxxxxxx97876bdc1989
supported_features: 0

The token must have been automatically created because I did not do anything to it.
In some examples the url comes with a apostrophe and some donā€™t . Both donā€™t work for me.

What do I have to change ?

Hi this guide is good, Iā€™ve managed to get Grafana to make a Graph from my database.

However, when I click [Direct link rendered image] is gives the following error:

grafana_error

Has anyone else had this problem? Any ideas on how I can fix it? Also how to I check the server logs? Thanks :slight_smile:

same problem here. I am on a RPI3+
It is a little confusing. In this guide it says :

Known issues and limitations

  • This add-on does support ARM-based devices, nevertheless, they must at least be an ARMv7 device. (Raspberry Pi 1 and Zero is not supported).
  • The ARM versions (e.g, Raspberry Pi) do not have support for PhantomJS, since Grafana does not support it. The PhantomJS project has been abandoned as well. Grafana expects to solve this in Grafana 6.

But in the logging is : msg=ā€œRendering failed - PhantomJS isnā€™t included in arm build per defaultā€ logger=context userId=1 orgId=1 uname=xxxxx error=ā€œPhantomJS executable not foundā€

I canā€™t see what you quoted in this guide, but I managed to fix it in the end, I just had to put the PhantomJS file in the grafana folder and now it works. :slight_smile: Itā€™s a little slow on a Pi2 but itā€™s better than nothing!

Did you install Grafana from the addon-store ?
I canā€™t find a phantomJS file nor a Grafana folder

I did try the addon but I gave up trying to fix it, so Iā€™m now using Grafana on Raspbian Stretch.

You need phantomjs from here: https://github.com/shabadoo75/phantomjs-2.1.1-raspberrypi-armv7/

And the folder you need to install it is /usr/share/grafana/tools/phantomjs/

If this works for you let me know :slight_smile:

It did not work, allthough I must admit that I have no knowledge of diving deeper into to system .

I created the folders you mentioned and copied the phantomjs file to it.
After reboot, folders and file were gone :frowning:

It is strange that phantomjs not is included into the hassio-addin, but there will be good reasons for that I suppose.

Well it was worth a try, it may only work if youā€™re running grafana under raspbian I guess.

PhantomJS is also not included with the normal raspbian install of grafana, I have no idea why but Iā€™m sure the devs have their reasons.

I am using grafana with influxdb, both installed by hassio addons, on my rpi3b+.
Itā€™s nice that I can use it.
There one problem, donā€™t know, if itā€™s only me facing it.
I am using sonoff pow with Tasmota on it.
When I try to look at my graph for 2 days itā€™s ok with my system.
When I try 7 days graph itā€™s bit slow to show.
And when I try for 30 days or more, My system gets hang.
I resetted my whole data yesterday,
When there is no data older than one day, it hangs when I select more than 30 days chart.

Donā€™t know what might be the problem.
Can some one guide me what to do.