I have a C8 and on the latest version (2.4.1.167).
My question is how can I create many rules (ideally in automated fashion), with ease? For example, I want rules to capture various events and create a notification for each event with slightly different actions (for triggering Alexa to vocalize notifications, or for different events pushed to email/pushover, etc).
It would be amazing if there was an API or even better a Terraform provider that could be used - but I don't believe those exist.
How have you people done with export/import of a configuration snippet, and is that even possible?
Using the UI to build 10 different events, especially when they are more complex than a simple if/then, is certainly time consuming.
Have you looked into Webcore for automations? You can do complex things with Rule Machine, but I agree it can be clunky making complex automations with it.
If you haven't tried Webcore, you might like it better, since it gives you a code-like interface, with for loops and while loops, and for each device loops. You can have many levels of if/then/else and elseif. You don't write the code though, it is still point and click like Rule Machine, it just looks like you wrote code when you get done, which makes the logic you created easy to see.
You can copy and paste blocks of "code" within Pistons. Pistons are just a container to put automations in and organize things, and you can even copy whole pistons into new ones, and call pistons from other pistons and send them data.
You can do api calls from webcore easily to get data in or to set something else. There is an api provided to trigger a piston via an api call from something else, and send the piston data.
There is also the Maker API app, if you want to control devices from somewhere else via api.
You can also write your own apps for automations, if you know Groovy at all, and then you will have much more control over what you want to do, especially as far as reusing code.
If you're willing to go outside of Hubitat and try Node Red, it uses the Maker API. It is easy to make copies of automations that are all similar. The automations are called flows and you can actually create sub-flows if you have a logic block that is the same for multiple automations. When you change the sub-flow, it changes for every flow that relies on it.
+1 on the WebCore.
I only have 107 piston but as an ex-programmer that's not hard to do.
The great thing is once you get a piece of code you're happy with cloning and copying to new pistons is a breeze.
If you're experienced you will code with declared variables and subroutine calls.
A lot of time it's just a matter of loading the vars at the start and all the code remains untouched.
WebCore is very comprehensive.