@mavrrick58, for the spirit of automation, mine was actually also created using A.I, using the Comet browser from Perplexity. I basically had the Hubitat custom app page opened, and told Perplexity in Comet what behavior I want, and Comet automatically clicked around, wrote the code, ran it and asked if it's what I want. It made some error (wrote the code for SmartThings), but I pasted the error message in the A.I, and the browser just fixed the code all on its own and re-ran it. WILD. It's not perfect, so definitely review the code before running it.
and of course, to complete the automation, it also automatically wrote this post here on the hubitat forum, and committed the code to GitHub with the readme page.
we live in a wild world now....
Not that it is good or bad, but looking through the code i kind of got that impression.
@Alan_F
I would be careful about subscribing and unscribing to devices as part of the app flow. It is my understanding that can be a bit system intensive. Also that could trigger a bunch of events to process each time the app cycles through the devices and makes changes.
@coolineho
AI really is a great tool and can do some impressive things. I have used it recently in a few apps. Mainly to help with specific modules instead of entire apps though. It seems to always need a little bit of tuning after created though. The larger and more complex the task the harder it seems to get it just right.
All that said these are pretty nifty tools guys.
Can you help me understand the issue? Do you mean it shouldn't unsubscribe and resubscribe multiple times? I don't think the current version of my app is doing that. Where else but in the app flow could the subscribe/unsubscribe happen?
Thanks for calling my attention to that part of the code, because I still hadn't caught all the AI's mistakes. Some stop events weren't unsubscribing from the bulb events, and the second time it ran, it wasn't resubscribing. Plus, I was subscribing to the bulb "level" and then ignoring it, which was pointless, so it no longer subscribes to that attribute. I just pushed a new version to GitHub.