Skip to content

Instantly share code, notes, and snippets.

@TheGroundZero
Created January 27, 2021 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheGroundZero/aeb98fe6a7539ae90123eab33bf26ad0 to your computer and use it in GitHub Desktop.
Save TheGroundZero/aeb98fe6a7539ae90123eab33bf26ad0 to your computer and use it in GitHub Desktop.
Node-RED Notification for garbage collection
[{
"id": "cff3f2b8.ed05c8",
"type": "tab",
"label": "Vuilnis ophaling",
"disabled": false,
"info": ""
}, {
"id": "3653f0c5.b43408",
"type": "inject",
"z": "cff3f2b8.ed05c8",
"name": "18:00",
"props": [{
"p": "ophalingsdag",
"v": "Morgen",
"vt": "str"
}
],
"repeat": "",
"crontab": "00 18 * * *",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 100,
"y": 60,
"wires": [["29ef94fd.5213a4", "31121a99.753626", "84ffe190.2b246"]]
}, {
"id": "29ef94fd.5213a4",
"type": "api-current-state",
"z": "cff3f2b8.ed05c8",
"name": "Restafval",
"server": "2ce15169.23b9de",
"version": 1,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"override_topic": false,
"entity_id": "sensor.restafval",
"state_type": "str",
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"blockInputOverrides": false,
"x": 260,
"y": 40,
"wires": [["41c92986.b8e96"]]
}, {
"id": "31121a99.753626",
"type": "api-current-state",
"z": "cff3f2b8.ed05c8",
"name": "PMD",
"server": "2ce15169.23b9de",
"version": 1,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"override_topic": false,
"entity_id": "sensor.pmd",
"state_type": "str",
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"blockInputOverrides": false,
"x": 250,
"y": 80,
"wires": [["41c92986.b8e96"]]
}, {
"id": "84ffe190.2b246",
"type": "api-current-state",
"z": "cff3f2b8.ed05c8",
"name": "Papier-karton",
"server": "2ce15169.23b9de",
"version": 1,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"override_topic": false,
"entity_id": "sensor.papier",
"state_type": "str",
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"blockInputOverrides": false,
"x": 280,
"y": 120,
"wires": [["41c92986.b8e96"]]
}, {
"id": "e87d787a.c0188",
"type": "join",
"z": "cff3f2b8.ed05c8",
"name": "",
"mode": "custom",
"build": "string",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": " en ",
"joinerType": "str",
"accumulate": false,
"timeout": "2",
"count": "",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "",
"reduceFixup": "",
"x": 630,
"y": 80,
"wires": [["c3768a51.af4bf8"]]
}, {
"id": "c3768a51.af4bf8",
"type": "template",
"z": "cff3f2b8.ed05c8",
"name": "",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "{\n \"data\" : {\n \"title\": \"Vuilnisophaling {{ophalingsdag}}\",\n \"message\": \"{{ophalingsdag}} ophaling van {{payload}}!\"\n }\n}",
"output": "json",
"x": 780,
"y": 80,
"wires": [["425b3e15.b091d"]]
}, {
"id": "2fd80d44.50a042",
"type": "inject",
"z": "cff3f2b8.ed05c8",
"name": "08:00",
"props": [{
"p": "ophalingsdag",
"v": "Vandaag",
"vt": "str"
}
],
"repeat": "",
"crontab": "00 08 * * *",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 100,
"y": 100,
"wires": [["29ef94fd.5213a4", "31121a99.753626", "84ffe190.2b246"]]
}, {
"id": "41c92986.b8e96",
"type": "function",
"z": "cff3f2b8.ed05c8",
"name": "",
"func": "if (\n (msg.ophalingsdag == \"Vandaag\" && msg.data.attributes[\"Days-until\"] == 0) \n || (msg.ophalingsdag == \"Morgen\" && msg.data.attributes[\"Days-until\"] == 1)\n ) {\n msg.payload = msg.data.attributes.friendly_name;\n return msg;\n} else {\n return null;\n}",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 480,
"y": 80,
"wires": [["e87d787a.c0188"]]
}, {
"id": "425b3e15.b091d",
"type": "subflow:cb290db1.265c48",
"z": "cff3f2b8.ed05c8",
"name": "Notify all",
"env": [{
"name": "home",
"value": "false",
"type": "bool"
}, {
"name": "Check @Home",
"value": "false",
"type": "bool"
}
],
"x": 940,
"y": 80,
"wires": []
}, {
"id": "2ce15169.23b9de",
"type": "server",
"name": "Home Assistant",
"legacy": false,
"addon": true,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true,
"cacheJson": true
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment