Ok, I get that, but there is already text in the payload, it already has: "Good morning, Christophe. You have an event on your calendar called ... at ... (and after this, the weather should come)"
Here is the output:
and the nodes:
[{"id":"c1a307c9.6c0d98","type":"tab","label":"Morning routine","disabled":false,"info":""},{"id":"a120de63.0d68d","type":"api-call-service","z":"c1a307c9.6c0d98","name":"Lights on bedroom","server":"6ab5feac.b916d","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.bedroom","data":"{\"profile\":\"relax\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":530,"y":340,"wires":[["a474c21f.62c0e"]]},{"id":"b25102af.4e59e","type":"api-current-state","z":"c1a307c9.6c0d98","name":"get work calendar","server":"6ab5feac.b916d","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"calendar.work","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":530,"y":420,"wires":[["3ac4ebba.c59a84"]]},{"id":"c3076a75.a9e438","type":"api-current-state","z":"c1a307c9.6c0d98","name":"get main calendar","server":"6ab5feac.b916d","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"calendar.main","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":530,"y":480,"wires":[["74da2db4.7a2f74"]]},{"id":"f657cf45.f62d4","type":"api-current-state","z":"c1a307c9.6c0d98","name":"get family calendar","server":"6ab5feac.b916d","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"calendar.family","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":530,"y":580,"wires":[["531ed66e.faa408"]]},{"id":"3ac4ebba.c59a84","type":"function","z":"c1a307c9.6c0d98","name":"Work event today?","func":"var nextWork = msg.data.attributes.start_time;\nvar work_date = new Date(nextWork);\nvar today = new Date();\nvar nextWorkTitle = msg.data.attributes.message;\nvar nextWorkTime = msg.data.attributes.start_time;\n\nmsg.payload = \"Good morning, Christophe. \";\n\nif((work_date.getDate() === today.getDate()) &&\n (work_date.getMonth() === today.getMonth()) &&\n (work_date.getFullYear() === today.getFullYear())){\n \n if(nextWorkTitle !== \"undefined\" && nextWorkTime !== \"undefined\"){\n msg.payload += \"You have a work event called: \" + nextWorkTitle + \" at \" + nextWorkTime;\n } else{\n msg.payload += \"You don't have any work events anymore today.\";\n }\n} else {\n msg.payload += \"There are no work events today.\";\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":750,"y":420,"wires":[["66a1a2d4.05b59c"]]},{"id":"26acf3d9.4282ac","type":"function","z":"c1a307c9.6c0d98","name":"Main event today?","func":"var nextMain = msg.data.attributes.start_time;\nvar main_date = new Date(nextMain);\nvar today = new Date();\nvar nextMainTitle = msg.data.attributes.message;\nvar nextMainTime = msg.data.attributes.start_time;\n\nif((main_date.getDate() === today.getDate()) &&\n (main_date.getMonth() === today.getMonth()) &&\n (main_date.getFullYear() === today.getFullYear())){\n \n if(nextMainTitle !== \"undefined\" && nextMainTime !== \"undefined\"){\n msg.payload += \"You have a main event called: \" + nextMainTitle + \" at \" + nextMainTime;\n } else{\n msg.payload += \"You don't have any main events anymore today\";\n }\n} else {\n msg.payload = \"There are no main events today.\";\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":910,"y":480,"wires":[["66a1a2d4.05b59c"]]},{"id":"5456bf66.efda5","type":"function","z":"c1a307c9.6c0d98","name":"Family event today?","func":"var nextFamily = msg.data.attributes.start_time;\nvar family_date = new Date(nextFamily);\nvar today = new Date();\nvar nextFamilyTitle = msg.data.attributes.message;\nvar nextFamilyTime = msg.data.attributes.start_time;\n\nif((family_date.getDate() === today.getDate()) &&\n (family_date.getMonth() === today.getMonth()) &&\n (family_date.getFullYear() === today.getFullYear())){\n \n if(nextFamilyTitle !== \"undefined\" && nextFamilyTime !== \"undefined\"){\n msg.payload += \"You have a family event called: \" + nextFamilyTitle + \" at \" + nextFamilyTime;\n } else {\n msg.payload += \"You don't have any family evnents anymore today.\";\n }\n} else {\n msg.payload = \"There are no family events today.\";\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":920,"y":580,"wires":[["66a1a2d4.05b59c"]]},{"id":"66a1a2d4.05b59c","type":"join","z":"c1a307c9.6c0d98","name":"Join the messages","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":" ","joinerType":"str","accumulate":false,"timeout":"","count":"4","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1190,"y":480,"wires":[["8c6ef48a.10a468"]]},{"id":"e5bb2fa.356aed","type":"openweathermap","z":"c1a307c9.6c0d98","name":"","wtype":"onecall","lon":"5.22","lat":"51.05","city":"","country":"","language":"en","x":550,"y":660,"wires":[["3aa5840c.96547c"]]},{"id":"93250a1f.096d68","type":"function","z":"c1a307c9.6c0d98","name":"Weather","func":"var now = new Date();\nvar location = \"Beringen\";\nvar weather = msg.payload.daily[0].weather[0].main;\nvar currentTemp = msg.payload.current.temp;\nvar weatherToday = msg.payload.daily[0].weather[0].description;\nvar maxTemp = msg.payload.daily[0].temp.max;\nvar minTemp = msg.payload.daily[0].temp.min;\nvar feelTemp = msg.payload.daily[0].feels_like.day;\nvar sunrise = msg.data.current.sunrise;\nvar sunriseDate = new Date(sunrise * 1000);\nvar sunriseHour = sunriseDate.getHours();\nvar sunriseMin = sunriseDate.getMinutes();\nvar sunset = msg.data.current.sunset;\nvar sunsetDate = new Date(sunset * 1000);\nvar sunsetHour = sunsetDate.getHours();\nvar sunsetMin = sunsetDate.getMinutes();\nvar fullmsg = \"The weather in \" + location + \" is \" + weather + \" at \" + currentTemp + \" degrees. Today is expected to be \" + weatherToday + \" with a high of \" + maxTemp + \", a low of \" + minTemp + \" and it will feel like \" + feelTemp + \" degrees.\";\n\nif(sunriseHour > now.getHours()){\n fullmsg += \"The sun will rise at \";\n} else {\n fullmsg += \"The sun rose at \";\n}\nif (sunriseHour < 10)\n{\n fullmsg += 0;\n}\nfullmsg += sunriseHour + \":\";\nif (sunriseMin < 10)\n{\n fullmsg += 0;\n}\nfullmsg += sunriseMin;\n\nif(sunsetHour > now.getHours()){\n fullmsg += \" and will set at \";\n} else {\n fullmsg += \" and was set at \";\n}\nfullmsg += sunsetHour;\nfullmsg += \":\";\nif (sunsetMin < 10)\n{\n fullmsg += 0;\n}\nfullmsg += sunsetMin;\n\nmsg.payload += fullmsg;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":900,"y":660,"wires":[["66a1a2d4.05b59c"]]},{"id":"8c6ef48a.10a468","type":"function","z":"c1a307c9.6c0d98","name":"Set the volume","func":"var now = new Date();\nvar hh = now.getHours();\n\nif(hh > 9 || hh < 22){\n msg.volume = 60;\n return msg;\n}else{\n msg.volume = 30;\n return msg;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1380,"y":480,"wires":[["1c8e358a.d1cf8a"]]},{"id":"95e84d04.d8dab","type":"ha-webhook","z":"c1a307c9.6c0d98","name":"Morning activation","server":"6ab5feac.b916d","outputs":1,"webhookId":"morning","payloadLocation":"payload","payloadLocationType":"msg","headersLocation":"","headersLocationType":"none","x":90,"y":520,"wires":[["7ef2f74.0e56208"]]},{"id":"a474c21f.62c0e","type":"stoptimer","z":"c1a307c9.6c0d98","duration":"5","units":"Minute","payloadtype":"num","payloadval":"0","name":"wait 5 minutes","x":760,"y":340,"wires":[["53274132.3267d"],[]]},{"id":"53274132.3267d","type":"api-call-service","z":"c1a307c9.6c0d98","name":"Lights off bedroom","server":"6ab5feac.b916d","version":1,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.bedroom","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":950,"y":340,"wires":[[]]},{"id":"7ef2f74.0e56208","type":"api-current-state","z":"c1a307c9.6c0d98","name":"christophe home?","server":"6ab5feac.b916d","version":1,"outputs":2,"halt_if":"Home","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_select.christophe","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":310,"y":520,"wires":[["a120de63.0d68d","e5bb2fa.356aed","b25102af.4e59e","c3076a75.a9e438","f657cf45.f62d4"],[]]},{"id":"68f5f362.2d657c","type":"inject","z":"c1a307c9.6c0d98","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":660,"wires":[["7ef2f74.0e56208"]]},{"id":"a9f4a321.67841","type":"join-message","z":"c1a307c9.6c0d98","name":"send to phone","text":"","title":"","url":"","notificationicon":"","joinConfig":"95c9ad7f.6b91a","x":1960,"y":480,"wires":[[]]},{"id":"1c8e358a.d1cf8a","type":"function","z":"c1a307c9.6c0d98","name":"","func":"msg.text = msg.payload\nmsg.title = \"Good morning\"\nmsg.devices = \"chaos mobile\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1540,"y":480,"wires":[["3dcc5793.a3dfa8"]]},{"id":"508c0ac5.8cca04","type":"cronplus","z":"c1a307c9.6c0d98","name":"describer","outputField":"payload","timeZone":"","persistDynamic":false,"commandResponseMsgOutput":"output1","outputs":1,"options":[],"x":520,"y":800,"wires":[[]]},{"id":"65bc085.bc865f8","type":"change","z":"c1a307c9.6c0d98","name":"Describe solar events","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"command\":\"describe\",\"expressionType\":\"solar\",\"solarType\":\"selected\",\"solarEvents\":\"sunrise,sunset\",\"location\":\"51.05 5.22\"}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":800,"wires":[["508c0ac5.8cca04"]]},{"id":"74da2db4.7a2f74","type":"stoptimer","z":"c1a307c9.6c0d98","duration":"5","units":"Second","payloadtype":"num","payloadval":"0","name":"wait 5 seconds","x":720,"y":480,"wires":[["26acf3d9.4282ac"],[]]},{"id":"531ed66e.faa408","type":"stoptimer","z":"c1a307c9.6c0d98","duration":"10","units":"Second","payloadtype":"num","payloadval":"0","name":"wait 10seconds","x":720,"y":580,"wires":[["5456bf66.efda5"],[]]},{"id":"3aa5840c.96547c","type":"stoptimer","z":"c1a307c9.6c0d98","duration":"20","units":"Second","payloadtype":"num","payloadval":"0","name":"wait 20seconds","x":740,"y":660,"wires":[["93250a1f.096d68"],[]]},{"id":"3dcc5793.a3dfa8","type":"debug","z":"c1a307c9.6c0d98","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1740,"y":560,"wires":[]},{"id":"6ab5feac.b916d","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true},{"id":"95c9ad7f.6b91a","type":"join-config","z":"","name":"chaosha","register":true}]