Page 8 of 9
Re: Python Plugin: Wan IP Checker
Posted: Sunday 11 March 2018 12:22
by ycahome
set url to "
https://4.ifcfg.me/ip" no "
http://4.ifcfg.me/ip"
normal http redirects to https but, I don't know if this redirection is possible via urllib request!!
Edit: Port0 is a variable that never used. you can ignore it.
Re: Python Plugin: Wan IP Checker
Posted: Sunday 11 March 2018 12:51
by Nickkkk72
- yes, i used htpps no http (was just a test).
- ok for port 0
you've right, i tested this url through my Windows web browser. I use Jessie through terminal (no GUI, it's Jessie light).
Maybe this URL isn't reachable from raspberry... searching a way to let me test it via terminal.
My device is up to date, and fresh installed.
i encountre many issues with urllib with another plugin (Melcloud)...
Re: Python Plugin: Wan IP Checker
Posted: Sunday 11 March 2018 12:58
by ycahome
Nickkkk72 wrote: Sunday 11 March 2018 12:51
Maybe this URL isn't reachable from raspberry... searching a way to let me test it via terminal.
My device is up to date, and fresh installed.
i encountre many issues with urllib with another plugin (Melcloud)...
Re: Python Plugin: Wan IP Checker
Posted: Sunday 11 March 2018 13:07
by Nickkkk72
i've already tested it with wget. was unreachable.
i've checked my ip config (static) and it was ok, but i found other issues on my LAN.
After check evrything... In fact, it was a Smart TV player which was nevertheless configured in DHCP which had a reserved IP ... and there was an IP conflict which made crazy my router...
I'm sorry for bothering you.
Thank you for the plugin, and thank you for your responsiveness ...
Re: Python Plugin: Wan IP Checker
Posted: Sunday 11 March 2018 13:10
by ycahome
glad you sorted this out!!
Re: Python Plugin: Wan IP Checker
Posted: Tuesday 03 April 2018 8:43
by ycahome
Hello,
Seems that "
https://4.ifcfg.me/ip" that is used as default service on the plugin, is unavailable.
Alternatively you can use "
http://whatismyip.akamai.com/".
More can be found on article bellow (nice work!):
https://unix.stackexchange.com/question ... ipt/194136
Re: Python Plugin: Wan IP Checker
Posted: Tuesday 03 April 2018 17:03
by manjh
Excellent. That fixed it!
Re: Python Plugin: Wan IP Checker
Posted: Monday 23 April 2018 10:48
by cmartens75
Hi,
I have installed the script. Is it necessary to create a virtual device in Domoticz under Hardware? Which steps are required for this? Besides that, how can you test the script? Thanks in advance for the answers.
Re: Python Plugin: Wan IP Checker
Posted: Monday 23 April 2018 15:09
by ycahome
if you mean that you have installed the plugin then, no additional actions required (apart from the python prerequisites). Device will appear on your utility section.
Re: Python Plugin: Wan IP Checker
Posted: Monday 23 April 2018 19:58
by cmartens75
I have installed the latest version of the plugin via GitHub and followed the installation instructions. After the installation I have changed the URL in the plugin.py file from "
https://4.ifcfg.me/ip" to "
http://whatismyip.akamai.com/". Besides that, I have changed the port 8080 to 14080 as Domoticz is running via port 14080 in my situation. I have assumed that this change is required, but I am not sure. Can you tell me? Finally, I have restarted Domoticz. I don't see any new devices in the Utility section. What can I do to check what is wrong? Thanks in advance for your reaction.
Re: Python Plugin: Wan IP Checker
Posted: Tuesday 24 April 2018 19:19
by ycahome
enable debug mode for this plugin
Re: Python Plugin: Wan IP Checker
Posted: Wednesday 25 April 2018 22:39
by cmartens75
Solved! I have used the script below. Besides that I created a virtual device (WAN IP) in Domoticz for storing the IP address: Settings – Hardware – Naam: WAN IP – Type: Dummy – Toevoegen. Finally I created a virtual sensor with WAN IP as name and Sensor Type: Text.
return {
on = {
timer = { 'every 4 hours' }
},
logging = {
level = domoticz.LOG_FORCE,
marker = '[WAN IP]'
},
execute = function(dz, devNil)
local dzb = dz.LOG_FORCE
local getIp = 'curl -s
http://whatismyip.akamai.com/'
local tmpFile = '/home/pi/domoticz/scripts/wanip.txt'
local actIp = ''
local devIp = dz.devices('WAN IP')
local currIp = devIp.text
os.execute(getIp..' > '..tmpFile)
actIp = io.open(tmpFile):read()
if actIp == nil then actIp = 'Cannot retrieve WAN IP' end
if actIp ~= currIp then
msgTxt = 'WAN IP has changed: '..currIp..' ==> '..actIp
dz.log(msgTxt, dzb)
dz.notify('WAN IP', msgTxt, dz.PRIORITY_EMERGENCY)
devIp.updateText(actIp)
os.execute('rm '..tmpFile)
else
dz.log('No change in WAN IP', dzb)
end
end
}
Re: Python Plugin: Wan IP Checker
Posted: Wednesday 25 April 2018 22:55
by ycahome
cmartens75 wrote: Wednesday 25 April 2018 22:39
Solved! I have used the script below. Besides that I created a virtual device (WAN IP) in Domoticz for storing the IP address: Settings – Hardware – Naam: WAN IP – Type: Dummy – Toevoegen. Finally I created a virtual sensor with WAN IP as name and Sensor Type: Text.
This is not a solution to your plugin problem. It's a totally different script that do (or don't do) the same job.
Try to not hijack threads by putting individual scripts on a plugin's thread.
If you want you can create your thread to the respective category.
Re: Python Plugin: Wan IP Checker
Posted: Saturday 29 September 2018 13:59
by Kivi
I'm using
https://wtfismyip.com/text and works great.
Re: Python Plugin: Wan IP Checker
Posted: Monday 17 February 2020 19:47
by BarryT
maybe some weird question, but is there a wizkid somewhere around here that could make a dyndns out from this script that should do an dynsdns update when the ip has changed?

