Page 5 of 9
Re: Plugin - Wan IP Checker
Posted: Thursday 01 February 2018 13:20
by ycahome
manjh wrote: ↑Thursday 01 February 2018 12:41
Hmmm. replaced the code in the plugin.py, restarted Domoticz, and enabled the plugin.
Code: Select all
2018-02-01 12:40:01.517 Error: (WAN IP checker) 'onHeartbeat' failed 'ValueError'.
2018-02-01 12:40:01.517 Error: (WAN IP checker) ----> Line 151 in /home/pi/domoticz/plugins/WAN-IP-CHECKER/plugin.py, function onHeartbeat
2018-02-01 12:40:01.517 Error: (WAN IP checker) ----> Line 102 in /home/pi/domoticz/plugins/WAN-IP-CHECKER/plugin.py, function onHeartbeat
2018-02-01 12:40:01.517 Error: (WAN IP checker) ----> Line 153 in /usr/lib/python3.4/urllib/request.py, function urlopen
2018-02-01 12:40:01.517 Error: (WAN IP checker) ----> Line 440 in /usr/lib/python3.4/urllib/request.py, function open
2018-02-01 12:40:01.517 Error: (WAN IP checker) ----> Line 258 in /usr/lib/python3.4/urllib/request.py, function __init__
2018-02-01 12:40:01.517 Error: (WAN IP checker) ----> Line 284 in /usr/lib/python3.4/urllib/request.py, function full_url
2018-02-01 12:40:01.517 Error: (WAN IP checker) ----> Line 313 in /usr/lib/python3.4/urllib/request.py, function _parse
2018-02-01 12:40:03.075 dzVents: Warning! WAN IP has changed!
please set "Debug" to "True" and PM me the results.
Re: Plugin - Wan IP Checker
Posted: Thursday 01 February 2018 13:36
by manjh
ycahome wrote: ↑Thursday 01 February 2018 13:20
manjh wrote: ↑Thursday 01 February 2018 12:41
Hmmm. replaced the code in the plugin.py, restarted Domoticz, and enabled the plugin.
Code: Select all
2018-02-01 12:40:01.517 Error: (WAN IP checker) 'onHeartbeat' failed 'ValueError'.
2018-02-01 12:40:01.517 Error: (WAN IP checker) ----> Line 151 in /home/pi/domoticz/plugins/WAN-IP-CHECKER/plugin.py, function onHeartbeat
2018-02-01 12:40:01.517 Error: (WAN IP checker) ----> Line 102 in /home/pi/domoticz/plugins/WAN-IP-CHECKER/plugin.py, function onHeartbeat
2018-02-01 12:40:01.517 Error: (WAN IP checker) ----> Line 153 in /usr/lib/python3.4/urllib/request.py, function urlopen
2018-02-01 12:40:01.517 Error: (WAN IP checker) ----> Line 440 in /usr/lib/python3.4/urllib/request.py, function open
2018-02-01 12:40:01.517 Error: (WAN IP checker) ----> Line 258 in /usr/lib/python3.4/urllib/request.py, function __init__
2018-02-01 12:40:01.517 Error: (WAN IP checker) ----> Line 284 in /usr/lib/python3.4/urllib/request.py, function full_url
2018-02-01 12:40:01.517 Error: (WAN IP checker) ----> Line 313 in /usr/lib/python3.4/urllib/request.py, function _parse
2018-02-01 12:40:03.075 dzVents: Warning! WAN IP has changed!
please set "Debug" to "True" and PM me the results.
Done
Re: Plugin - Wan IP Checker
Posted: Thursday 01 February 2018 13:40
by ycahome
manjh wrote: ↑Thursday 01 February 2018 13:36
you forgot the "https://" prefix on the Check My IP URL.
Seems that "except" cannot catch "ValueError"
Re: Plugin - Wan IP Checker
Posted: Thursday 01 February 2018 13:53
by manjh
ycahome wrote: ↑Thursday 01 February 2018 13:40
manjh wrote: ↑Thursday 01 February 2018 13:36
you forgot the "https://" prefix on the Check My IP URL.
Seems that "except" cannot catch "ValueError"
Yes, that did it!
I think it would be useful to add a check on this. People are so used to typing the URL without the prefix.
For instance, when I type "hashemian.com/whoami/" in my browser address line, it will automatically add the
prefix "
https://www." to create the full URL.
Alternatively, add a text on the window to make sure people type the complete, full URL...
Re: Plugin - Wan IP Checker
Posted: Thursday 01 February 2018 13:55
by manjh
Last question on testing: in order to test the whole string of actions, I would like to see a mail coming into my mailbox from the plugin.
Is there a way to force this? Can I manually change the "kept" URL to trigger this? Where is it stored?
Re: Plugin - Wan IP Checker
Posted: Thursday 01 February 2018 15:40
by ycahome
manjh wrote: ↑Thursday 01 February 2018 13:55
Last question on testing: in order to test the whole string of actions, I would like to see a mail coming into my mailbox from the plugin.
Is there a way to force this? Can I manually change the "kept" URL to trigger this? Where is it stored?
You put me on a close pressing,
Ok, update it once more. You are going to find some interesting features.
Enable notifications and Debug mode, put check interval at "60". Notifications are triggered on every 5 minutes (1st and 5th minute)
I hope you like it,
Re: Plugin - Wan IP Checker
Posted: Thursday 01 February 2018 16:48
by manjh
ycahome wrote: ↑Thursday 01 February 2018 15:40
manjh wrote: ↑Thursday 01 February 2018 13:55
Last question on testing: in order to test the whole string of actions, I would like to see a mail coming into my mailbox from the plugin.
Is there a way to force this? Can I manually change the "kept" URL to trigger this? Where is it stored?
You put me on a close pressing,
Yes, I hear that a lot. I have worked several years as professional SW tester for a worldclass IT company, so I guess it's in my blood...
Re: Plugin - Wan IP Checker
Posted: Thursday 01 February 2018 16:53
by manjh
changed and restarted...
Code: Select all
2018-02-01 16:52:12.526 (WAN IP checker) Initialized version 1.2.1, author 'ycahome'
2018-02-01 16:52:12.581 (WAN IP checker) Debug log level set to: 'false'.
2018-02-01 16:52:16.845 (P1 meter) P1 Smart Meter (Power)
2018-02-01 16:52:18.303 (RFLink De Meern) Temp + Humidity (Alecto V4)
2018-02-01 16:52:24.864 (WAN IP checker) WAN IP Updated to:145.129.114.127
2018-02-01 16:52:24.866 (WAN IP checker) Running WAN IP Notifications
2018-02-01 16:52:24.870 Incoming connection from: ::1
2018-02-01 16:52:24.873 Error: (WAN IP checker) HTTP Request error: HTTP Error 401: Unauthorized URL: http://localhost:8080/json.htm?type=command¶m=sendnotification&subject=WAN-IP-Changed&body=145.129.114.127
Also found that after restart there were suddenly two entries in the HW overview, different IDX's.
After a bit of thought removed both and added a new line.
Re: Plugin - Wan IP Checker
Posted: Thursday 01 February 2018 16:58
by ycahome
manjh wrote: ↑Thursday 01 February 2018 16:53
changed and restarted...
Code: Select all
2018-02-01 16:52:12.526 (WAN IP checker) Initialized version 1.2.1, author 'ycahome'
2018-02-01 16:52:12.581 (WAN IP checker) Debug log level set to: 'false'.
2018-02-01 16:52:16.845 (P1 meter) P1 Smart Meter (Power)
2018-02-01 16:52:18.303 (RFLink De Meern) Temp + Humidity (Alecto V4)
2018-02-01 16:52:24.864 (WAN IP checker) WAN IP Updated to:145.129.114.127
2018-02-01 16:52:24.866 (WAN IP checker) Running WAN IP Notifications
2018-02-01 16:52:24.870 Incoming connection from: ::1
2018-02-01 16:52:24.873 Error: (WAN IP checker) HTTP Request error: HTTP Error 401: Unauthorized URL: http://localhost:8080/json.htm?type=command¶m=sendnotification&subject=WAN-IP-Changed&body=145.129.114.127
Lets not talk about Testing and troubleshooting, will overrun this forum.
what is your Domoticz Http port? obviously not 8080
Re: Plugin - Wan IP Checker
Posted: Thursday 01 February 2018 17:00
by manjh
ycahome wrote: ↑Thursday 01 February 2018 16:58
manjh wrote: ↑Thursday 01 February 2018 16:53
changed and restarted...
Code: Select all
2018-02-01 16:52:12.526 (WAN IP checker) Initialized version 1.2.1, author 'ycahome'
2018-02-01 16:52:12.581 (WAN IP checker) Debug log level set to: 'false'.
2018-02-01 16:52:16.845 (P1 meter) P1 Smart Meter (Power)
2018-02-01 16:52:18.303 (RFLink De Meern) Temp + Humidity (Alecto V4)
2018-02-01 16:52:24.864 (WAN IP checker) WAN IP Updated to:145.129.114.127
2018-02-01 16:52:24.866 (WAN IP checker) Running WAN IP Notifications
2018-02-01 16:52:24.870 Incoming connection from: ::1
2018-02-01 16:52:24.873 Error: (WAN IP checker) HTTP Request error: HTTP Error 401: Unauthorized URL: http://localhost:8080/json.htm?type=command¶m=sendnotification&subject=WAN-IP-Changed&body=145.129.114.127
It is 8080.
Lets not talk about Testing and troubleshooting, will overrun this forum.
what is your Domoticz Http port? obviously not 8080
Could it be caused by that duplicate HW line? The same plugin was defined twice somehow. I removed them and re-installed, and now it doesn't crash. But I don't see any new options, and no mail getting into my mail box...
Re: Plugin - Wan IP Checker
Posted: Thursday 01 February 2018 17:18
by ycahome
Did you set :
- plugin "Notifications" = Notify?
- plugin "Debug" = True?
- Domoticz Email Settings?
- Waited 5 minutes?
Have you got any new errors on your log?
I think that you should leave your Testing Hat and work on your troubleshooting skills

