Problem with showing camera's from HA on Appdaemon Dashboard?

I see tokens being assigned to camera in my HA log, but not specifically “New access token:”. The Appdaemon log only shows dashboards disconnects when refreshing the dashboard. Is there a way to get more info from Appdaemon?

Sorry, I meant that you should check the javascript console in the browser (Press F12). The widget is logging some info there.

I don’t think its a Appdaemon issue, but here are the log options I use. Adjust the paths as needed.

log:
  accessfile: /home/appdaemon/logs/access.log
  errorfile: /home/appdaemon/logs/error.log
  logfile: /home/appdaemon/logs/appdaemon.log
  diagfile: /home/appdaemon/logs/diag.log
  log_generations: 5
  log_size: 50000

Sure, I will check on that this afternoon :+1:

Ok so, strange discovery. The stream freezes, but new tokens are still created. This appears under each new token creation:

application.js:2556 Uncaught TypeError: self.set_view is not a function
    at Object.OnStateUpdate [as update] (application.js:2556)
    at basecamerastream.WidgetBase.on_ha_data (dashboard.js:242)
    at dashboard.js:57
    at Array.forEach (<anonymous>)
    at a.webSocket.onmessage (dashboard.js:53)
    at HTMLDivElement.<anonymous> (reconnecting-websocket.min.js:1)
    at WebSocket.h.onmessage (reconnecting-websocket.min.js:1)

Ok!

There is an error on line 19 which I will correct. Until I have uploaded the change, you can edit the basecamerastream.js as follows:

function OnStateUpdate(self, state)
    {
        console.log("New access token: ", state.attributes['access_token'])
        self.set_view(self, state)
    }

Change the above to:

function OnStateUpdate(self, state)
    {
        console.log("New access token: ", state.attributes['access_token'])
        set_view(self, state)
    }
2 Likes

And I have updated the repo on github now. https://github.com/tjntomas/HADashboard-widgets/tree/master/custom_widgets/basecamerastream

2 Likes

Perfect, thank you!!

Glad you got it working. Please note that I found an error in the code through the logs that @TheLaw posted, so you should download the updated files again from the repo.

1 Like

Sounds great, I’ll have a look at it.

Tested and working perfectly! I appreciate the quick response and updates!

1 Like

I realize this is an old thread, but relevant to an issue I am having with AppDaemon 4.0 Camera Widget. With the recent announcement that AD3 is being deprecated I wanted to move all my ha dashboards to AD4. I was able to finally get everything working again, but I have to blow away the appdaemon directory in the config folder. I think it contained some custom widgets and other stuff that was not compatible with AD4.

I was able to recreate all my dashboards and for the most part everything is working OK. However, the one issue I do have is unlike the old Camera Widget in AD3, now when you tap on a Camera image it takes you to the URL of the camera. Which means there is no return or timeout option. If on a tablet running the fully browser, this means once someone clicks on a Camera image and it goes to the Camera URL and it does not timeout and return to the dashboard screen. The only way I have found to get it back to the dashboard is to manually go into the fully settings and reload the main dashboard.

Is anyone aware of how to control the tap action for when users tap on a Camera widget when using AD4? I would like to have the tap action ignored or at least have the ability to put in a return or timeout argument in the URL. If anyone else has run across this issue, I would love to hear how you resolved it.

Thanks for the support.

Same problem as you Andrew, after moving to AD4 the camera feeds won’t work, this being a ring camera. In AD3 it worked however after 30 mins with no activity a blank image would appear, then as soon as they was movement a new image refreshed. In AD4 its just a continuous blank image. If anyone has any ideas on is able to share their dashboard entity I’d be most appreciative.

Thanks

my entry.

garden_camera:
    widget_type: camera
    entity: camera.garden_2
    base_url: http:/192.168.1.48:8123
    title: Garden
    refresh: 200
    widget_style: "background: Black;"

