I would like to set the current time as an item state, when a specific rule is executed, therefore I created following rule, by paying attention to example #3 of DateTime Conversion (openHAB 3.x) for the datetime conversion:
triggers:
- id: "1"
configuration:
itemName: Haupteingang_OpenClose
state: ""
type: core.ItemStateChangeTrigger
conditions: []
actions:
- inputs: {}
id: "2"
configuration:
itemName: CarportExpectedMovement
state: =new DateTimeType(new LocalDateTime())
type: core.ItemStateUpdateAction
So when Haupteingang_OpenClose has any change I want to have the current time in the custom created DateTime item CarportExpectedMovement.
Unfortunately, this just leads to following error message:
2021-04-29 18:08:00.865 [WARN ] [handler.ItemStateUpdateActionHandler] - State '=new DateTimeType(new LocalDateTime())' is not valid for item 'CarportExpectedMovement'.