SmartThings automation features are so far behind other platforms and there hasn’t been a single update yet. If that’s the case, how about allowing users to use Lua instead of the rules API when creating routines? Unlike the rules API, it’s a proper programming language, so users can perfectly create the routines they want. It’s not a heavy language, and since the edge driver already runs on Lua, I don’t think there will be a big problem replacing it.
Something less verbose and intuitive would be very welcome for advanced automations. At the same time, improving the app would be welcome, the point of SmartThings is being user-friendly after all and some basic actions are missing from the app.
One important aspect impacting the lack of automation features is that they are limited by the capabilities and presentation models. Existing ones have been stuck for a long time without being updated to add more features. If the “view” of the device is already reduced there are things you can’t automate regardless of the language.
While I don’t think they’re going to replace the Rules API, at least now you can edit them in the advanced website, but a smarter editor would come in handy so you don’t need to deal with device IDs for instance and instead auto-completes it. Some basic actions to operate with the values, like basic arithmetic would also be welcome.
Currently looking for a capability for the door state (Matter lock)…
Guess I’ll just reuse the ContactSensor.
I have a Zooz Z-Box Hub in one of my locations and it provides an “advanced” facility using Lua for programming rules/scenes, as you suggest. In a number of cases, I’ve found a Lua rule implementation to be much more efficient than multiple rules to handle all the different states that could arise leading to the ultimate end result. For example, a rule requiring
if whatever
do something
else if another condition
do something differently
else
handle any remaining condition
is trivial–and works out very, very well.
Of course, one must know or learn Lua–but the interface is intended for advanced users.
JMO.
Cool stuff!
If you’d like your Z-Wave dimmer or connected smart bulb turn on gradually, slowly increasing brightness over a given amount of time, you can create a custom scene in your Z-Box using the lua scene editor.
hub.call(X, 'setValue', 5)
local currentLevel = hub.call(X, 'getValue', 'value')
for i = 5, 100 do
hub.call(X, 'setValue', i)
hub.sleep(12000)
end
hub.call(X, 'setValue', currentLevel)
(X = device ID)