- mailsettings.JPG (110.48 KiB) Viewed 2813 times
Re: Plugin - Wan IP Checker
Posted: Thursday 01 February 2018 17:26
by manjh
ycahome wrote: ↑Thursday 01 February 2018 17:18
Did you set :
- plugin "Notifications" = Notify? YES
- plugin "Debug" = True? YES
- Domoticz Email Settings? checked, all is correct
- Waited 5 minutes? YES
Have you got any new errors on your log? NO
I think that you should leave your Testing Hat and work on your troubleshooting skills
mailsettings.JPG
Re: Plugin - Wan IP Checker
Posted: Thursday 01 February 2018 17:27
by manjh
got this again:
Code: Select all
2018-02-01 17:25:47.455 (WAN IP Checker) WAN IP retrieved:145.129.114.127
2018-02-01 17:25:47.455 (WAN IP Checker) Previous WAN IP:145.129.114.127
2018-02-01 17:25:47.455 Error: (WAN IP Checker) Debug is on. Trigering IP Change:
2018-02-01 17:25:47.456 (WAN IP Checker) WAN IP Updated to:145.129.114.127
2018-02-01 17:25:47.456 (WAN IP) Updating device from 1:'145.129.114.127' to have values 1:'145.129.114.127'.
2018-02-01 17:25:47.817 (WAN IP Checker) Running WAN IP Notifications
2018-02-01 17:25:47.823 Error: (WAN IP Checker) HTTP Request error: HTTP Error 401: Unauthorized URL: http://localhost:8080/json.htm?type=command¶m=sendnotification&subject=WAN-IP-Changed&body=145.129.114.127
2018-02-01 17:26:44.980 (WAN IP Checker) Calling message handler 'onHeartbeat'.
2018-02-01 17:26:44.980 (WAN IP Checker) onHeartbeat called
2018-02-01 17:26:46.427 (WAN IP Checker) IP Discovery Site's response len is:15
2018-02-01 17:26:46.427 (WAN IP Checker) WAN IP retrieved:145.129.114.127
2018-02-01 17:26:46.427 (WAN IP Checker) Previous WAN IP:145.129.114.127
2018-02-01 17:26:46.427 (WAN IP Checker) WAN IP the same. Skipping
Re: Plugin - Wan IP Checker
Posted: Thursday 01 February 2018 17:34
by manjh
manjh wrote: ↑Thursday 01 February 2018 17:26
ycahome wrote: ↑Thursday 01 February 2018 17:18
I think that you should leave your Testing Hat and work on your troubleshooting skills
mailsettings.JPG
Yeah, testers can be a real pain-in-the-youknowwhat...
Are you sure this is a valid URL on a Raspberry-Pi :
http://localhost:8080
Re: Plugin - Wan IP Checker
Posted: Thursday 01 February 2018 18:01
by ycahome
Is it a Raspbian jessie? or something different?
Also, you have set your Domoticz for "http"? "https"? or both?
Do you have authentication (password) set on your Domoticz?
P.S.: try to run from your PC by replacing <domoticz ip> with your server's IP:
http://<domoticz ip>:8080/json.htm?type=command¶m=sendnotification&subject=WAN-IP-Changed&body=145.129.114.127
Re: Plugin - Wan IP Checker
Posted: Thursday 01 February 2018 18:59
by manjh
ycahome wrote: ↑Thursday 01 February 2018 18:01
Is it a Raspbian jessie? or something different?
Also, you have set your Domoticz for "http"? "https"? or both?
Do you have authentication (password) set on your Domoticz?
P.S.: try to run from your PC by replacing <domoticz ip> with your server's IP:
http://<domoticz ip>:8080/json.htm?type=command¶m=sendnotification&subject=WAN-IP-Changed&body=145.129.114.127
When done from my Win10 laptop,it comes back with this:
{
status: "OK",
title: "SendNotification"
}
I use Jessie. On the settings, I have this in local networks: 10.0.0.*; 127.0.0.*; 10.8.0.*
10.0.0 is my lan IP range. 127.0.0 for local, and 10.8.0 for access via VPN.
The good news is that I now see an email in my inbox! So if we tackle the triggering, we're all done!
Re: Plugin - Wan IP Checker
Posted: Thursday 01 February 2018 20:52
by ycahome
Do you have password protection on your domoticz?
Re: Plugin - Wan IP Checker
Posted: Thursday 01 February 2018 22:23
by ycahome
Check a new minor version 1.2.2
Re: Plugin - Wan IP Checker
Posted: Thursday 01 February 2018 22:26
by manjh
ycahome wrote: ↑Thursday 01 February 2018 20:52
Do you have password protection on your domoticz?
Yes I do. But anything coming from within my network (10.0.0.*) comes in free. As wel as 127.0.0.*, and 10.0.8.*.
Re: Plugin - Wan IP Checker
Posted: Thursday 01 February 2018 22:37
by ycahome
manjh wrote: ↑Thursday 01 February 2018 22:26
ycahome wrote: ↑Thursday 01 February 2018 20:52
Do you have password protection on your domoticz?
Yes I do. But anything coming from within my network (10.0.0.*) comes in free. As wel as 127.0.0.*, and 10.0.8.*.
try to add "::1", I saw that connections from localhost logged as "Incoming connection from: ::1"
Don't forget to use version 1.2.2. Contains some corrections.