Hello,
I am new in-home automation especially using Node-Red. I have about 5 Zigbee door sensors that I would like to set up notification using Node-Red so if the battery level drops to 10% I will get ios notification including what door and what is the current battery level. Below is my current code. it works but I can’t get to show what door the notification is coming from. If you guys have another approach I am willing to give a try.
[
{
"id": "6f352f41.b3a56",
"type": "switch",
"z": "2bcdf7f.373dc08",
"name": "Check Battery",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "lt",
"v": "92",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 860,
"y": 220,
"wires": [
[
"d49efa1d.d6d868"
]
]
},
{
"id": "b57e03e3.e9fa2",
"type": "api-call-service",
"z": "2bcdf7f.373dc08",
"name": "Notify Garen",
"server": "5264684c.884f58",
"version": 1,
"debugenabled": false,
"service_domain": "notify",
"service": "ios_garens_iphone",
"entityId": "",
"data": "{}",
"dataType": "json",
"mergecontext": "",
"output_location": "payload",
"output_location_type": "msg",
"mustacheAltTags": false,
"x": 1250,
"y": 220,
"wires": [
[]
]
},
{
"id": "d49efa1d.d6d868",
"type": "function",
"z": "2bcdf7f.373dc08",
"name": "Data",
"func": "msg.payload = \n{\n \"data\": \n {\n \"message\": msg.payload\n }\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1070,
"y": 220,
"wires": [
[
"b57e03e3.e9fa2"
]
]
},
{
"id": "60a602a5.6256cc",
"type": "inject",
"z": "2bcdf7f.373dc08",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 100,
"y": 220,
"wires": [
[
"5d93d9d1.b743c8"
]
]
},
{
"id": "5d93d9d1.b743c8",
"type": "api-current-state",
"z": "2bcdf7f.373dc08",
"name": "",
"server": "5264684c.884f58",
"version": 1,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"override_topic": false,
"entity_id": "sensor.garage_back_door_sensor_battery_level",
"state_type": "str",
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"blockInputOverrides": false,
"x": 450,
"y": 220,
"wires": [
[
"6f352f41.b3a56"
]
]
},
{
"id": "5264684c.884f58",
"type": "server",
"z": "",
"name": "Home Assistant",
"legacy": false,
"hassio": true,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": false,
"cacheJson": true
}
]