rule "Fenster Wohnzimmer"
when
Item Sensor_Fenster_EG_1 changed
then
var DateTime letzteAenderung = now as DateTime
Sensor_Fenster_EG_1_LetzteAenderung.postUpdate(letzteAenderung)
end
And the error message during execution is
Rule 'Fenster Wohnzimmer': An error occurred during the script execution: Could not invoke method: org.eclipse.smarthome.model.script.actions.BusEvent.postUpdate(org.eclipse.smarthome.core.items.Item,org.eclipse.smarthome.core.types.State) on instance: null
Problem: I can’t get this to work in OH3, please help…
Item:
DateTime EndsAt
Rule:
var Number minutes = (Remaining.state as Number).floatValue * 60
val endtime = now.plusMinutes(minutes.intValue)
logInfo("Rule","##Ends at: " + endtime.toString) //OK til here
EndsAt.postUpdate(endtime.toString)
Gives error:
Cannot convert '2021-08-12T07:27:02.011824Z[Etc/UTC]' to a state type which item 'EndsAt' accepts: [DateTimeType, UnDefType].
Please don’t reopen a 3+ year old post. If you need help please open a new thread. OH 3 didn’t even exist when the last post to this thread was made and date times work differently in OH 3, for which there are lots of threads already.