I wanted to accomplish basically the same thing, but I wanted to keep it with my other automations in node-red. This is what I came up with if you’d like to give it a shot. I’m sure there are more elegant ways to do it, but this seems to be flexible enough for me to keep adding variations I want to catch.
[
{
"id": "7a9f216b70607228",
"type": "server-state-changed",
"z": "fa073d83.97c36",
"name": "Delivery Notifications",
"server": "5d07132e.1b268c",
"version": 4,
"exposeToHomeAssistant": false,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"entityidfilter": "sensor.john_s_galaxy_last_notification",
"entityidfiltertype": "exact",
"outputinitially": false,
"state_type": "str",
"haltifstate": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"outputs": 1,
"output_only_on_state_change": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "",
"valueType": "triggerId"
}
],
"x": 120,
"y": 820,
"wires": [
[
"18012f9ac26557a6",
"b316db8a87c1f6b1"
]
]
},
{
"id": "0c156c5fb26ac14e",
"type": "api-call-service",
"z": "fa073d83.97c36",
"name": "Turn on outside lights",
"server": "5d07132e.1b268c",
"version": 5,
"debugenabled": false,
"domain": "switch",
"service": "turn_on",
"areaId": [],
"deviceId": [],
"entityId": [
"switch.driveway_lights",
"switch.porch_light"
],
"data": "{}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"x": 860,
"y": 740,
"wires": [
[]
]
},
{
"id": "7e0c18d89ab85051",
"type": "api-current-state",
"z": "fa073d83.97c36",
"name": "Sun Down?",
"server": "5d07132e.1b268c",
"version": 3,
"outputs": 2,
"halt_if": "below_horizon",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "sun.sun",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [],
"for": 0,
"forType": "num",
"forUnits": "minutes",
"x": 630,
"y": 760,
"wires": [
[
"0c156c5fb26ac14e",
"13b1f8353363e488"
],
[
"13b1f8353363e488"
]
]
},
{
"id": "b316db8a87c1f6b1",
"type": "switch",
"z": "fa073d83.97c36",
"name": "Delivery?",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "cont",
"v": "on the way",
"vt": "str"
},
{
"t": "cont",
"v": "out for delivery",
"vt": "str"
},
{
"t": "cont",
"v": "is approaching",
"vt": "str"
},
{
"t": "cont",
"v": "pulling up",
"vt": "str"
},
{
"t": "cont",
"v": "in your neighborhood",
"vt": "str"
},
{
"t": "cont",
"v": "dropped off",
"vt": "str"
},
{
"t": "cont",
"v": "delivered",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 7,
"x": 420,
"y": 780,
"wires": [
[
"7e0c18d89ab85051"
],
[
"7e0c18d89ab85051"
],
[
"7e0c18d89ab85051"
],
[
"7e0c18d89ab85051"
],
[
"7e0c18d89ab85051"
],
[
"7e0c18d89ab85051"
],
[
"7e0c18d89ab85051"
]
],
"outputLabels": [
"on the way",
"out for delivery",
"is approaching",
"pulling up",
"in your neighborhood",
"",
""
]
},
{
"id": "13b1f8353363e488",
"type": "link out",
"z": "fa073d83.97c36",
"name": "Alexa Only Notifications",
"mode": "link",
"links": [
"9380aa64.d2f65"
],
"x": 870,
"y": 800,
"wires": [],
"l": true
},
{
"id": "5d07132e.1b268c",
"type": "server",
"name": "Home Assistant",
"version": 4,
"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": "friendlyName",
"statusSeparator": "at: ",
"statusYear": "hidden",
"statusMonth": "short",
"statusDay": "numeric",
"statusHourCycle": "h23",
"statusTimeFormat": "h:m"
}
]