Are you also sick of the e-mails from no-ip.com every 4th week to renew your free hostname?
There is a simple script you can make and then run however you want from a flow.
Requierments
HomeyScript App for Homey | Homey
Steps
- Install linked app above
- visit https://my.homey.app/ from your computer
- Click on HomeyScript icon to the left (highlighted in blue)
- Click on “+ New HomeyScript”
- Name the script to your liking
- Paste this code:
const username = 'your_noip_username';
const password = 'your_noip_password';
const hostname = 'your_noip_hostname';
// Base64 encoding function
function base64encode(str) {
return Buffer.from(str).toString('base64');
}
function updateDDNS() {
const url = `https://dynupdate.no-ip.com/nic/update?hostname=${hostname}`;
const auth = 'Basic ' + base64encode(username + ':' + password);
fetch(url, {
method: 'GET',
headers: {
'Authorization': auth
}
})
.then(response => {
console.log(`statusCode: ${response.status}`);
return response.text();
})
.then(data => {
console.log('response:', data);
})
.catch(error => {
console.error('Error:', error);
});
}
// Call the function to update DDNS
updateDDNS();
- Replace
'your_noip_username'
,'your_noip_password'
, and'your_noip_hostname'
with your actual No-IP credentials and hostname. - Save the script and test. You can log in to no-ip.com and check when your last renewal was, it should be the same timestamp as you ran the script test.
- Create a flow to runt the script as you like, I set up mine to run every two weeks:
This can be combined with other flows or advanced flows to runt when your external IP change or similar.
Hope this will help somebody