bram2202
(Bram van Deventer)
September 3, 2017, 9:27pm
1
A few days ago i started to play with the HaDashboard,
and now i got a tablet on the wall displaying a lot of info. Great!!
Then i found in the dosc that its posible to switch to a other dashboad for a X given secconds and then back to de original.
This is perfect: i would like to show my front door cam for 10 secconds when the doorbel rings.
and after the 10 secconds return to the default page.
I created a second dashboard page only displaying one big cam widget.
Created a python script for listen to the doorbell state change
And created an “alias: Navigate” on the main dashboard page.
On the doorbell trigger the script runs (tested it with logging) but the dashboard does not change to the cam page?!
What am I doing wrong??
main.dash:
alias: Navigate
sequence:
- event: showcam
event_data:
command: navigate
timeout: 10
target: cam
tigger.py:
import appdaemon.appapi as appapi
class trigger(appapi.AppDaemon):
def initialize(self):
self.log("Trigger script start")
self.listen_state(self.doorbel, "switch.deur_bel", new = "on")
def doorbel(self, entity, attribute, old, new, kwargs):
self.log("DOORBEL!!!")
self.fire_event("showcam")
you need to create a custom event in HASS with the name showcam if i am correct.
but there is a much easier way.
in stead of using the line:
self.fire_event("showcam")
you can use
self.dash_navigate("cam", 10)
2 Likes
bram2202
(Bram van Deventer)
September 4, 2017, 2:26pm
3
Works like a charm! Thanks…
Didn’t find anything about this in de docs, how did you know this?
i thought it would be in the docs. @aimc ??
but i have insider information anyway.
aimc
(Andrew Cockburn)
September 4, 2017, 3:53pm
5
It was meant to be a secret @ReneTode - now everyone knows!
Actually for some reason it didn’t make it into the docs - I’ll add it.
1 Like
I also wanna use this hidden feature Can u please updat the docs
o boy, the cat is out the bag.
Can you share the code… I cannot get it to navigate when outside motion is triggered.
maybe you better share your code so we can tell you what isnt right in your code
vageesh79
(Sid)
September 17, 2017, 9:58am
10
This is the code i am trying -
import appdaemon.appapi as appapi
class trigger(appapi.AppDaemon):
def initialize(self):
self.log("Trigger script start")
self.listen_state(self.alrtcamera, "binary_sensor.es_motion_sensor", new = "on")
def alrtcamera(self, entity, attribute, old, new, kwargs):
self.log("ALRTCAMERA!!!")
self.dash_navigate("/camera", timeout=10, ret="/main_panel")
This is the main_panel.dash -
alias: Navigate
sequence:
- event: alrtcamera
event_data:
command: navigate
timeout: 10
target: camera
Still reading through all the docs…
self.dash_navigate("camera", timeout=10, ret="main_panel")
and main_dash should be a working dashboard (with only widgets and layout, so lose the navigate command)
and camara should also be a working dashboard
vageesh79
(Sid)
September 17, 2017, 10:35am
12
Thank Rene.Got it working and just finished reading your AppDaemon_for_Beginner Learned a lot and waiting for more
1 Like