AppDaemon Adding Parameters To URL on Navigate Widget
I'm having an issue when using the config below. I'm trying to link to an external link but it errors out because AppDaemon adds ?skin=default to the tail end of the URL and some things (like HA Camera Proxy) don't appreciate the extra parameter on the URL. Ideally, the parameter should only be passed if there's currently one in the URL or make it optional because you never know where externally somebody is going and whether the extra param breaks things. Secondly, it would be great if one could specify whether the window should open in a "_blank" new window/tab or take over the current window. Please see my example below and let me know if there are any questions. Thank you for this AMAZING add-on which makes every old tablet useful for HA!
load_amcrest_children:
widget_type: navigate
title: Amcrest Children
icon: mdi-camera
url: http://192.168.1.123:8123/api/camera_proxy/camera.amcrest_children?api_password=mylegacypassword
Hi there - the way around this is to use the args section of the widget config, as per the docs:
https://appdaemon.readthedocs.io/en/latest/DASHBOARD_CREATION.html#id73
load_amcrest_children:
widget_type: navigate
title: Amcrest Children
icon: mdi-camera
url: http://192.168.1.123:8123/api/camera_proxy/camera.amcrest_children
args:
api_password: mylegacypassword
Regarding the request to open a blank page - I'll keep this issue open to remind me to do that.
and the other option is to create a dashboard that shows the camera fullscreen and navigate to that dashboard. the advantage is that you can even make it a bit smaller and still add other widgets to it.
Yep, both of those options seem to work well especially when I use the camera_proxy devices type in HA in order to limit/customize the dimensions of the camera feed. I tried your way @ReneTode but the camera feed in that iframe was huge and had large scroll bars. Camera_proxy HA component (lets you specify image width) was a perfect workaround for that. So now I can indeed see all 4 cameras on a single AppDaemon dashboard and it looks great. I'm so damn close to the ideals I've had in my mind for years with this stuff.
@acockburn appreciate the consideration for ability to control the target tag in HTML. It'll be a much welcome enhancement.
I do have one left over problem (BTW, I am using your dev branch with the socksio and iPad 1 support and a few other ones like old 3.0.2 and the socksjs version from the community post --- all have the same result). Using the exact widget example you posted above and the icon definition, it still uses the fa-gear icon instead of the mdi-camera icon I define. Not sure how to fix that as I've tried many things. I do have these things in my yaml. As an FYI, the socksio version in the dev branch is not working while the socksjs docker image is updating devices as expected. On the community thread you mentioned to clean cache and recompile dashboards. I'll try Googling that but I did dump the appdaemon/compiled folder to no avail.
hadashboard:
dash_url: http://192.168.1.123:5050
dash_dir: /conf/dashboards
transport: socketio
fa4compatibility: 1
Appreciate the help very much gents!
UPDATE: clearing browser cache in multiple browsers did not help with the fa-gear icon on a navigate widget.
I tried your way @ReneTode but the camera feed in that iframe was huge and had large scroll bars
i was not talking about using an iframe. my suggestion (which i use) is to create a dashboard like:
title: camera
widget_dimensions: [100, 98]
widget_size: [1,1]
widget_margins: [2, 2]
columns: 10
layout:
- my_camera(10x6)
my_camera:
widget_type: camera
entity_picture: http://ha_ip:8123/api/camera_proxy_stream/camera.hoofdterrascam?api_password=mypw
title: hoofdterrascam
refresh: 120
and navigate to that. you wont get scrollbars at all.
Regarding socketio - ... I guess I'll have to add socksjs support as well then ...
Yep, you picked the wrong pair of socks to implement :) I've had great success with the socksjs version and an older iPad 1 (Safari, Chrome & Dolphin browsers) updating tiles with no issues. The first/original socksio implementation from the community post never worked for me, only socksjs consistently worked. Thanks again for your amazing contribution @acockburn!!!
@ReneTode appreciate you taking the time to put that snippet together and making my life easier w/o having to use HA camera_proxy for width control, etc.
@acockburn sorry to bug you but I was wondering if socksjs ever made its way into your official releases? Thanks!
Hi there - it's been a while since we had an official release ;) We are currently in beta for 4.0 and it's my intention to get this in before we release 4.0 final.
I was using the word official loosely :) appreciate the response and the effort @acockburn !!!
FYI - tracking the SocksJS issue in #469