i have a vps with a subdomain linked to my private ip, but when my provider changes my wan ip, i cannot connect it ofcourse.
at this moment i use the dyndns from my usg gateway that does its job, but i want to use my own (sub)domain..
Re: Python Plugin: Wan IP Checker
Posted: Monday 17 February 2020 19:58
by ycahome
Dyndns providers (subscripton based) have scripts to update dynamic IPs. You can try to trigger one of those scripts from domoticz!
Re: Python Plugin: Wan IP Checker
Posted: Monday 17 February 2020 20:02
by BarryT
ycahome wrote: Monday 17 February 2020 19:58
Dyndns providers (subscripton based) have scripts to update dynamic IPs. You can try to trigger one of those scripts from domoticz!
Yeah, i know

but i do not want to use others, i just want to use my own vps and (subdomain) dns and be my own dyndns host..

Re: Python Plugin: Wan IP Checker
Posted: Wednesday 01 April 2020 10:09
by Dave21w
I hate to sound really stupid but here goes, I installed the plugin and indeed it works flawlessly, I have "Prowl" setup for my push notifications on other things so would like to use this to send me my IP info, where is the General txt value stored so I can do something with it ?
I have no issue with hardware construction and problem solving and software setup I can following instructions but scripting wise at the moment I have to use blockly cause i just can't get my head around anything else and it's not for the lack of trying.
TIA
Dave
Re: Python Plugin: Wan IP Checker
Posted: Wednesday 01 April 2020 19:29
by ycahome
Dave21w wrote: Wednesday 01 April 2020 10:09
I hate to sound really stupid but here goes, I installed the plugin and indeed it works flawlessly, I have "Prowl" setup for my push notifications on other things so would like to use this to send me my IP info, where is the General txt value stored so I can do something with it ?
I have no issue with hardware construction and problem solving and software setup I can following instructions but scripting wise at the moment I have to use blockly cause i just can't get my head around anything else and it's not for the lack of trying.
TIA
Dave
Hi Dave.
did you tried blockly Utility device actual value?
Re: Python Plugin: Wan IP Checker
Posted: Sunday 05 April 2020 21:21
by iTDB
It looks like you need to set the Timer to 60 sec, otherwise you will get next error every minute
Error: IP Checker hardware (Idx) thread seems to have ended unexpectedly
Is there a way to set that to 1 or 2 hours without this error.