Hi @Wabiloo, please see below
[
{
"id": "f73d565e.177398",
"type": "inject",
"z": "2c03c33235.b34fc",
"name": "7PM trigger",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "00 20 * * *",
"once": false,
"onceDelay": 0.1,
"x": 130,
"y": 280,
"wires": [
[
"b3191444.5932a"
]
]
},
{
"id": "b3191444.5932a",
"type": "api-current-state",
"z": "2c07c388.b434fc",
"name": "",
"server": "708d1e3a.ef397",
"halt_if": "",
"override_topic": true,
"override_payload": true,
"entity_id": "calendar.bins_schedule",
"x": 410,
"y": 280,
"wires": [
[
"91064877.5df9e8"
]
]
},
{
"id": "bb6efbc9.573dc8",
"type": "function",
"z": "2c07c388.b434fc",
"name": "Day before bin day ?",
"func": "var nextCollectionDate = msg.data.attributes.start_time;\nvar bin_date = new Date(nextCollectionDate);\nvar today = new Date();\nbin_date.setDate(bin_date.getDate()-1);\n\nif ((bin_date.getDate() === today.getDate()) && \n (bin_date.getMonth() === today.getMonth()) && \n (bin_date.getFullYear() === today.getFullYear()))\n {\n msg.payload = \"true\";\n return msg; \n }\n else\n {\n return null;\n }\n",
"outputs": 1,
"noerr": 0,
"x": 680,
"y": 320,
"wires": [
[
"298edf5e.3baa6"
]
]
},
{
"id": "91064877.5df9e8",
"type": "change",
"z": "2c07c388.b434fc",
"name": "",
"rules": [
{
"t": "change",
"p": "data.attributes.start_time",
"pt": "msg",
"from": "00:00:00",
"fromt": "str",
"to": "07:00:00",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 410,
"y": 320,
"wires": [
[
"bb6efbc9.573dc8"
]
]
},
{
"id": "298edf5e.3baa6",
"type": "template",
"z": "2c07c388.b434fc",
"name": "",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "{\n \"data\":{\n \"where\":\"kitchen\",\n \"what\":\"Good evening. This is a reminder. Tommorow is a {{data.attributes.message}}.\"\n }\n}",
"output": "str",
"x": 860,
"y": 320,
"wires": [
[
"ce693f4e.e74df"
]
]
},
{
"id": "ce693f4e.e74df",
"type": "api-call-service",
"z": "2c07c388.b434fc",
"name": "Sonos Say",
"server": "708d1e3a.ef397",
"service_domain": "script",
"service": "sonos_tts",
"data": "{}",
"mergecontext": "",
"x": 1010,
"y": 320,
"wires": [
[]
]
},
{
"id": "708d1e3a.ef397",
"type": "server",
"z": "",
"name": "Home Assistant",
"legacy": false,
"hassio": false,
"rejectUnauthorizedCerts": true
}
]