Thanks! That node I have never used before
What I was planned to use was this kind of construction:
.
[{"id":"53512b122b46f88d","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"4d7009beb27da1cd","type":"poll-state","z":"53512b122b46f88d","name":"Some entity","server":"63f26c18.71f4f4","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"1","updateIntervalType":"num","updateIntervalUnits":"seconds","outputinitially":false,"outputonchanged":false,"entity_id":"sensor.zijraam_woonkamer_buiten_lux","state_type":"str","halt_if":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"x":150,"y":500,"wires":[["5a27f4298ac28e2f"]]},{"id":"5a27f4298ac28e2f","type":"function","z":"53512b122b46f88d","name":"Some logic","func":"// Outputs\n// [\n// signal to simulate the inject node at the specific time from the HA helper\n// signal to do something else...\n// ]\n\nvar msgInjectSimulation, msgSomethingElse = null;\n\nconst haStates = global.get(\"homeassistant.homeAssistant.states\");\n\nconst closeCoversStaticTime = haStates[\"input_datetime.close_all_covers_static_time\"];\n\nvar injectLastExecutedDate = global.get(\"some_name_executed_date\", \"file\");\n\nconst currentDateTime = new Date(Date.now());\n\nif (currentDateTime.getHours() == closeCoversStaticTime.attributes.hour &&\n currentDateTime.getMinutes() == closeCoversStaticTime.attributes.minute &&\n (injectLastExecutedDate == undefined || \n currentDateTime.getFullYear() != injectLastExecutedDate.getFullYear() ||\n currentDateTime.getMonth() != injectLastExecutedDate.getMonth() ||\n currentDateTime.getDate() != injectLastExecutedDate.getDate())\n )\n{\n global.set(\"some_name_executed_date\", currentDateTime, \"file\")\n\n msgInjectSimulation = {\n \"payload\": \"Injecting...\"\n };\n}\n\n// ..... all other logics ...\n// ...\n// ...\n// ...\n\nreturn [msgInjectSimulation, msgSomethingElse];","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":350,"y":500,"wires":[["c4195a96f5427ca9"],["cd5b898deaec76b7"]]},{"id":"c4195a96f5427ca9","type":"debug","z":"53512b122b46f88d","name":"Inject once at specific time from input helper HA","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":660,"y":460,"wires":[]},{"id":"cd5b898deaec76b7","type":"debug","z":"53512b122b46f88d","name":"Something else....","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":570,"y":540,"wires":[]},{"id":"63f26c18.71f4f4","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"id","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]
But with this time node it is very easy!