How to discover **Broken Action** easy

Recently I had to remove Chromecast Integration (beta) app and reinstall it. For wherever reason rediscovers didn't resync the devices. Or most likely I could solve it in a different way and... anyhow,

This process removes all my Chromecast devices, so all the rules that contain those devices become broken.

Since it will super annoying to look inside every rule to confirm they don't use any device. I create this script that you can use in your browser console (only tested for chrome), on the page app list /installedapp/list

Also, you can use it as a favelet.

Here is the code, I hope someone finds it useful.

Remember this is just a quick hack for an action that you probably won't execute very often.
After a few seconds, the rules with broken actions will turn red and green if has no issues are detected.

Disclaimer:
Only tested on Chrome.
Only work in "list mode" not in "grid mode".
If you have a lot of rules.. well this take can take a while since is made a request to your hub per every single rule.
This code is very sensible to HTML changes, I am using version 2.3.0.124

4 Likes

I wonder if - embedding it in an iFrame would produce results... drat. not easily.

Can you elaborate? Not sure I understand the goal

I was thinking that if I could embed your app into a webpage, then call it from a tile, I could click the tile to execute as needed and get a result. I used the 'Avatar' tool one of the really smart people has recently shared which allows embedding urls via iFrame. I gave it a quick try, pulling the page off my local webserver but I didn't put a lot of effort into it - it was just a quick experiment.

That's a cool thought.
These are the issues I can think of:

  • Only will work in private dashboards and not in public dashboards since this is not an API thing, the API doesn't provide this info. This is because you will need to read the app list page and for that, your browser needs to be logged into your hub.
  • This will ask too many queries (depending on the number of apps you have) for something that should not be a constant in your hubitat set up.

Shouldn't be difficult to create a script that calls the app list page, parse it, and print that list of apps, I think it is possible to skip the frame by just injecting js into the dashboard. You don't even need to render the page to extract this info.

Anyhow, this code is just a hack. If you are interested in evolve this for "investigation" proposes. Happy to hack around on this.

omg. I WISH! I'm currently preparing to move my house and business and can't afford the time right now... or I'd jump on it! I love web based development, it's my thing! I'll file this for a future fun thing to do!
I recently created a nice battery management thing, pushing json to googlesheets, built a webapp/mobile app that runs on the phone and push back into HE so I can display tiles just so I can track batteries (types, change dates, brands etc) - the kind of thing that's right in my wheelhouse. I'd so love to play with your idea - sigh. someday!!

1 Like

I've just added this using the tamper monkey extension for chrome, so it runs all the time on the apps page (when enabled).
Very useful as I had to reinstall echo speaks and it broke a lot of actions.

1 Like