Dnpwwo wrote: ↑Monday 13 November 2017 5:37
Interesting idea. I have changed the ICMP transport to return the elapsed milliseconds to the plugin and it will be in a future beta.
Well done, glad I could offer the inspiration.
Making the change to the example plugin to manage Domoticz devices would take a little more effort as it was written with a particular use in mind (i.e pinging devices on a local subnet). It will kind of work for google.com for example but will keep creating devices in Domoticz when you get a different IP address.
I will look into changing it. What Type and subtype numbers did you use to get a Ms device?
Did it before I knew the power of plugins, so I did it like this:
- manually created a Custom Sensor for each IP that I would like to ping:

- Schermafbeelding 2017-11-13 om 18.32.01.png (70.22 KiB) Viewed 7757 times
- in a Bash script that runs each minute (using Cron) each IP+IDX (both listed in the script) is Ping-ed, the time extracted from the result, and then update the Custom Sensor value by:
Code: Select all
curl "$domoticz/json.htm?type=command¶m=udevice&idx=$idx&nvalue=0&svalue=$value"
Major disadvantage of my setup is quite some maintenance when IP or IDX are added/deleted/changed. This is solved very nicely in your plugin, just change the IP-list
Perhaps 1 other suggestion : The header of the Switch that your Plugin creates is now like "Pinger 129.168.0.3". Would be great if the user can define the header text (the part that says "Pinger") by changing this defintion in your Plugin

- Schermafbeelding 2017-11-13 om 18.49.48.png (13.85 KiB) Viewed 7757 times
to something like:
Name:Address(es) comma separated : TPLink:192.168.0.1, MacBook:192.168.0.2, ESP8266:192.168.0.49
More work, I know
Keep up the good work, let me know I you want me to do some alpha/beta testing of your plugin.