Error assign a value to null


I just added a String Item and a DateTime Item, and in a rule, I want to set the string, and date to actual date.
I get the error:
Script execution of rule with UID ‘catEventListener-1’ failed: An error occurred during the script execution: Cannot assign a value in null context. in catEventListener

Is that correct:
Anwesend is my String and LastSeen my DateTime

       Anwesend_Online = "auswärts"

I think the date should work, but the Anwesend_Online is not initalized. how can I do this to avoid the error message above?

We need lots more detail. Which version of OH?

Logs? It’s very helpful to see the full error in context.

How did you create the rule? Show the full code for the rule (if created in the UI, click the “Code” tab and past the YAML you see there here

Openhab 3 stable, rules file manually created.
I have already the solution:


and for an Switch you have to change this way:


This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.