Turn on my DSP-W215 smart plug if at home.
Simple flow to turn DSP-W215 On if my mobile is connected to the network, and Off if not.
Mobile IP has to be configured to be static via your router, so it keep having same address all the time.
It requires ping node to ping
mobile IP address, and node-red-contrib-dlink-dspw
package to control Dlink DSP-W215 smart plug.
cd .node-red
npm install node-red-contrib-dlink-dspw
A Simple demo
1- Set the DSP-W215 IP and PIN.
2- Feed it with json input as shown in the image below. To turn it On/Off.

[{"id":"e04332db.751f8","type":"tab","label":"CheckMe","disabled":false,"info":"Simple flow to trun on DSP-W215 \nif my mobile is connected to the network.\n\nIt requires ping node to ping mobile IP address\n\nMobile IP has to be configured to be static \nvia your router, so it keep having same address \nall the time. \n"},{"id":"ad2e8603.3564b8","type":"function","z":"e04332db.751f8","name":"amIatHome","func":"if(msg.payload)\n msg.payload = {\"On\": true}\nelse \n msg.payload = {\"On\": false}\n \nreturn msg;","outputs":1,"noerr":0,"x":330,"y":240,"wires":[["b842534f.68342","34290429.583bfc"]]},{"id":"b842534f.68342","type":"debug","z":"e04332db.751f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":550,"y":320,"wires":[]},{"id":"3cd422b1.3bcf5e","type":"ping","z":"e04332db.751f8","name":"My Mobile","host":"192.168.1.11","timer":"10","x":120,"y":340,"wires":[["ad2e8603.3564b8"]]},{"id":"34290429.583bfc","type":"dsp-w215","z":"e04332db.751f8","name":"DSP-W215 (my heater)","pin":"123456","ip":"192.168.1.12","x":590,"y":140,"wires":[[]]},{"id":"6dc05227.d621cc","type":"comment","z":"e04332db.751f8","name":"Ping me","info":"This ping my mobile, it returns the ping time or false if ping fails. \n\nThis will give indicator if my mobile connected then user am at home, else outside.","x":120,"y":300,"wires":[]},{"id":"439d8c23.16c484","type":"comment","z":"e04332db.751f8","name":"Check if at home","info":"This function will process the output of ping\nIf false then prepare json input to turn DSP-W215 Off\nelse then prepare json input to turn DSP-W215 On","x":320,"y":200,"wires":[]},{"id":"fbdb2213.97aea","type":"comment","z":"e04332db.751f8","name":"On/Off DSP-W215","info":"You need to set its IP and PIN. \nPIN can be found on the back of DSP-W215 plug.","x":570,"y":100,"wires":[]}]