Hi. @jossuar So I decided to try an use the details at Input field for number/free text for openHAB UIs to input my PIN number. Have got the input part working just fine (minor formatting isue with Basic UI when switching between Mobile and Browser.
I am however having issues passing by PIN number to the alarm system. My Rule is:
rule "Partion 1 DISARM"
when
Item Partition1_Disarm received command ON
then
if (Partition1_Armed.state == ON) {
logWarn("actions", "Alarm is not armed")
}
else {
val actions = getActions("caddx","caddx:partition:e59e4935:partition1")
if (null === actions) {
logWarn("actions", "Actions not found, check thing ID for bridge")
return
}
logWarn("actions", "Ready to ARM is ON ")
//var EnteredPin = "1234"
var EnteredPin = ScriptServiceUtil.getItemRegistry.getItem("Pin_Number")
//val String EnteredPin = ScriptServiceUtil.getItemRegistry.getItem("Pin_Number")
logInfo("", "EnteredPin " + EnteredPin.state )
actions.disarm(EnteredPin.state)
}
end
And when I activate I get the following in the logs:
07:38:31.950 [INFO ] [smarthome.event.ItemCommandEvent ] - Item 'Partition1_Disarm' received command ON
07:38:31.950 [WARN ] [clipse.smarthome.model.script.actions] - Ready to ARM is ON
07:38:31.950 [INFO ] [org.eclipse.smarthome.model.script. ] - EnteredPin 1234
07:38:31.950 [ERROR] [untime.internal.engine.RuleEngineImpl] - Rule 'Partion 1 DISARM': An error occurred during the script execution: Could not invoke method: org.openhab.binding.caddx.internal.action.CaddxPartitionActions.disarm(org.eclipse.smarthome.core.thing.binding.ThingActions,java.lang.String) on instance: null
Variable seems to be getting correct value but not passing correctly.
Any advice?
Thanks
Mark
EDIT: Found my error:
var EnteredPin = ScriptServiceUtil.getItemRegistry.getItem("Pin_Number")
logInfo("", "EnteredPin " + EnteredPin.state.toString)
actions.disarm(EnteredPin.state.toString)