I just wanted to revive an old post about creative Rule Machine rules. I used Google’s Gemini to completely write a rule from scratch and it works. Now I’m interested in what the community is doing and if they might wanna share their favorite rules with the rest of us.
The Goal:
I told Gemini that I wanted to when the Garage doors or the Fridge doors have been open and stays for more than 15 minutes. I want the complete list spoken to me at once and if devices are opened or closed during that 15, update the list. Gemini wrote this (minus the device names of course).
Set Private Boolean(false) False
While (Garage Door 1, Garage Door 2, Garage Door 3 any door is open(F) OR
Bar Fridge freezer door, Bar Fridge fridge door, Rec Room-Door, Front Door, Kitchen Fridge Fridge door, Kitchen Fridge Freezer door any contact is open(T) [TRUE]) Repeat every 0:15:00
Set OpenDoorList to ' '
IF (Garage Door 1 door is open(F) [FALSE]) THEN
Set OpenDoorList to '%OpenDoorList% Garage Door 1,( Front Door, Garage Door 1,)'
END-IF
IF (Garage Door 2 door is open(F) [FALSE]) THEN
Set OpenDoorList to '%OpenDoorList% Garage Door 2,( Front Door, Garage Door 2,)'
END-IF
IF (Garage Door 3 door is open(F) [FALSE]) THEN
Set OpenDoorList to '%OpenDoorList% Garage Door 3,( Front Door, Garage Door 3,)'
END-IF
IF (Front Door contact is open(T) [TRUE]) THEN
Set OpenDoorList to '%OpenDoorList% Front Door,( Front Door, Front Door,)'
END-IF
IF (Rec Room-Door contact is open(F) [FALSE]) THEN
Set OpenDoorList to '%OpenDoorList% Rec Room Door,( Front Door, Rec Room Door,)'
END-IF
IF (Variable OpenDoorList( Front Door,) is ≠ ' '(T) AND
Announcements(off) is on(F) [FALSE]) THEN
Notify iPad, Rich's iPhone Via HE and Speak on Sonos Group: All Areas(volume: currentvolume(35)): '%OpenDoorList% has been left open, please check if that is the desired state.( Front Door, has been left open, please check if that is the desired state.)'
END-IF
END-REP
Set Private Boolean(false) True
