The Rule Machine GUI is a nice tool for "clicking together" some behaviour...
But (after creating the first 15 rules) I would prefer to write "real code" (my fingers are usualy faster than the mouse)...
So my question is: Is there a way to use pure Groovy to define rules?
BTW: I've started using Hubitat only a week ago. Please excuse me when I've missed something in this forum and/or documentation.
An βappβ is only a few more lines of code.. Itβs not complicated to make simple apps to replace rules.. I do it all the time, I start off in RM but when they start getting more complex, I prefer groovy.
Easier for my programming brain to wrap my head around.
here is my app that i use to control my roof coil outlet.. it turns on based on a date range and temperature. range.. could easily do i n rule machine now.. but written in smartthings before we had rule machine. i still ported tohubitat and use it.
there are a couple of other apps in my github you can look at ..
colorcastweather which flashes lights based on different weather conditions and alerts.
also gardenhue for turning on colored light strings sunset to sunrise and changing fixed or random colors at various time intervals.
Its not the best answer but the smartthings documentation is a great reference for writing apps and I've used it a number of times. As well as looking at existing apps to understand how they all work. Classic smartthings apps and HE apps are very similar so most of the documentation is relevant.
Some of the key things to read about are the definition section (which defines the app) and preference section (which is the main interface to the app). After that the key methods are installed, updated, initialize where your app will mainly kick off when you click on done.
After that you can create any methons etc to subscribe to events and handle events of devices you may have selected in the preferences section.
It will seem daunting at first but over time you get the hang of it and creating a new app is a lot of cut and paste with some tweaks.