shouldnt you provide a state for the trigger?
an app that listens for a sensor state would be like this:
import appdaemon.plugins.hass.hassapi as hass
class Navigate(hass.Hass):
def initialize(self):
# Listen for the state change from the entity.
self.listen_state(self.navigate,self.args["entity"], new=self.args["state"])
def navigate(self, entity, attribute, old, new, kwargs):
# Get the target from the args.
target = self.args["target"]
# Get the timeout from the args, if supplied.
if 'timeout' in self.args:
timeout = self.args['timeout']
self.dash_navigate("/" + target, timeout=timeout)
else:
self.dash_navigate("/" + target)
then in the apps.yaml you use it like:
front_door_motion: #the name from the app
module: navigate
class: Navigate
entity: binary_sensor.front_door_motion # or any other entity
state: "on" # the state to listen for
target: Hello3Test # the dashboardname
timeout: 20 # the amount of time the dashboard stays visible
you can create as many apps as you want, just by adding this YAML to the apps.yaml file again, with another appname.