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

Camera definitely updates and works perfectly.

Just set this up myself using the generic camera url and it is updating. No need for command line sensor sorry i guess i misread.

To me is the same first still image of 5 days ago

most definetely I am doing something wrong here. Could someone explain how to do for a simple sensor?

Most likely your image URL has from and to. You can navigate to the URL on a regular browser and see if you are getting the updated image.

no, I took it out, but the problem lies in Grafana, there the sensor does not updtae

ERROR:homeassistant.util.yaml:mapping values are not allowed here in “/config/configuration.yaml”, line 78, column 39

what’s wrong with the code ?

sensor:
  - platform: command_line
    name: "Download Grafana"
    command: curl -s -H "Authorization: Bearer xxxxxxxxx" http://192.168.0.205:3000/d/IbSj6Egmz/lyric-t6?orgId=1&panelId=1&width=1000&height=500&tz=UTC-05%3A00" > /volume1/HASS/downloads/temperatuur.png

camera:
  - platform: local_file
    name: Grafana_temperature
    file_path: /volume1/HASS/downloads/temperatuur.png

Which line is line 78?

Try adding quotes around the curl command like you did with the sensor name.

You are missing a quote in command.

1 Like
- platform: command_line
    name: "Download Grafana"
    command: curl -s -H "Authorization: Bearer 12345694R0lxMWFZS3VneHd5Q2w0dzdZUmwzVE5wa1JOSTciLCJuIjoiSEFTUyIsImlkIjoxfQ==" "http://192.168.0.205:3000/render/d-solo/IbSj6Egmz/lyric-t6?orgId=1&panelId=2&from=1521500400000&to=1521576165006&width=1000&height=500&tz=UTC%2B01%3A00" > /volume1/j/HASS/downloads/temperatuur.png

ERROR:homeassistant.util.yaml:mapping values are not allowed here in “/config/configuration.yaml”, line 85, column 39

Line 85 is the command line. I added a quote ( thanks to @arsaboo). But it is not OK :frowning:

I have no way to test this, but try this:

- platform: command_line
  name: "Download Grafana"
  command: "curl -s -H 'Authorization: Bearer 12345694R0lxMWFZS3VneHd5Q2w0dzdZUmwzVE5wa1JOSTciLCJuIjoiSEFTUyIsImlkIjoxfQ==' http://192.168.0.205:3000/render/d-solo/IbSj6Egmz/lyric-t6?orgId=1&panelId=2&from=1521500400000&to=1521576165006&width=1000&height=500&tz=UTC%2B01%3A00 > /volume1/j/HASS/downloads/temperatuur.png"
1 Like

I get no mapping error anymore, but the “command failed”

can nobody help me ?

I would suggest trying the command from the command line (via ssh) to see if it works to begin with. Don’t forget to try it as the same user that starts Home Assistant (most likely hass or homeassistant). If you run Home Assistant within a virtuel env, activate that as well before trying the command.

If it results in an error, it’ll likely show you exactly what the problem is.

1 Like

Hey @fanaticDavid. That was a good tip !

curl -s -H "Authorization: Bearer eyJrIjoiaDI4R0lxMWFZS3VneHd5Q2w0132123dzdZUmwzVE5wa1JOSTciLCJuIjoiSEFTUyIsImlkIjoxfQ==" "http://192.168.0.205:3000/render/d-solo/IbSj6Egmz/lyric-t6?refresh=15m&orgId=1&panelId=2&from=1521791134370&to=1521877534370&width=500&height=250&tz=UTC%2B01%3A00" > /volume1/j/HASS/downloads/temperatuur.png

this code makes a temperatuur.png. But it’s a file from 1 kb en not viewable :frowning:

I think you should only keep the required options in the URL, e.g., remove from, to, and refresh from the URL. Do you see the image when you navigate to the URL>

If i remove the from and to, nothing changes
I can browse to the image. Very strange

Just a guess, but try adding a “-L” to the command. curl does not follow redirects like a browser does.

If I use the direct link ( with camera) how can I make it update every x minutes/hours ?

Greets

Camera component automatically fetches the new image every few (30, I guess) seconds.