I’ve created two wtring items:
String Str_Secur_Panel1 {expire="1s,state=NULL" }
String Str_Secur_AlarmState
This is my rule:
rule “Activate Alarm”
when
Item Str_Secur_Panel1 changed
then
if( Str_Secur_Panel1.state == 999 ) {
Str_Secur_AlarmState.sendCommand(8)
}
end
rossko57
(Rossko57)
4
Okay. You understand why - rules sees 999 as a number, nine hundred and ninety-nine. “999” is a string, three 9 characters. Apples and oranges.
Saracen
(Tom)
5
That Item is also a string item so needs to be:
Str_Secur_AlarmState.sendCommand("8")
1 Like
I’m not sure about that, because openHAB should use (8).toString automatically.
Saracen
(Tom)
7
Yes, you’re absolutely right in this example - but only because the string is a numerical value.