Entity update with future timestamp

Hi community,
I would like to create my own forecast for one entity and Iam not able to figure it out how to update/create entity state with future timestamp. In database, I can see that this is in state_attributes table in shared_attrs as an at attribute.
I don’t know if there is a way to create this natively in node red HA pallete, or I have to go directly to SQL.

Thank you for your advice.

You would need the nodered companion in hacs to create a sensor entity. Then you can structure a message obj in jsonata. It’s set for 24 hours ( 8.64e+7)

{
   "state":"fog",
   "attributes":{
       "temperature":44,
       "humidity":58
   },
   "current_time":$now(),
   "forecast_time":$fromMillis($millis() + 8.64e+7)
}

Create a sensor and map the paths to their keys.

image

[{"id":"cef2c6ba4064f6dc","type":"inject","z":"60f2d2277843c698","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\t   \"state\":\"fog\",\t   \"attributes\":{\t       \"temperature\":44,\t       \"humidity\":58\t   },\t   \"current_time\":$now(),\t   \"forecast_time\":$fromMillis($millis() + 8.64e+7)\t}","payloadType":"jsonata","x":210,"y":1180,"wires":[["9c99394e99a00b8d"]]},{"id":"9c99394e99a00b8d","type":"ha-sensor","z":"60f2d2277843c698","name":"","entityConfig":"7af0345b2d3c477c","version":0,"state":"payload.state","stateType":"msg","attributes":[{"property":"temperature","value":"payload.attributes.temperature","valueType":"msg"},{"property":"humidity","value":"payload.attributes.humidity","valueType":"msg"},{"property":"time","value":"payload.current_time","valueType":"msg"},{"property":"forecast","value":"payload.forecast_time","valueType":"msg"}],"inputOverride":"block","outputProperties":[{"property":"dataT","propertyType":"msg","value":"$entity()","valueType":"jsonata"}],"x":410,"y":1180,"wires":[["d33e13ffc9e5f34d"]]},{"id":"7af0345b2d3c477c","type":"ha-entity-config","server":"6b1110b5.183a4","deviceConfig":"","name":"update sensor","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"update sensor"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":"temperature"},{"property":"unit_of_measurement","value":"°F"},{"property":"state_class","value":"measurement"}],"resend":false,"debugEnabled":false},{"id":"6b1110b5.183a4","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":false,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]