HTTP 500 Errors with camera

Hi

I have a problem with adding a camera. For simplicity my dashboards configs are in the same directory as the HA configs

2017-09-16_14-19-01

Dashboard Structure

I have tried adding a camera but whenever attempting to display the dashboard I get a 500 error.

I can’t seem to find a log file for appdaemon anywhere, I have tried running it in foreground with the -D DEBUG option but no error is displayed.

The code for the dashboard is as follows

##
## Main arguments, all optional
##
title: Lounge
widget_dimensions: [120, 120]
widget_margins: [5, 5]
columns: 9

lights_label:
    widget_type: label
    text: Lights

switches_label:
    widget_type: label
    text: Switches

environment_label:
    widget_type: label
    text: Conditions

security_label:
    widget_type: label
    text: Security

lounge_temp:
    widget_type: gauge
    title: Temp
    min: 0
    max: 50
    units: "°C"
    entity: sensor.netatmo_indoor_temperature

lounge_humidity:
    widget_type: gauge
    title: Humidity
    min: 0
    max: 100
    units: "%"
    entity: sensor.netatmo_indoor_humidity

lounge_noise:
    widget_type: gauge
    title: Noise
    min: 0
    max: 100
    units: "dB"
    entity: sensor.netatmo_indoor_noise

lounge_co2:
    widget_type: gauge
    title: Co2
    min: 0
    max: 2000
    units: "ppm"
    entity: sensor.netatmo_indoor_co2

living_room:
    widget_type: camera
    title: Living Room
    #refresh: 1
    entity_picture: !secret lounge_cam_url

layout:
  - include: header
  - lights_label(2x1), light.lounge
  - switches_label(2x1), switch.alex, switch.becs
  - environment_label(2x1), lounge_temp, lounge_humidity, lounge_co2, lounge_noise
  - security_label(2x1), sensor.lounge_motion, sensor.back_door

The relevant section of the secrets file, url, password and token have been redacted. The url is the external domain for the HA installation not a local IP.

Doing a local curl of the url does provide a still image as expected so the url is okand the camera is working fine in HA.

I have not added the camera to the dashboard, the error is thrown with just the definition.

# Cameras
lounge_cam_url: https://<redacted>/api/camera_proxy/camera.lounge?token=<redacted>&api_password=<redacted>

Anyone have any ideas?

Thanks

Alex

i would try it without the token, but i suspect that the problem is httpS
you probably have setup encryption for HA which can be a problem.

if your setup is correct and if HA and AD are on the same device there should not be a problem to reach HA without encryption like:

http://ip:8123/api/camera_proxy/camera.lounge?api_password=

if you get a picture when you try that in a browser then i should use that.

and to be sure just first add it in your dash and not in secret.

Thanks for the quick reply.

I have tried that but still get the same 500 error. I have …

  1. Removed all SSL from HA and Appdaemon
  2. Tried the IP camera url in a browser (works fine). This was without the token
  3. Add it to the dash in the dash file

Still getting a 500 error :frowning:

Cheers

Alex

did you clear cache in between trying?
did you clear the compiled dir in between trying?

did you try just this:

title: Lounge
widget_dimensions: [120, 120]
widget_margins: [5, 5]
columns: 9

living_roomcam:
    widget_type: camera
    title: Living Room
    entity_picture: http://<redacted>/api/camera_proxy/camera.lounge?api_password=<redacted>

layout:
  - living_roomcam

Hi

Again thanks for the reply

I didn’t clear the cache but did force a recompile from the browser. I did try just adding the url to the dash rather than using secrets.

Thanks

Alex

make sure you deleted the compiled files after an errorpage, to be sure that it is recompiled.
from the browser you cant force that.

and try to make a new dashboard like i showed, to make sure its working.

Perfect thanks.

Clearing the compiled directories has removed the 500 error but only if the camera url is in the dash file. If I put the camera url in the secrets file its not working but I will dig into that a bit more

Cheers

Alex

1 Like

you could try to make it quoted with single or double quote (remember to clear before you retry)
its probably a YAML error that triggers the 500 error page.

I tried using double quotes and clearing the cache but still no luck, not getting the 500 error just no image

I’ll start digging through the code as I suspect it cannot find the secret, the src attribute in the iFrame is null which leads me to think it cannot find the value

Cheers

Alex