I went ahead and created a notification using the Android mobile app, using my example above, but changed it slightly.
[
{
"id": "4b94865a.9ff478",
"type": "server-state-changed",
"z": "196ff00e.dd19f",
"name": "",
"server": "d86c8a3e.cc7138",
"version": 1,
"exposeToHomeAssistant": false,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"entityidfilter": "sun.sun",
"entityidfiltertype": "exact",
"outputinitially": true,
"state_type": "str",
"haltifstate": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"outputs": 1,
"output_only_on_state_change": true,
"x": 300,
"y": 2200,
"wires": [
[
"d5c5fc28.0156"
]
]
},
{
"id": "d5c5fc28.0156",
"type": "change",
"z": "196ff00e.dd19f",
"name": "",
"rules": [
{
"t": "set",
"p": "sunrise",
"pt": "msg",
"to": "data.new_state.attributes.next_rising",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 500,
"y": 2200,
"wires": [
[
"e380d578.8f8788"
]
]
},
{
"id": "e380d578.8f8788",
"type": "api-call-service",
"z": "196ff00e.dd19f",
"name": "",
"server": "d86c8a3e.cc7138",
"version": 1,
"debugenabled": false,
"service_domain": "notify",
"service": "mobile_app_oneplus_6",
"entityId": "",
"data": "{\"message\":\"The next time the sun rises is at {{ sunrise }}\",\"title\":\"Sun Rise\"}",
"dataType": "json",
"mergecontext": "",
"output_location": "payload",
"output_location_type": "msg",
"mustacheAltTags": false,
"x": 740,
"y": 2200,
"wires": [
[
"b96812da.04014"
]
]
},
{
"id": "b96812da.04014",
"type": "debug",
"z": "196ff00e.dd19f",
"name": "Alert - APP",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 970,
"y": 2200,
"wires": []
},
{
"id": "d86c8a3e.cc7138",
"type": "server",
"z": "",
"name": "Home Assistant",
"legacy": false,
"hassio": false,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true,
"cacheJson": true
}
]
The data is RIGHT THERE in the attributes of the state change. When the event fired, the attributes are available RIGHT THERE.
It’s already there.
Yes, but every time a state changes, all the attributes are right there in the message object. Again, it’s right there already.
Then go ahead and pull that out of the event state that changed that fired the flow.
You can literally pull any data you want from that event.