plugin.OnChangeRequest = onChangeRequest; plugin.OnConnect = onConnect; plugin.OnDisconnect = onDisconnect; plugin.OnPoll = onPoll; plugin.OnSynchronizeDevices = onSynchronizeDevices; plugin.PollingInterval = 5000; var http = new HTTPClient(); // STANDARD START function getDevice(id) { return plugin.Devices[id]; } // STANDARD END function onChangeRequest(device, attribute, value) { } function onConnect() { // console.log("connected"); } function onDisconnect() { // console.log("disconnected"); } function onPoll() { var myDevice = getDevice("CurrentIP") var request = http.get("https://api.ipify.org/?format=josn&callback=") request1 = (request.data[0] + request.data[1]) if(request1 == 90) { myDevice.IPAddress = "internal" } else { myDevice.IPAddress = "external" } } function onSynchronizeDevices() { }