Thank you very much @rlkoshak for the very good explanation! Today I started with configuration files, and learned that (for zWave) I donāt need the .things file as it (currently) makes managing devices more complicated, and device configuration is not possible thru them (that would be cool), and then configuration is also not possible via PaperUI / Habmin, if a things-file is used.
So I had a look at the .items docs, and yes I get the concept, but didnāt manage the syntax by the examples, then I read the rules doc, and that they work with items - and since I already have items (auto-created by the zWave binding), I decided to give them a shot first. Because Iām in the state of ācollecting proper hardwareā and I was eager to try a just-arrived 12-button remote, and it worked, but, like this:
rule "Remote GA"
when
Item zwave_device_a0cc5df2_node28_scene_number received update // funzt, aber bei gedrĆ¼cktem Button feuert nur ein Event
then
logWarn("Rules", "Node 28 changed: " + zwave_device_a0cc5df2_node28_scene_number.state)
switch zwave_device_a0cc5df2_node28_scene_number.state {
case 12 : { logWarn("Rules", "Node 28: button clicked short")
zwave_device_a0cc5df2_node22_switch_binary.sendCommand(ON) }
case 12.2 : logWarn("Rules", "Node 28: button held")
case 12.1 : { logWarn("Rules", "Node 28: button released") // fires only if 12.2 occurred.
zwave_device_a0cc5df2_node22_switch_binary.sendCommand(OFF) }
}
end
Just my first rule-experiment, and I have to get warm with the syntaxā¦
Of course, I donāt want to use the auto-created item in the rule, instead I want to link it to an āaliasā in one place, so if the device changes I only need to update it at one occurrence, as you wrote.
So I do this not in the rule-file, but in the items-file, where I can also give the item additional properties, thatās nice, thanks.
It is not clear to me how this will affect PaperUI / Habmin - will I see lots of āduplicateā items then - the auto generated ones, and my defined ones?
On other question: āDSLā means something like Direct Scripting Language?
Regarding OOP: What I saw today (the built-in scripting, with Visual Studio Code) looks already much much much (ad some more) nicer than what I had with my FS20-system (not too hard, haha), and apart from my very basic JS experience I guess I will stay with the built-in scripting, because the JS-scripting also creates another dependency, which will sooner or later strike backā¦ Itās all complex enough for me, and the time I can put in. And if I read āExperimentalā I put my legs into my hands an run as fast as I can. Reason to switch from FS20: Enough experiments, and countless hours of fiddling around. I want a stable and maintainable system. Today I have the impression it could happen with OH.
Regarding Design Patterns: Very interesting stuff! Canāt stop to read - to know how the language behaves, with timers, events, reentrancy, etc pp, that info will save some future headaches for sure, very nice.
Thank you again.