Hi Everyone.
I am currently using the Caddx Binding with OpenHab 3.1.0 M3 to control my alarm system.
I have been using rules and sitemaps, however am trying to migrate to widgets - so have been working on a “self contained” widget - which would require replacing some rules with actions directly from the widget.
I would like to know if I can replace the following rule with an action in my widget:
rule "Partion 3 Arm in STAY"
when
Item Partition3_Stay received command ON
then
if (Partition3_ReadyToArm.state == OFF) {
logWarn("actions", "Ready to ARM is OFF")
Alarm_Feedback.postUpdate("Ready to ARM is OFF")
createTimer(now.plusSeconds(5), [
Alarm_Feedback.postUpdate("")
])
}
else if (Partition3_Armed.state == ON) {
logWarn("actions", "Alarm is already ARMED")
Alarm_Feedback.postUpdate("Alarm is already ARMED")
createTimer(now.plusSeconds(5), [
Alarm_Feedback.postUpdate("")
])
}
else {
val actions = getActions("caddx","caddx:partition:e59e4935:partition3")
if (null === actions) {
logWarn("actions", "Actions not found, check thing ID for bridge")
return
}
logWarn("actions", "Ready to ARM is ON ")
logInfo("actions", "Actions " + actions)
actions.stay()
}
end
The action gets sent directly to the Partition 3 Thing - returned as follows when rule is run:
07:30:30.811 [WARN ] [org.openhab.core.model.script.actions] - Ready to ARM is ON
07:30:30.950 [INFO ] [org.openhab.core.model.script.actions] - Actions org.openhab.binding.caddx.internal.action.CaddxPartitionActions@7040bbc1
I am using the following widget component:
config:
action: command
actionCommand: ON
actionItem: =(props.partitionPrefix) + '_Stay'
title: STAY
listButton: true
I am not sure how to add the actionItem to use the THING - “caddx”,“caddx:partition:e59e4935:partition3”
The field only seems to accept Items - tested via props. Only Items are offered as options. Also could not get any logging when trying the different options.
Other examples I have looked at (Harmony Hub, Hue, etc) seem to use a Group which includes some Items from the Thing, but could not get that to work.
Any suggestions and advise would be appreciated as I am not even sure if this is possible in teh current version?
Thanks as always.
Mark