Strings in rules

I did read the link but I obviously didn’t understand it. Up to you to decide who you think bears the greater responsibility for accurate understanding, the author or the reader.

There is one reference to ‘previousState’ in a table of implicit variables. There is no explanation of what the variables contain or of their data type and no examples. E.g. is the implicit variable ‘receivedCommamd’ a Boolean saying that the rule was triggered by a command or a string containing the command that triggered it? This page of documentation is written for someone who knows enough not to need the documentation.

In general, like OpenHAB itself, the documentation is fantastic and a credit to those who create it but not in every case can you assume that not understanding the documentation equates to not having read it.

gives

 An error occurred during the script execution: Could not invoke method: org.openhab.core.model.script.actions.Log.logInfo(java.lang.String,java.lang.String,java.lang.Object[]) on instance: null in alarmunset

That’s it! Using a combination of the isBlank() method and previousState:

rule alarmUnset
when Item alarmPanelDisplay changed
then
        if (previousState.toString.isBlank) {
            alarmArmedType.postUpdate(0)
            }
end

Thanks for all the help

Well, every time someone clicks on a link in the forum a number appears showing how many times the link was clicked on. No number appears on the link I posted. So based on the evidence how am I supposed to know you went to the implicit variable section of the docs and read/reread it?

There is no evidence that you clicked the link and your attempt at using it shows you either didn’t read it or didn’t understand it. If you didn’t understand it I would have expected a question to be asked.

Was the error triggered by a change or did you manually run it out use some other type of trigger?

If it was a changed trigger, you might need to call toString on it because Rules DSL is sometimes not smart about that shirt of thing.

Every time or no number - it can’t be both.

I don’t know. You didn’t appear to need any evidence to accuse me of not reading it so why the sudden desire to be sure what you are saying is right?

Or I didn’t realise I had misunderstood it. Are we to wed ourselves to just the one assumption and be blind to all others?

I’ve been a member of this forum for over 6 years so I’m not put off by your attitude and tone but it’s hardly welcoming or encouraging to newer members. Anyway, as I had hoped, there are people out there who actually wanted to help and I have now solved the problem and posted the solution to help anyone else who passes this way with a similar issue. I’d like to think that will be more useful than posts about how the forum display works, which turn out to be wrong anyway.

No clicks, no number. No number, no clicks. When someone clicks on it, a number appears with 1. Someone else clicks, the number changes to 2. It’s how the forum works, It’s how it has always worked. In fact badges can be earned when enough people click on a given link.

But right, I don’t like to help people and don’t know how the forum works.

In theory. Perhaps you can explain how I knew the content of the link if I hadn’t clicked it?