Set Variable on Dashboard Change

Is it possible to set/reset a variable when the dashboard is changed or loaded?

I’m trying to reset a variable to an initial value when a specific dashboard gets loaded.

How is the dashboard getting loaded? Is it from a manual navigation or are you automating the loading of that particular dashboard based off some other event (eg. time, etc)

Hi,

Manual navigation. Basically, I would like to reset the value of a variable when my Home dashboard loads.

That limits your options a bit. What type of device(s) are you displaying the dashboard on? And are they using an app like Fully Kiosk Browser?

Fire 10 with Fully Kiosk Browser

That should open up some options for you. Not necessarily something ‘officially’ supported and may require some technical know-how, but there are some options available.

FKB Inject JavaScript
Fully Kiosk has the ability to inject JavaScript into the page. In theory, you could create a rule in SharpTools with an HTTP Trigger and then inject some JavaScript that would call your rule trigger whenever it detects that your target dashboard is loaded.

FKB Device Driver
There’s a Fully Kiosk Controller driver for Hubitat and I put together a driver for SmartThings (in beta) as a personal project which I’ve made available to SharpTools premium members. The downside with this approach is it only polls the device every minute, so if you quickly changed from the main dashboard to another dashboard and back under a minute, you wouldn’t see that change… and of course the inherent delay of having to wait up to a minute before the URL updates and your rule is triggered.

Thanks - much appreciated.