How to write a DateTime with an Action Node

I'm trying to write to a input_datetime helper with an Action node - but keep getting "HomeAssistantError: extra keys not allowed @ data['value']". I really don't get JavaScript.

The data coming from the node prior to the Action node is:
msg : Object
{ _msgid: "3d6978f0f9f965bd", payload: "2024-10-07T16:00:00+08:00", topic: "", data: object }

So I think the payload has the date and time correct - but how do I write the Action node to write it to the datetime helper?

this doesn't work :frowning:

well the "msg.payload" (with the double quotes) won't work as it becomes a literal string, ie. remove the double quotes.

This sounds specific to home assistant. There are not many HA users here.
Did you try the suggestions at the 'looking for help' section ?

Have you tried just select msg. and typing payload in data field.

Or

If an object with property value is required.
Select J: expression and enter

{"value": $$.payload}

[edit] fixed typo.

thanks, but no luck.

sounds like I'll need to try a Home Assistant-related NodeRed group

If we look at the documentation at the bottom of the node we see:

So first the key is not value but one of the three above depending on the type of date/time you need to pass.

If we also look at the format of the actual value, it does not show iso datetime input, we need to format the value. Set the data field to J:Expression.

{"datetime":$moment(payload).format("YYYY-MM-DD hh:mm:ss")}

oh fantastic - worked a treat! Thank you so much. I keep learning (sadly, not quick-enough).