AI and Hubitat

So at work we license MS Copilot and I use Gemini quite a bit. For grins I told copilot to read all of the hubitat developer docs. I also let it read a exported rule of mine. Now, it can create new rules from scratch and I just have to import them. I will let y'all know how that goes :slight_smile:

I can literally just tell it "make me a rule that turns all of a list of lights on at sunset" and it will do it. Again, still testing but I will follow up with results.

1 Like

for the same "price" you could have it create a Custom App to do the same. Rule Machine just creates child apps of RM.

3 Likes

I would really not take this approach -- exports/imports aren't meant to be edited, and the chances of AI "knowing" internal setting names and other app data (which is what this contains -- not anything in the developer docs you fed the model) that an RM rule might use are low. This could lead to corrupted rules or other problems.

A better approach, if you want to do this, would be to ask it to write a regular Hubitat app instead (in Groovy). This code is intended to be user-editable, and you won't run into the above problem. You many run into others (some here have), but you're at least not building a house on sand. :slight_smile:

6 Likes

@bertabcd1234 answer is certainly better worded than mine, so I agree :smiley:

Elsewhere I've described my short exploration of how to get AI to create custom Apps with good results IF you provide some additional instructions.

4 Likes

Agreed, just found that out
My original interest was to help with device and app writing, I will stick to that.

1 Like

I see I'm just repeating what @csteele and @bertabcd1234 just posted while I was writing this...

Why stay with rules at that point? I've played around with AI to write automations into Hubitat apps directly. It does pretty well for simpler stuff, and it is also good for creating virtual devices if you need a virtual devices with some special feature.

It is a good way to start learning groovy for apps code. AI gets you most of the way there, but you should understand what it is doing. I still write my automation apps from scratch, but it has been fun playing with AI to see how it approaches writing the code.

3 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.