@CheekyKangaroo You have a refresh rate but are not indicating it is a stream. “stream: 1” would do this.

@AJ132 I am having the same issue as you. I have no idea why they decided to make the camera widget function this way.

I was previously using:
Fullscreen images (cameras, weather radars) on click for HADashboard
which really is how the official should function.

Thanks Christopher, Just to update you I managed to get this working with some value help from Renetoad. Mine is not a steaming cam I simply just display last activity on my dashboard and it also helps with the load on my Pi4’s CPU running kiosk browser which tend to get quite hot, thanks anyway your correct stream should be used if streaming constantly.

I believe the problem may of been a few issues combined.

  1. I removed any residence of custom components that I had lurking around previously for the camera when I was using HA 3. This didn’t fix it but think it may of been a contributing factor.

  2. I spent a fair bit of time trying a few combinations of the base url , i.e. direct internal IP, external dns. For me at least the external worked. base_url: https://mysite.duckdns.org the difference between having not a ‘/’ on the end I believe did the trick i.e. this https://mysite.duckdns.org and not this https://mysite.duckdns.org/

Finally I restarted the hassio core and all working perfectly.
The end script entry ended up like this

garden_camera:
widget_type: camera
entity: camera.garden_2
base_url: https://mysite.duckdns.org
title: Garden
refresh: 900
widget_style: “background: Black;”

1 Like

Kanga/Christopher.

I was able to get my cameras working again by following a similar approach as Kanga. I completely removed all the custom camera components related to AD3 and then installed AD4. I was able to get my ReoLink cameras working using the following setup in my AD Dashboard config files.

back_door_camera:
  widget_type: camera
  entity: camera.back_door
  base_url: http://192.168.1.50:8123
  # password: !secret ha_pwd
  refresh: 0
  stream: 1

Hope this helps. The custom camera components don’t appear to have been updated to work with AD4 yet (at least the last time I checked).

I followed everything on here and I still can’t get my cameras working in AD4.0.2. My cameras Nest hello and wyze cams are streaming in HA, just not in AD.
Here’s my config:

garage_cam:
  widget_type: camera
  entity: camera.wyze_garage
  base_url: http://192.168.111.54:8123
  title: Garage
  stream: 1

here’s my app daemon config

logs:
  main_log:
    filename: /conf/logs/ad.log
  error_log:
    filename: /conf/logs/error.log
appdaemon:
  latitude: <lat>
  longitude: <long>
  elevation: <ele>
  time_zone: <tz>.
  disable_apps: 1
  threads: 10
  plugins:
    HASS:
      type: hass
      ha_url: http://192.168.111.54:8123
      token: <token>
api:
admin:
hadashboard:
  dash_url: http://$HOSTNAME:8123
http:
  url: http://192.168.111.56:8123

any help is appreciated

My appdaeming looks like this:

---
secrets: /config/secrets.yaml
appdaemon:
  latitude: 1.1
  longitude: 2.2
  elevation: 2
  dash_ssl_certificate: /ssl/fullchain.pem
  dash_ssl_key: /ssl/privkey.key
  time_zone: Europe/Copenhagen
  plugins:
    HASS:
      type: hass
http:
  url: http://127.0.0.1:5050
admin:
api:
hadashboard:

I have the camera configured like this in dashboard:
(this is the nest frontdoor)

##
## Main arguments, all optional
##
## Acer Iconia 1280x800

title: Hovedside
widget_dimensions: [123,128]
widget_size: [1, 1]
widget_margins: [5, 5]
columns: 10

global_parameters:
    use_comma: 0
    precision: 1
    use_hass_icon: 1
    namespace: default

frontdoor:
    widget_type: camerastream
    entity: camera.front_door
    title: Hoveddør
    base_url: "https://url:8123"

Please note, I use the camerastream custom widget.

1 Like

Thanks, let me try that

So my nest doorbell can works, but my wyze cams still don’t using cameras stream widget which is a bummer.