Home_Presence Detection mit FritzBox

  • Erkennung An-, Abwesenheit mit FritzBox WLAN Erkennung (iPhone MAC Adr.)
  • Prüfung Presence condition (On/ OFF)
  • Msg an push service bei Statusänderung
[{"id":"9e058217.92f748","type":"tab","label":"Präsenzerkennung","disabled":false,"info":""},{"id":"1a43fe2f.8d062a","type":"fritzbox-in","z":"9e058217.92f748","device":"abc89632.bca148","name":"iPhone Susi ON?","service":"urn:dslforum-org:service:Hosts:1","action":"GetSpecificHostEntry","arguments":"{\"NewMACAddress\":\"value\"}","x":310,"y":420,"wires":[["46481568.722734","32815384.7e8ca4"]]},{"id":"46481568.722734","type":"debug","z":"9e058217.92f748","name":"Ergebnis Fritzbox Ausgang S","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":560,"y":340,"wires":[]},{"id":"a352a63b.e81d68","type":"inject","z":"9e058217.92f748","name":"Mein Handy","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"600","crontab":"","once":false,"onceDelay":"5","topic":"","payload":"{\"NewMACAddress\":\"9C:E6:5E:23:45:70\"}","payloadType":"json","x":110,"y":420,"wires":[["1a43fe2f.8d062a"]]},{"id":"32815384.7e8ca4","type":"switch","z":"9e058217.92f748","name":"Select newActive value","property":"payload.NewActive","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":230,"y":260,"wires":[["32c6da86.a87c96"],["8aded829.ebb358"]]},{"id":"ade05823.6ff6c","type":"fritzbox-in","z":"9e058217.92f748","device":"abc89632.bca148","name":"iPhone Volker ON?","service":"urn:dslforum-org:service:Hosts:1","action":"GetSpecificHostEntry","arguments":"{\"NewMACAddress\":\"value\"}","x":310,"y":500,"wires":[["cc7dc6f8.796e7","1d58534b.30d855"]]},{"id":"cc7dc6f8.796e7","type":"debug","z":"9e058217.92f748","name":"Ergebnis Fritzbox Ausgang V","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":560,"y":560,"wires":[]},{"id":"4a0ac66e.b46a98","type":"inject","z":"9e058217.92f748","name":"Mein Handy","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"600","crontab":"","once":false,"onceDelay":"5","topic":"","payload":"{\"NewMACAddress\":\"6C:E8:5C:D3:E8:B8\"}","payloadType":"json","x":110,"y":500,"wires":[["ade05823.6ff6c"]]},{"id":"908b8d27.a797c","type":"pushover api","z":"9e058217.92f748","keys":"b3f7dc39.28d708","title":"Home Presence","name":"","x":1355,"y":460,"wires":[],"l":false,"info":"msg = msg.payload\nreturn msg;"},{"id":"39c507bf.d52558","type":"rbe","z":"9e058217.92f748","name":"Value changes only","func":"rbei","gap":"","start":"","inout":"out","property":"payload","x":850,"y":440,"wires":[["bb169fd9.6b393"]]},{"id":"30d168a7.26d228","type":"BooleanLogic","z":"9e058217.92f748","name":"Gate","operation":"OR","inputCount":"2","topic":"result","x":630,"y":440,"wires":[["abb53e7d.0a6158","a1a331c2.50f578","39c507bf.d52558","2e9ba54a.3c2682"]],"inputLabels":["msg.boolean"],"outputLabels":["msg.boolean"]},{"id":"abb53e7d.0a6158","type":"BDebug","z":"9e058217.92f748","name":"Debug","x":750,"y":500,"wires":[]},{"id":"32c6da86.a87c96","type":"change","z":"9e058217.92f748","name":"S_1_true","rules":[{"t":"set","p":"topic","pt":"msg","to":"S_1","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":220,"wires":[["30d168a7.26d228"]]},{"id":"f3cd26ab.3b12b","type":"change","z":"9e058217.92f748","name":"V_1_true","rules":[{"t":"set","p":"topic","pt":"msg","to":"V_1","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":600,"wires":[["30d168a7.26d228"]]},{"id":"67ad4a87.d5a97c","type":"function","z":"9e058217.92f748","name":"UND  V1&S1","func":"msg.payload=(msg.payload.V_1==1 && msg.payload.S_1==1);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":540,"y":880,"wires":[[]]},{"id":"1d58534b.30d855","type":"switch","z":"9e058217.92f748","name":"Select newActive value","property":"payload.NewActive","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":230,"y":640,"wires":[["f3cd26ab.3b12b"],["387fcb85.328ba4"]]},{"id":"a1a331c2.50f578","type":"debug","z":"9e058217.92f748","name":"Output OR Gate","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":820,"y":280,"wires":[]},{"id":"32812062.80d798","type":"debug","z":"9e058217.92f748","name":"Msg for pushover","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1190,"y":400,"wires":[]},{"id":"bb169fd9.6b393","type":"function","z":"9e058217.92f748","name":"Ergebnis ODER Gate","func":"if (msg.payload === true) {\n    msg.payload = \"Anwesend\"\nreturn msg;\n} else if (msg.payload === false) {\n    msg.payload = \"Nicht Anwesend\"\nreturn msg;\n};\n\n//if (NewActive = \"1\") {\n//    msg.payload = \"V. ist zu Hause\"\n//return msg;\n//} else if (NewActive = \"1\"){\n//    msg.payload = \"V. ist nicht zu Hause\"\n//return msg;\n//};","outputs":1,"noerr":0,"initialize":"","finalize":"","x":920,"y":360,"wires":[["8f9fae5c.43f9a8","ee54d6aa.fb1f18"]]},{"id":"8f9fae5c.43f9a8","type":"function","z":"9e058217.92f748","name":"input für pushover msg","func":"msg = {\n    payload : msg.payload,\n    topic: \"HOME Presence\"\n};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1130,"y":460,"wires":[["908b8d27.a797c","32812062.80d798","203a893b.aa8636"]]},{"id":"ee54d6aa.fb1f18","type":"debug","z":"9e058217.92f748","name":"input push msg","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1120,"y":280,"wires":[]},{"id":"2e9ba54a.3c2682","type":"link out","z":"9e058217.92f748","name":"Präsenz Status","links":["2b00c2fd.95b95e"],"x":795,"y":320,"wires":[]},{"id":"387fcb85.328ba4","type":"change","z":"9e058217.92f748","name":"V_1_false","rules":[{"t":"set","p":"topic","pt":"msg","to":"V_1","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":660,"wires":[["30d168a7.26d228"]]},{"id":"8aded829.ebb358","type":"change","z":"9e058217.92f748","name":"S_1_false","rules":[{"t":"set","p":"topic","pt":"msg","to":"S_1","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":300,"wires":[["30d168a7.26d228"]]},{"id":"203a893b.aa8636","type":"mqtt out","z":"9e058217.92f748","name":"Präsenz_Home","topic":"/Home/Alarm/Präsenz_Home","qos":"0","retain":"true","broker":"c9f5d7a6.d2fd58","x":1460,"y":280,"wires":[]},{"id":"b107e75a.18b16","type":"inject","z":"9e058217.92f748","name":"T1 true","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":1070,"y":140,"wires":[[]]},{"id":"93233b50.0282","type":"inject","z":"9e058217.92f748","name":"T1 false","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"false","payloadType":"bool","x":1070,"y":180,"wires":[[]]},{"id":"abc89632.bca148","type":"fritzbox-config","z":"","name":"7590","host":"192.168.178.1","port":"49443","ssl":true},{"id":"b3f7dc39.28d708","type":"pushover-keys","z":"","name":"","info":"a5pm6wjf1srs42vv8q6g4k9u4"},{"id":"c9f5d7a6.d2fd58","type":"mqtt-broker","z":"","name":"Raspi","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]

Flow Info

Created 5 years, 1 month ago
Rating: 5 1

Owner

Actions

Rate:

Node Types

Core
  • change (x4)
  • debug (x5)
  • function (x3)
  • inject (x4)
  • link out (x1)
  • mqtt out (x1)
  • mqtt-broker (x1)
  • rbe (x1)
  • switch (x2)
Other

Tags

  • Home_Presence
  • FritzBox
  • push
  • msg
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option