DECREASE is a native command, and it’s up to the binding (or your own rules if it’s a virtual or proxy item) to determine how it’s handled. Some bindings have a native way to pass such information on, allowing a completely race condition free way to lower the level on the device. I think a lot of bindings simply simulate it, and when they get DECREASE they take their current state, subtract a given amount (say 1 or 5), and then pass on the final value to the device. This is how the MQTT binding works (though being able to configure the channel to directly pass on such commands is on my own internal wish list).
The same is true of (UP/DOWN/STOP) Rollershutter commands. Some bindings can pass those natively to a device, while others translate them to (0/100/current known state) before passing them on.
That makes me sooo happy. I normally suck at writing docs. And making things pretty. But @JimT and I put in a lot of work to make the docs as complete and usable as possible. We’re often making improvements. Also please file issues (or send PRs!) if you come across something unclear or lacking details.
Is it possible to get a thing’s property via an item?
I have Shelly1 devices with a temperature sensor which I use to control the floor heating. When the desired temperature is changed I need to do REST calls in order to set the overtemp and undertemp thresholds. For these I need the IP address of the thing. I could create a hash map inside the rule file looking up the IP addresses but come on… where is the fun if this information is already stored inside the thing?
Pseudo code would be: ipAddress = event.item.theThingOfThisItem.property("deviceIp")
But the IP is not part of the properties I just realized. For future readers here is how to get the IP address of a Shelly thing: <shellyItem>.thing.configuration.get("deviceIp")
Nope, this does not work.
So this line works: thermostat.points(Semantics::Switch).first.thing.configuration.get("deviceIp")
but this one throws: undefined method `[]' for #<Java::OrgOpenhabCoreConfigCore::Configuration:0xae5338> (NoMethodError)
at line thermostat.points(Semantics::Switch).first.thing.configuration["deviceIp"]
The value given to the arguments need to be strings when they are not simple numeric, otherwise they’ll be interpreted as arithmetic expressions, i.e. 6-8 = -2, and 0/30 = 0.