HomeHome AutomationDynamic IP updates in NodeRED

Dynamic IP updates in NodeRED

Don't worry about changing IP, be happy

Are you stuck in a situation where your WAN IP changes faster than nappies on a year old baby, ruining the access to your network connected drives and other services? Running a premium DNS service with the automatic IP updates can be expensive so it’s time to revisits other options.

Automatic IP updater

Fortunately, you have some options. Not all of them are perfect, but the one I’m going to talk about in this article is free.

How does it work?

The NodeRED flow checks every couple of minutes what is the current IP and if the IP has changed, issues the notification to the relevant device. Using the API I found on the internet, you will be able to send the current WAN IP to any AutoRemote compatible device (Android, Windows PC). The free allowance of 1000 calls a day makes possible to monitor the IP changes every 2 min without additional payments. BONUS: no account creation required to use the API.

NodeRED Flow: Current IP

The “Insert” node comes with repeat setting, which I can use to query the API every X minutes. You could set this to trigger as often as 2 min without hitting the 1000/day limit. I think there is very little reason for the excessive calls so 5-10 min interval is more than enough.

To make the API call, I’m simply making HTTP GET request to:


The response is your IP address which is saved as a global variable with global.set("CurrentIP", msg.payload). I want to set this value only if the device was online, so checking if the msg.statusCode === 200 is a good idea to see if the request has been sent correctly.

I don’t want to spam this message back to my AutoRemote devices unless the value changes, so I placed the RBE node that passes the value when the value changes.

Sending AutoRemote

I send a lot of information via AutoRemote so it makes sense to automate the process somehow. I created a subflow that requires the following information to make the successful request:

  • msg.message – message to pass
  • msg.timeout – TTL
  • msg.device – device name

The message sent to the device contains the prefix currentip and the command with xxx.xxx.xxx.xxx IP: currentip=:=xxx.xxx.xxx.xxx this way I can easily use it in Tasker to set the new IP as a variable


AutoRemote is essentially making a request via Gooogle API to the registered mobile device or a computer running EventGhost. You will need an AR key associated with your device. I’m my example I used the credentials system I designed for NodeRED. The values are stored as global variables and can be pulled by setting the correct device.

//set up AR response
 var device = "AR_"+ msg.device;
 var message = msg.message;
 var timeout = msg.timeout;
 var key = global.get(device);
 //send AR response
 if(timeout === null || timeout === undefined){
     timeout = 10;
 if(message === null || message === undefined){
     message = "no message set";
 var url = "https://autoremotejoaomgcd.appspot.com/sendmessage?key=" + key + "&message=" + message + "&ttl="+ timeout;
 msg.url = url;
 msg.feedback = "Messgage send to " + device + ": " + message;
 return msg;

That script is passed to the HTTP POST and executed. I have added a msg.feedback in output in case you ever want to see what message has been sent. You can reuse this subflow in every flow that requires the AR message to be submitted.

Using the new IP in Tasker and EventGhost

Now, that the IP has been updated and sent to the preferred devices, I will show you how to update the designated variable with the new value. I will use Tasker to do this on Android and EventGhost to store the IP as a variable in EventGhost.

Tasker: My IP

The profile will respond to an intercepted message currentip and update the variable of your choice %CURRENTIP (click here to learn why I use upper case for these).

Profile: DIC IP Update 
	Event: AutoRemote [ Configuration:currentip ]
Enter: DIC Update IP 
	A1: Variable Set [ Name:%CURRENTIP To:%arcomm ]

The Tasker’s profile is supers simple and once your variable is updated you can use it to send HTTP request back to your home server.

EventGhost: My IP

In a similar manner, the intercepted message by EventGhost can be set as a variable in the EventGhost itself. You will be able to pass this data in your scripts to execute other commands and send the web requests.

This is how to extract the IP from the message and save it as a variable:

IP = eg.event.payload.arcomm
setattr(eg.globals, "CurrentIP", IP)

print IP

And this is how you recall the global variable and use it in a python script.

IP = getattr(eg.globals, "CurrentIP")

print IP


Even if your IP changes frequently, you can keep track of that with this project and make sure your systems always have the up to date data. The best part of it – it’s free! Let me know how often your IP changes! If you want to learn more about Tasker use this portal, alternatively I have a very good 7 part tutorial to teach you more about NodeRED. Does your ISP come with serious rules about IP assignment and lease times? Use this Reddit thread to leave me a message.

Project Download

Download project files here. Bear in mind that Patreon supporters have early access to project files and videos.


Nothing says "Thank you" better than keeping my coffee jar topped up!


Support me on Patreon and get an early access to tutorial files and videos.


Bitcoin (BTC)

Use this QR to keep me caffeinated with BTC: 1FwFqqh71mUTENcRe9q4s9AWFgoc8BA9ZU

Smart Ideas with

Automate your space in with these ecosystems and integrate it with other automation services


Learn NodeRED

NodeRED for beginners: 1. Why do you need a NodeRED server?

To server or not to server? That's a very silly question!

Best Automation Projects

Tuya SDK for beginners: Intro to Tuya Cloud API

Working with Tuya Cloud API. A guide to Cloud automation for beginners, get started with REST!

NEST your old thermostat under $5

Nest-ing up your older thermostat under $5

Nora – Google Assistant in NodeRED

Integrate Google Assistant with NodeRED thanks to Nora - NodeRED home automation

Sonoff Zigbee Bridge – review

Sonoff line up will soon include Sonoff Zigbee Bridge and more Zigbee sensors - here is the first look

DIY Smart Washing Machine – for about 15 bucks!

Learn how to add washing machine notifications to your Google Home on the cheap

Smart Home

I wish I had known about the SMLIGHT ZigBee/Thread Coordinators sooner!

SMLIGHT coordinators are the perfect choice for anyone just diving into ZigBee. SLZB-06 series is easy to use and comes with future-proofing Thread support.

Sonoff ZigBee Bridge U isn’t what you think!

I expected Sonoff ZB Bridge U to be a next gen ZigBee bridge with Matter support. Turns out, there is much more to talk about!

Aqara “Everything” M3 Hub

When I started my home automation adventure, the current problem was the number of ecosystems needed to outfit your smart home. Aqara M3 Hub has a long list of protocols to match that!

Sonoff ZB Micro did it! (and bonus ZigBee device)

A long time ago, I took an angle grinder to the humble Sonoff Micro, will I do this again? Meet Sonoff ZB Micro and Sonoff ZB Contact (SNZB-04P) - the latest devices from the ZigBee ecosystem.

This keyless entry is PRO: SwitchBot Lock Pro

SwitchBot Lock Pro offers comprehensive upgrades over the original, combining enhanced design, stronger performance, and a faster mechanism for keyless entry