Is there a Dynamic DNS script?
Moderator: leecollings
-
- Posts: 358
- Joined: Tuesday 31 March 2015 22:06
- Target OS: Linux
- Domoticz version: 2024.3
- Location: east netherlands
- Contact:
Is there a Dynamic DNS script?
Hi all, is there a (freedns) script around that will update a dynamic dns url and push data into domoticz?
I have a direct url wich only needs to be opened to update my dynamic dns wan ip, it would be great to do this from inside domoticz.
Thanks a lot!
Merry Christmas
I have a direct url wich only needs to be opened to update my dynamic dns wan ip, it would be great to do this from inside domoticz.
Thanks a lot!
Merry Christmas
Raspberry / ESP Boards / Relais / Milight / Hue / OTGW / P1 / Xiaomi / RFXCom / RFLink / ZWave / Conbee II / Z2M / MQTT / A lot of scripts and many more..
Software: Linux, Android and Windows
Software: Linux, Android and Windows
- habahabahaba
- Posts: 190
- Joined: Saturday 18 March 2023 14:44
- Target OS: Windows
- Domoticz version: 2024.4
- Contact:
Re: Is there a Dynamic DNS script?
If you need only to open known url you can use dzvents script that will make it by timer as often as you need
by using
domoticz.openURL('<YOUR_URL>')
by using
domoticz.openURL('<YOUR_URL>')
-
- Posts: 358
- Joined: Tuesday 31 March 2015 22:06
- Target OS: Linux
- Domoticz version: 2024.3
- Location: east netherlands
- Contact:
Re: Is there a Dynamic DNS script?
So, only curling an url is not the thing, i want also a virtual device with wan ip and when it has updated.. any examples? Pardon me, maybe i was not clear enough. Thanks!
Raspberry / ESP Boards / Relais / Milight / Hue / OTGW / P1 / Xiaomi / RFXCom / RFLink / ZWave / Conbee II / Z2M / MQTT / A lot of scripts and many more..
Software: Linux, Android and Windows
Software: Linux, Android and Windows
- habahabahaba
- Posts: 190
- Joined: Saturday 18 March 2023 14:44
- Target OS: Windows
- Domoticz version: 2024.4
- Contact:
Re: Is there a Dynamic DNS script?
Still not sure what do you want.
Any notifyer with you current ip ?
Any notifyer with you current ip ?
-
- Posts: 358
- Joined: Tuesday 31 March 2015 22:06
- Target OS: Linux
- Domoticz version: 2024.3
- Location: east netherlands
- Contact:
Re: Is there a Dynamic DNS script?
I want domoticz let do my dynamic dns update and update an virtual device as well when the ip has changed and updated
Raspberry / ESP Boards / Relais / Milight / Hue / OTGW / P1 / Xiaomi / RFXCom / RFLink / ZWave / Conbee II / Z2M / MQTT / A lot of scripts and many more..
Software: Linux, Android and Windows
Software: Linux, Android and Windows
- habahabahaba
- Posts: 190
- Joined: Saturday 18 March 2023 14:44
- Target OS: Windows
- Domoticz version: 2024.4
- Contact:
Re: Is there a Dynamic DNS script?
So, first you need to know what is your IP now (for example here)
Then you can push it where you want
Then you can push it where you want
-
- Posts: 358
- Joined: Tuesday 31 March 2015 22:06
- Target OS: Linux
- Domoticz version: 2024.3
- Location: east netherlands
- Contact:
Re: Is there a Dynamic DNS script?
I know, but that is still not a script
I was hoping that someone has some script or similar already
I was hoping that someone has some script or similar already
Raspberry / ESP Boards / Relais / Milight / Hue / OTGW / P1 / Xiaomi / RFXCom / RFLink / ZWave / Conbee II / Z2M / MQTT / A lot of scripts and many more..
Software: Linux, Android and Windows
Software: Linux, Android and Windows
- habahabahaba
- Posts: 190
- Joined: Saturday 18 March 2023 14:44
- Target OS: Windows
- Domoticz version: 2024.4
- Contact:
Re: Is there a Dynamic DNS script?
Code: Select all
-- 123
return {
on = {
timer = {
'every minute' -- just an example to trigger the request
},
httpResponses = {
'GettingIP' -- название должно совпадать с методом Callback ниже
}
},
logging = {
level = domoticz.LOG_INFO,
marker = 'GettingIP',
},
execute = function(domoticz, item)
local ip_url = 'https://api.ipify.org/?format=json'
if (item.isTimer) then
domoticz.openURL({
method = 'GET',
url = ip_url,
callback = 'GettingIP', -- see httpResponses above.
}).afterSec(1)
end
if (item.isHTTPResponse) then
if (item.ok) then
if (item.isJSON) then
local jsonParser = require('JSON')
local json1 = jsonParser:decode(item.data)
local currentIP = json1['ip'] --
local devIdx = 40 -- idx of your text device with current ip
domoticz.devices(devIdx).updateText('Current ip: '..currentIP)
domoticz.log('Current IP: '.. currentIP, domoticz.LOG_INFO)
--- uncomment and put your data
--[[domoticz.openURL({
method = 'POST',
url = '<YOUR POST URL WITH CUR IP>',
callback = 'Updating IP', -- see httpResponses above.
}).afterSec(1)]]--
end
else
--OOOPS
domoticz.log('ERROR', domoticz.LOG_ERROR)
domoticz.log(item, domoticz.LOG_ERROR)
end
end
end
}
-
- Posts: 358
- Joined: Tuesday 31 March 2015 22:06
- Target OS: Linux
- Domoticz version: 2024.3
- Location: east netherlands
- Contact:
Re: Is there a Dynamic DNS script?
Great!! Thank you very much! Going to try tonighthabahabahaba wrote: ↑Tuesday 26 December 2023 19:252023-12-26_21-30-12.pngCode: Select all
-- 123 return { on = { timer = { 'every minute' -- just an example to trigger the request }, httpResponses = { 'GettingIP' -- название должно совпадать с методом Callback ниже } }, logging = { level = domoticz.LOG_INFO, marker = 'GettingIP', }, execute = function(domoticz, item) local ip_url = 'https://api.ipify.org/?format=json' if (item.isTimer) then domoticz.openURL({ method = 'GET', url = ip_url, callback = 'GettingIP', -- see httpResponses above. }).afterSec(1) end if (item.isHTTPResponse) then if (item.ok) then if (item.isJSON) then local jsonParser = require('JSON') local json1 = jsonParser:decode(item.data) local currentIP = json1['ip'] -- local devIdx = 40 -- idx of your text device with current ip domoticz.devices(devIdx).updateText('Current ip: '..currentIP) domoticz.log('Current IP: '.. currentIP, domoticz.LOG_INFO) --- uncomment and put your data --[[domoticz.openURL({ method = 'POST', url = '<YOUR POST URL WITH CUR IP>', callback = 'Updating IP', -- see httpResponses above. }).afterSec(1)]]-- end else --OOOPS domoticz.log('ERROR', domoticz.LOG_ERROR) domoticz.log(item, domoticz.LOG_ERROR) end end end }
Raspberry / ESP Boards / Relais / Milight / Hue / OTGW / P1 / Xiaomi / RFXCom / RFLink / ZWave / Conbee II / Z2M / MQTT / A lot of scripts and many more..
Software: Linux, Android and Windows
Software: Linux, Android and Windows
Who is online
Users browsing this forum: No registered users and 1 guest