Thanks for the changed to OFF tip, that took care of the double trigger.
You messed up somewhere with
triggeringItem, that will be available onreceived updatetriggers.
I don’t think so. It is null. I added this log for it on in script, just under the previous log call:
logInfo(log, "Trigger was Item '{}'", triggeringItem.name)
and the log showing it’s null when trying to execute it. BTW, is there no way to get line numbers with those errors? They make debugging so painful in general.
2020-10-25 01:23:36.322 [ERROR] [internal.handler.ScriptActionHandler] - Script execution failed: cannot invoke method public abstract java.lang.String org.openhab.core.items.Item.getName() on null in double_taps
But yes,
previousStateandnewStatewill not exist if there is no change, as per the documentation. They will not actually be null, they simply do not exist.
Actually, newState does exist and is correct. Sorry about the assumption that I could get previousState too. You’re correct about the documentation actually being correct there.