ALL Rollershutter Items have the same properties. One of the main purposes of Items is to model your home automation independent of the devices and technologies in use. A Homatic Rollershutter Item is identical to a Zwave Rollershutter Item.
I’m not sure that actually answers the OP’s question. I think he asking what methods are available on the Rollershutter Item which would not be reflected in the REST API.
All Items have a standard set of functions/properties you can call from Rules. See Rules | openHAB for how to specifically access, update, command and use Item’s states in a Rule.
There are other methods available to pull historical data from persistence, check/change Group membership, access members for a Group Item, and the like. They are all in the docs.
It is a custom Domain Specific Language based on Xtend. You can find info about the syntax here and here.
You appear to be a coder. You might be happier using JSR223 and coding Rules in Jython, JavaScript (Nashorn) or Groovy. Here is the version of your Rule in Jython using the Helper Library.
from core.rules import rule
from core.triggers import when
@rule("Luke zu bei Regen")
@when("Item Rain received update")
def luke(event):
log.info("Rule triggered {}".format(items["Rain"]))
if items["Rain"] > DecimalType(0.06): events.sendCommand("Shutter_Bedroom", 0)
For the purposes of Rules, the only difference is the type of MyItem.state. For a Number the type will be DecimalType (which itself is of type Number). Rollershutter is of type PercentType (also of type Number). Both Items have the same properties and methods.
See Items | openHAB for further details.
The easiest way to get the full list of methods available on any Object in Rules DSL is to use VSCode with the openHAB extension. Then you can type MyItem.
and a dialog with all the valid completions will pop up. Beyond that you can look at the source code for GenericItem. For the most part you will only care about state
, sendCommand
and postUpdate
.
See Rules | openHAB. There are very important distinctions between sendCommand and postUpdate you need to understand.
There is no such thing in Rules DSL. You can get a dict of all Items and their current state in Jython Rules, called items
.
Explain more what you are after because there are lots of ways to do this depending on what you are after, some of which don’t even require a Rule.
Get a count of all the OPEN contacts:
Group:Number gFritzBox
Set gFritxBox to OPEN if any member of the Group is OPEN
Group:Contact:OR(OPEN, CLOSED) gFritzBox
Trigger a Rule when any member of gFritzBox changes to OPEN
rule "something opened!"
when
Member of gFritzBox changed to OPEN
then
// do something
end
Jython version:
from core.rules import rule
from core.triggers import when
@rule("something opened")
@when("Member of gFritzBox changed to OPEN")
def opened(event):
# do something
Do something with all OPEN members of gFritzBox when one of them changes to OPEN
rule "something opened!"
when
Member of gFritzBox changed to OPEN
then
gFritzBox.members.filter[ i | i.state == OPEN ].forEach[ i |
// do something on each member that is OPEN
]
end
See Design Pattern: Working with Groups in Rules for further details.
from core.rules import rule
from core.triggers import when
@rule("something opened!")
@when("Member of gFritzBox changed to OPEN")
def opened(event):
for i in filter(lambda i: i.state == OPEN, ir.getItem("gFritzBox").members):
# do something
Check the group membership of an Item
if(MyItem.getGroupNames.contains("MyGroup"){
Jython:
if "MyGroup" in ir.getItem("MyItem").getGroupNames():