My goal is to detect when my phone or my wife's phone is at home or not. One way I thought of was to use the ARP node to get all of the IP and MAC addresses in my router's ARP table, then look for our phones.
If there's a better/easier way to determine home or away, please advise me.
I think that I would use the JSONATA node to find a matching IP or MAC, but the data doesn't look right for a JSONATA search. (I have never used JSONATA before). So, how would I determine, for example, if "192.168.1.31" is present?
Here's what my ARP node delivers in msg.payload:
[
{
"ip":"192.168.1.67",
"mac":"cc:50:e3:0c:6e:00",
"iface":"eth0"
},
{
"ip":"192.168.1.31",
"mac":"c4:1c:ff:13:9e:61",
"iface":"eth0"
},
{
"ip":"192.168.1.4",
"mac":"dc:a6:32:09:22:a1",
"iface":"eth0"
},
{
"ip":"192.168.1.42",
"mac":"bc:dd:c2:25:9a:0f",
"iface":"eth0"
},
{
"ip":"192.168.1.19",
"mac":"14:91:38:8f:71:68",
"iface":"eth0"
},
{
"ip":"192.168.1.57",
"mac":"98:5f:d3:e6:aa:9b",
"iface":"eth0"
},
{
"ip":"192.168.1.23",
"mac":"1c:69:7a:0a:62:c6",
"iface":"eth0"
},
{
"ip":"192.168.1.61",
"mac":"a4:ba:db:b8:96:45",
"iface":"eth0"
},
{
"ip":"192.168.1.34",
"mac":"68:54:fd:33:c2:79",
"iface":"eth0"
},
{
"ip":"192.168.1.101",
"mac":"8c:7f:3b:76:18:c8",
"iface":"eth0"
},
{
"ip":"192.168.1.11",
"mac":"00:bb:3a:e4:77:0c",
"iface":"eth0"
},
{
"ip":"192.168.1.49",
"mac":"a0:20:a6:30:de:20",
"iface":"eth0"
},
{
"ip":"192.168.1.204",
"mac":"60:01:94:86:74:b8",
"iface":"eth0"
},
{
"ip":"192.168.1.49",
"mac":"a0:20:a6:30:de:20",
"iface":"eth0"
},
{
"ip":"192.168.1.204",
"mac":"60:01:94:86:74:b8",
"iface":"eth0"
},
{
"ip":"192.168.1.15",
"mac":"2c:3a:e8:11:8e:2e",
"iface":"eth0"
},
{
"ip":"192.168.1.53",
"mac":"78:0f:77:5a:e3:f0",
"iface":"eth0"
},
{
"ip":"192.168.1.26",
"mac":"0c:ee:99:07:df:08",
"iface":"eth0"
},
{
"ip":"192.168.1.41",
"mac":"ec:fa:bc:06:6d:93",
"iface":"eth0"
},
{
"ip":"192.168.1.30",
"mac":"dc:a6:32:09:22:a1",
"iface":"eth0"
},
{
"ip":"192.168.1.7",
"mac":"d0:e7:82:f0:c4:57",
"iface":"eth0"
},
{
"ip":"192.168.1.70",
"mac":"50:02:91:68:ea:7f",
"iface":"eth0"
},
{
"ip":"192.168.1.18",
"mac":"ec:fa:bc:06:80:d2",
"iface":"eth0"
},
{
"ip":"192.168.1.56",
"mac":"dc:ef:ca:bc:96:c3",
"iface":"eth0"
},
{
"ip":"192.168.1.33",
"mac":"6c:ad:f8:61:b6:ad",
"iface":"eth0"
},
{
"ip":"192.168.1.22",
"mac":"84:0d:8e:ad:ad:c1",
"iface":"eth0"
},
{
"ip":"192.168.1.37",
"mac":"b0:35:b5:b6:fe:bd",
"iface":"eth0"
},
{
"ip":"192.168.1.203",
"mac":"84:0d:8e:44:2f:a2",
"iface":"eth0"
},
{
"ip":"192.168.1.100",
"mac":"3c:df:a9:6c:bf:de",
"iface":"eth0"
},
{
"ip":"192.168.1.10",
"mac":"b4:e6:2d:67:b7:d0",
"iface":"eth0"
},
{
"ip":"192.168.1.48",
"mac":"5c:cf:7f:fa:b7:45",
"iface":"eth0"
},
{
"ip":"192.168.1.230",
"mac":"00:01:fb:00:1f:41",
"iface":"eth0"
},
{
"ip":"192.168.1.25",
"mac":"44:65:0d:5f:a5:9d",
"iface":"eth0"
},
{
"ip":"192.168.1.14",
"mac":"8c:f5:a3:68:55:0f",
"iface":"eth0"
},
{
"ip":"192.168.1.52",
"mac":"2c:3a:e8:01:1f:0f",
"iface":"eth0"
},
{
"ip":"192.168.1.65",
"mac":"1c:69:7a:0f:87:76",
"iface":"eth0"
},
{
"ip":"192.168.1.2",
"mac":"00:d0:2d:43:8d:62",
"iface":"eth0"
},
{
"ip":"192.168.1.17",
"mac":"60:38:e0:5c:3f:85",
"iface":"eth0"
},
{
"ip":"192.168.1.6",
"mac":"60:01:94:69:2d:b5",
"iface":"eth0"
},
{
"ip":"192.168.1.21",
"mac":"9c:8e:cd:0e:98:51",
"iface":"eth0"
},
{
"ip":"192.168.1.59",
"mac":"50:02:91:69:78:9c",
"iface":"eth0"
},
{
"ip":"192.168.1.32",
"mac":"50:e5:49:56:4c:87",
"iface":"eth0"
},
{
"ip":"192.168.1.9",
"mac":"60:01:94:66:ad:29",
"iface":"eth0"
},
{
"ip":"192.168.1.63",
"mac":"3c:5c:c4:31:59:d5",
"iface":"eth0"
},
{
"ip":"192.168.1.72",
"mac":"a4:ba:db:b8:96:45",
"iface":"eth0"
},
{
"ip":"192.168.1.36",
"mac":"cc:50:e3:5b:66:8a",
"iface":"eth0"
},
{
"ip":"192.168.1.202",
"mac":"60:01:94:ab:45:90",
"iface":"eth0"
},
{
"ip":"192.168.1.13",
"mac":"30:95:e3:24:03:fd",
"iface":"eth0"
},
{
"ip":"192.168.1.143",
"mac":"a0:20:a6:0f:38:fa",
"iface":"eth0"
},
{
"ip":"192.168.1.24",
"mac":"80:7d:3a:7f:e8:f3",
"iface":"eth0"
},
{
"ip":"192.168.1.1",
"mac":"18:1b:eb:7b:0d:df",
"iface":"eth0"
},
{
"ip":"192.168.1.55",
"mac":"00:18:dd:06:9a:fd",
"iface":"eth0"
},
{
"ip":"192.168.1.64",
"mac":"1c:69:7a:0f:87:76",
"iface":"eth0"
},
{
"ip":"192.168.1.131",
"mac":"b8:27:eb:66:72:3b",
"iface":"eth0"
},
{
"ip":"192.168.1.28",
"mac":"6c:ad:f8:30:a9:f7",
"iface":"eth0"
},
{
"ip":"192.168.1.5",
"mac":"60:01:94:51:d1:25",
"iface":"eth0"
},
{
"ip":"192.168.1.43",
"mac":"a4:ee:57:5b:e2:87",
"iface":"eth0"
},
{
"ip":"192.168.1.16",
"mac":"60:01:94:69:36:df",
"iface":"eth0"
},
{
"ip":"192.168.1.47",
"mac":"24:4c:e3:ec:a1:c2",
"iface":"eth0"
},
{
"ip":"192.168.1.20",
"mac":"5c:cf:7f:b4:61:a3",
"iface":"eth0"
},
{
"ip":"192.168.1.58",
"mac":"3c:5c:c4:0f:40:8e",
"iface":"eth0"
},
{
"ip":"192.168.1.35",
"mac":"d8:f1:5b:c6:4f:48",
"iface":"eth0"
},
{
"ip":"192.168.1.201",
"mac":"60:01:94:ab:53:2b",
"iface":"eth0"
},
{
"ip":"192.168.1.8",
"mac":"7c:a7:b0:9b:a5:d8",
"iface":"eth0"
},
{
"ip":"192.168.1.62",
"mac":"10:ae:60:a7:2a:48",
"iface":"eth0"
},
{
"ip":"192.168.1.39",
"mac":"00:d0:2d:b2:52:c5",
"iface":"eth0"
},
{
"ip":"192.168.1.50",
"mac":"4c:11:ae:0d:81:ef",
"iface":"eth0"
},
{
"ip":"192.168.1.27",
"mac":"84:0d:8e:ad:a7:5b",
"iface":"eth0"
},
{
"ip":"192.168.1.54",
"mac":"1c:69:7a:0a:62:c6",
"iface":"eth0"
}
]