domoticzag wrote: ↑Monday 29 January 2018 22:29
.... I would need to do some Python exercises first, I am an experienced C programmer but this is just a little bit different.
Its only a matter of some lines.
Plugin updates it's sensor only if there is an actual IP change.
We can add a plugin parameter to enable/disable notification and an alert immediate after update.
domoticzag wrote: ↑Monday 29 January 2018 22:29
.... I would need to do some Python exercises first, I am an experienced C programmer but this is just a little bit different.
Its only a matter of some lines.
Plugin updates it's sensor only if there is an actual IP change.
We can add a plugin parameter to enable/disable notification and an alert immediate after update.
If you can wait, I can upload a new version...
That would be awsome, thanks in advance!
RPi 3
Domoticz Béta
RFLink Gateway dipool antenna
Many kaku devices
P1 smart meter
Custom made ESP8266 devices
Hue lights / Milight ligts and strips
domoticzag wrote: ↑Monday 29 January 2018 22:29
.... I would need to do some Python exercises first, I am an experienced C programmer but this is just a little bit different.
Its only a matter of some lines.
Plugin updates it's sensor only if there is an actual IP change.
We can add a plugin parameter to enable/disable notification and an alert immediate after update.
If you can wait, I can upload a new version...
I think it might be just as easy to have a Domoticz script react to a change in the text device that the plugin updates once the address changes.
But this would result in one single e-mail.
My solution is more complex, but it will keep sending one warning mail per day until I take action.
manjh wrote: ↑Wednesday 31 January 2018 18:55
Where is the new code? I checked github but no luck... can you provide a link?
Sorry, just saw that you actually updated the code in the first post. Got it.
Now that I have it running, need a little guidance:
1. if I enable notification, will it send an e-mail? To which mail address?
2. what does the field "IP address"mean?
manjh wrote: ↑Wednesday 31 January 2018 19:25
Sorry, just saw that you actually updated the code in the first post. Got it.
Now that I have it running, need a little guidance:
1. if I enable notification, will it send an e-mail? To which mail address?
2. what does the field "IP address"mean?
1. If you enable notifications, Domoticz notification settings will be used
2. "IP address" is a typo (Corrected now). Actually means "Check My IP URL" and is the URL that returns your WAN IP.
manjh wrote: ↑Wednesday 31 January 2018 19:25
Sorry, just saw that you actually updated the code in the first post. Got it.
Now that I have it running, need a little guidance:
1. if I enable notification, will it send an e-mail? To which mail address?
2. what does the field "IP address"mean?
1. If you enable notifications, Domoticz notification settings will be used
2. "IP address" is a typo (Corrected now). Actually means "Check My IP URL" and is the URL that returns your WAN IP.
OK, understand # 1. Does the plugin send one single notification, or repeating?
As for #2: what is it used for? Compare to the outside IP address? Or should I fill in a site like WhoAmI?
manjh wrote: ↑Wednesday 31 January 2018 21:54
OK, understand # 1. Does the plugin send one single notification, or repeating?
As for #2: what is it used for? Compare to the outside IP address? Or should I fill in a site like WhoAmI?
1. Single notification (one for each notification option set on settings) for every WAN IP change.
2. You can use the default one or another. Its up to you.
I have created a F.A.Q section on the first post in order to help other users with their questions.
2018-02-01 09:27:03.950 Error: (WAN IP checker) 'onHeartbeat' failed 'ValueError'.
2018-02-01 09:27:03.950 Error: (WAN IP checker) ----> Line 151 in /home/pi/domoticz/plugins/WAN-IP-CHECKER/plugin.py, function onHeartbeat
2018-02-01 09:27:03.950 Error: (WAN IP checker) ----> Line 109 in /home/pi/domoticz/plugins/WAN-IP-CHECKER/plugin.py, function onHeartbeat
2018-02-01 09:27:03.950 Error: (WAN IP checker) ----> Line 153 in /usr/lib/python3.4/urllib/request.py, function urlopen
2018-02-01 09:27:03.950 Error: (WAN IP checker) ----> Line 440 in /usr/lib/python3.4/urllib/request.py, function open
2018-02-01 09:27:03.950 Error: (WAN IP checker) ----> Line 258 in /usr/lib/python3.4/urllib/request.py, function __init__
2018-02-01 09:27:03.950 Error: (WAN IP checker) ----> Line 284 in /usr/lib/python3.4/urllib/request.py, function full_url
2018-02-01 09:27:03.950 Error: (WAN IP checker) ----> Line 313 in /usr/lib/python3.4/urllib/request.py, function _parse
2018-02-01 09:27:03.950 Error: (WAN IP checker) 'onHeartbeat' failed 'ValueError'.
2018-02-01 09:27:03.950 Error: (WAN IP checker) ----> Line 151 in /home/pi/domoticz/plugins/WAN-IP-CHECKER/plugin.py, function onHeartbeat
2018-02-01 09:27:03.950 Error: (WAN IP checker) ----> Line 109 in /home/pi/domoticz/plugins/WAN-IP-CHECKER/plugin.py, function onHeartbeat
2018-02-01 09:27:03.950 Error: (WAN IP checker) ----> Line 153 in /usr/lib/python3.4/urllib/request.py, function urlopen
2018-02-01 09:27:03.950 Error: (WAN IP checker) ----> Line 440 in /usr/lib/python3.4/urllib/request.py, function open
2018-02-01 09:27:03.950 Error: (WAN IP checker) ----> Line 258 in /usr/lib/python3.4/urllib/request.py, function __init__
2018-02-01 09:27:03.950 Error: (WAN IP checker) ----> Line 284 in /usr/lib/python3.4/urllib/request.py, function full_url
2018-02-01 09:27:03.950 Error: (WAN IP checker) ----> Line 313 in /usr/lib/python3.4/urllib/request.py, function _parse
This is because plugin does not contain error handling on urlopen (try catch). Maybe on next version.
If a connection fails completely you will not have a way to post your notification so, another method should be in place (SMS or GPRS).
As for the test, we can include a plugin option "Test" (just like "Debug") with a custom function that will fill a random IP and trick the plugin. Maybe on the next version too.
EDIT: Just remembered that Settings/Notifications have "Test" buttons. You can always try those buttons. You want a different approach?
2018-02-01 09:27:03.950 Error: (WAN IP checker) 'onHeartbeat' failed 'ValueError'.
2018-02-01 09:27:03.950 Error: (WAN IP checker) ----> Line 151 in /home/pi/domoticz/plugins/WAN-IP-CHECKER/plugin.py, function onHeartbeat
2018-02-01 09:27:03.950 Error: (WAN IP checker) ----> Line 109 in /home/pi/domoticz/plugins/WAN-IP-CHECKER/plugin.py, function onHeartbeat
2018-02-01 09:27:03.950 Error: (WAN IP checker) ----> Line 153 in /usr/lib/python3.4/urllib/request.py, function urlopen
2018-02-01 09:27:03.950 Error: (WAN IP checker) ----> Line 440 in /usr/lib/python3.4/urllib/request.py, function open
2018-02-01 09:27:03.950 Error: (WAN IP checker) ----> Line 258 in /usr/lib/python3.4/urllib/request.py, function __init__
2018-02-01 09:27:03.950 Error: (WAN IP checker) ----> Line 284 in /usr/lib/python3.4/urllib/request.py, function full_url
2018-02-01 09:27:03.950 Error: (WAN IP checker) ----> Line 313 in /usr/lib/python3.4/urllib/request.py, function _parse
This is because plugin does not contain error handling on urlopen (try catch). Maybe on next version.
If a connection fails completely you will not have a way to post your notification so, another method should be in place (SMS or GPRS).
As for the test, we can include a plugin option "Test" (just like "Debug") with a custom function that will fill a random IP and trick the plugin. Maybe on the next version too.
EDIT: Just remembered that Settings/Notifications have "Test" buttons. You can always try those buttons. You want a different approach?
Thank you
Hmmm... it failed, and it does not get back on its feet any more. I restored the correct value but the plugin still crashes...
For now I have disabled it and will do some more testing later.
As for the test functions: I agree but the test on settings/notifications actually test only that functionality. By adding a test button to the plugin, you could actually test the whole path, including the plugin.
One way to do it is to make the last known IP available to the HW screen. The user could change that, and see the plugin react.
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!