New Plugin : NETMON - a network device monitor

[quote=“DesT, post:40, topic:199119”]amg0,

It is possible to have a toggle somewhere to “INVERT” the detector. I will prefer like AK to have the inverse that a detectesd device is tripped…[/quote]

I added the inverted option in v0.7 in github. if you change status inverted property, you need to wait until the device is tested, or to force a refresh on the device ( test button ) before you get a coherent status

Just update the plugin and change the settings for Invert and when I “test” a device it give me the right answer BUT all my devices are still Untripped…

[quote=“amg0, post:41, topic:199119”][quote=“DesT, post:40, topic:199119”]amg0,

It is possible to have a toggle somewhere to “INVERT” the detector. I will prefer like AK to have the inverse that a detectesd device is tripped…[/quote]

I added the inverted option in v0.7 in github. if you change status inverted property, you need to wait until the device is tested, or to force a refresh on the device ( test button ) before you get a coherent status[/quote]

Ohhh I think I understand my problem.

I need to invert the “motion” status… not the “online/offline” status…

Hi,
I don’t have the impression that this plugin is working on my Veraplus / UI7 / latest FW
So I defined just 2 IP’s to check, 1 if certainly online, the other not.
Still they are bot reported online and nothing really seems to happen ?
I’m just seeing the main Netmon-app/device, no “child” devices/sensors are visible in my GUI even after browser-reload (latest Chrome , Version 72.0.3626.81 (Official Build) (64-bit) on Ubuntu)
I’ve put on the debug-mode and captured some output, followed by 2 ping tests myself from the console.

50 02/01/19 21:54:47.104 luup_log:6432: NETMON: debug: setVariableIfChanged(urn:upnp-org:serviceId:netmon1,DevicesStatus,[ { “name”: “TV”, “ipaddr”: “172.29.45.17” }, { “name”: “FAKE”, “ipaddr”: “172.29.45.18” } ],6432) <0x748d8520>
50 02/01/19 21:54:47.105 luup_log:6432: NETMON: debug: setVariableIfChanged(urn:upnp-org:serviceId:netmon1,DevicesOfflineCount,0,6432) <0x748d8520>
50 02/01/19 21:54:47.105 luup_log:6432: NETMON: debug: programming next refreshDevices(6432) in 10 sec <0x748d8520>
50 02/01/19 21:54:57.100 luup_log:6432: NETMON: debug: refreshDevices(6432) <0x748d8520>
50 02/01/19 21:54:57.102 luup_log:6432: NETMON: debug: refreshOneDevice(6432,null) <0x748d8520>
50 02/01/19 21:54:57.102 luup_log:6432: NETMON: debug: getDevicesStatus(6432) <0x748d8520>
50 02/01/19 21:54:57.104 luup_log:6432: NETMON: debug: setVariableIfChanged(urn:upnp-org:serviceId:netmon1,DevicesNotification,6432) <0x748d8520>
50 02/01/19 21:54:57.104 luup_log:6432: NETMON: debug: setVariableIfChanged(urn:upnp-org:serviceId:netmon1,DevicesStatus,[ { “name”: “TV”, “ipaddr”: “172.29.45.17” }, { “name”: “FAKE”, “ipaddr”: “172.29.45.18” } ],6432) <0x748d8520>
50 02/01/19 21:54:57.105 luup_log:6432: NETMON: debug: setVariableIfChanged(urn:upnp-org:serviceId:netmon1,DevicesOfflineCount,0,6432) <0x748d8520>
50 02/01/19 21:54:57.105 luup_log:6432: NETMON: debug: programming next refreshDevices(6432) in 10 sec <0x748d8520>
50 02/01/19 21:55:07.100 luup_log:6432: NETMON: debug: refreshDevices(6432) <0x748d8520>
50 02/01/19 21:55:07.102 luup_log:6432: NETMON: debug: refreshOneDevice(6432,null) <0x748d8520>
50 02/01/19 21:55:07.102 luup_log:6432: NETMON: debug: getDevicesStatus(6432) <0x748d8520>
50 02/01/19 21:55:07.104 luup_log:6432: NETMON: debug: setVariableIfChanged(urn:upnp-org:serviceId:netmon1,DevicesNotification,6432) <0x748d8520>
50 02/01/19 21:55:07.104 luup_log:6432: NETMON: debug: setVariableIfChanged(urn:upnp-org:serviceId:netmon1,DevicesStatus,[ { “name”: “TV”, “ipaddr”: “172.29.45.17” }, { “name”: “FAKE”, “ipaddr”: “172.29.45.18” } ],6432) <0x748d8520>
50 02/01/19 21:55:07.105 luup_log:6432: NETMON: debug: setVariableIfChanged(urn:upnp-org:serviceId:netmon1,DevicesOfflineCount,0,6432) <0x748d8520>
50 02/01/19 21:55:07.105 luup_log:6432: NETMON: debug: programming next refreshDevices(6432) in 10 sec <0x748d8520>
50 02/01/19 21:55:17.100 luup_log:6432: NETMON: debug: refreshDevices(6432) <0x748d8520>
50 02/01/19 21:55:17.102 luup_log:6432: NETMON: debug: refreshOneDevice(6432,null) <0x748d8520>
50 02/01/19 21:55:17.102 luup_log:6432: NETMON: debug: getDevicesStatus(6432) <0x748d8520>
50 02/01/19 21:55:17.104 luup_log:6432: NETMON: debug: setVariableIfChanged(urn:upnp-org:serviceId:netmon1,DevicesNotification,6432) <0x748d8520>
50 02/01/19 21:55:17.105 luup_log:6432: NETMON: debug: setVariableIfChanged(urn:upnp-org:serviceId:netmon1,DevicesStatus,[ { “name”: “TV”, “ipaddr”: “172.29.45.17” }, { “name”: “FAKE”, “ipaddr”: “172.29.45.18” } ],6432) <0x748d8520>
50 02/01/19 21:55:17.105 luup_log:6432: NETMON: debug: setVariableIfChanged(urn:upnp-org:serviceId:netmon1,DevicesOfflineCount,0,6432) <0x748d8520>
50 02/01/19 21:55:17.105 luup_log:6432: NETMON: debug: programming next refreshDevices(6432) in 10 sec <0x748d8520>
^C
root@MiOS_50160552:/tmp/log/cmh# ping 172.29.45.17
PING 172.29.45.17 (172.29.45.17) 56(84) bytes of data.
64 bytes from 172.29.45.17: icmp_req=1 ttl=64 time=0.410 ms
64 bytes from 172.29.45.17: icmp_req=2 ttl=64 time=0.300 ms
64 bytes from 172.29.45.17: icmp_req=3 ttl=64 time=0.295 ms
^C
— 172.29.45.17 ping statistics —
3 packets transmitted, 3 received, 0% packet loss, time 1999ms
rtt min/avg/max/mdev = 0.295/0.335/0.410/0.053 ms
root@MiOS_50160552:/tmp/log/cmh# ping 172.29.45.18
PING 172.29.45.18 (172.29.45.18) 56(84) bytes of data.
From 172.29.45.250 icmp_seq=1 Destination Host Unreachable
From 172.29.45.250 icmp_seq=2 Destination Host Unreachable
From 172.29.45.250 icmp_seq=3 Destination Host Unreachable
^C
— 172.29.45.18 ping statistics —
5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3999ms
pipe 4
root@MiOS_50160552:/tmp/log/cmh#

Try going to Settings:Z-Wave Settings:Advanced and click the reload engine button. This will reload the luup engine, which should create the child devices. Then reload the browser to clear anything in the cache. Offline devices take about a minute to show up as the plugin will poll (ping) on a set schedule.

Thx for the feedback, in the meantime it seems to be working.
I’ve removed the app (through GUI) and SSH’ed in the box and removed all effective files too.
Then a clean install again from the app-store with version 0.5

Then I immediately assigned a room to it (while previously I left it as “No Room”) and created some IP’s to ping & saved.
Even then I would not see child-devices even after luup-reload.
I finally rebooted the whole unit … then indeed child-devices showed up and are ready to use.

Now I’m running v0.5 of the plugin, I can simply fetch the github v0.7 code and transfer the files to the Vera (through GUI => Apps => Develop Apps) so effectively overwrite them ?

I’ve set a low timer on the pings (eg. 2 seconds) since I want to use it to detect if a smart-TV is on. Much faster then obtaining the Watt-usage on a port to make the decision if a TV is turned on.

I now simply uploaded the Github v0.7 files (all of them) onto the Vera and reloaded.

It seems the plugin does like a system reboot in order to clean things.
Eg. I removed my 2 ping “entries” on the mail NETMON-app , saved etc.
The child-devices remain in place, even after closing browser & login again etc.

Only after performing a system reboot, it seems my 2 child-devices are now effectively gone.
This is expected behaviour ? The same for renaming, when I rename the 2 defined probes in the Netmon-app , the child-devices do not follow and keep their original name given at time of creation.

I installed update 0.7 for this plugin and change the settings to Invert, but the “motion” device is still untripped. Also after reload luup engine.
Does anyone have a solution.
Thanks

[quote=“bobies, post:48, topic:199119”]I installed update 0.7 for this plugin and change the settings to Invert, but the “motion” device is still untripped. Also after reload luup engine.
Does anyone have a solution.
Thanks[/quote]

here is a procedure to try to help
1 enable DEBUG mode, reload the plugin
2 go to netmon STATUS tab, click on the TEST button for your device
3 get the log file from vera
4 share here or with me by email.
( I need the whole sequence in debug from the NETMON startup )
thx

Thanks for the reply, but were can I find this log file after debug is enabled?

Q: How to get logs
A: Several methods
a) classic way

  1. turn on DEBUG 2) open http://Your.Vera.IP.Address/cgi-bin/cmh/log.sh?Device=LuaUPnP 3) let it run for a while so the problem happens 4) in your browser save the file on your disk 5) open with an editor (notepad or whatever ) and search for your iCloud email , change email/pwd so I do not see it , save the file 6) send it to me using PM on this forum

b) using infoviewer

  1. open InfoViewer, put the pattern to “netmon”
  2. open Infoviewer page then View Logs
  3. same as above a.4 a.5 a.6

c) using WinSCP / Windows

  1. use WinSCP
  2. chose SCP as file protocol
  3. Hostname = your vera ip address , username=root , Password= your vera password
  4. once logged in , go to folder /var/log/cmh/
  5. select file LuaUPnP.log , drag and drop it on your desktop
  6. same as a.5, a.6

having the same problem, although I inverted a tested node, it is mentioning off-line , but test button tells on-line

today i installed v0.7 and also struggled with the inverted option always showed off-line. I think the problem is in line 389 (L_NETMON.lua) always return “true” if inverted is set to 1. I am not very familiar with lua but i always had this urge to solve problems so i did a bit trial-and-error and changed your code for testing:

line 389 (L_NETMON.lua) > local value = (inverted==1 and not success) or (inverted==0 and success)

it works but its probably not the correct way to code it.

[quote=“florianec, post:53, topic:199119”]today i installed v0.7 and also struggled with the inverted option always showed off-line. I think the problem is in line 389 (L_NETMON.lua) always return “true” if inverted is set to 1. I am not very familiar with lua but i always had this urge to solve problems so i did a bit trial-and-error and changed your code for testing:

line 389 (L_NETMON.lua) > local value = (inverted==1 and not success) or (inverted==0 and success)

it works but its probably not the correct way to code it.[/quote]

please try version 0.8 on github and let me know how it goes. I refactored some important logics in it

Hi, I set this up with 2 phones as triggers and happy days. I went into router and fixed IP’s for both. The trigger is used to unlock our front door automatically which is amazing, however, randomly my front door will lock and then relock maybe 5 times and stop. Next day my alarm goes off on phone to wake up and instantly 3 times in a row my front door locks and then relocks. As I type this my front door just unlocked. Whilst in thought what to explain next it just unlocked again. Both times it was my Wifes iPhone that triggered the event and she is asleep.

Using VeraLite (Up to date), both have iPhones on the latest IOS. NetMon v0.7. Utilising the 'Ping" feature with ‘Device armed and stops detecting motion’.

How can I fix this? I was starting to think of setting up a trigger to disable until we left the house. However I think I’d need another service like geo fencing to do this, prefer not.

Should I invert and start detecting motion?

Have you checked if your Vera is behaving normally , have you checked for intempestive luup reload in the logs for instance ?

In general I would not use netmon for real-time ,low latency situations like unlocking the front door. Have you tried iPhone locator ?

Hi, everything else I’ve setup is working fine and I’ve had Vera for many years. Although I don’t understand intempestive luup reload. The reason I chose this way is because we live in an apartment building on the 11th floor. Geofencing style means it doesn’t know when I’m actually approaching my door, whereas this one connects when I get out of the lift and as I approach the door it unlocks then relocks 30 secs later.

I also use Netmon - but it´s not reliable. What I mean is that if a phone is left by it´s self for a while, it´s offline according to Netmon. But if I use it - and it uses Internet - then It´s reported as online. Same goes for all our 6 phones in my household. So as long as we´re active and using the phones, it´s a great accurate plugin. But nighttime or if I take a a long shower, it´s not that great…

or go to sleep…;o)
Ok, that sounds exactly like what is happening. Have you been able to fix or have you thought of a workaround for this? I was thinking of adding to the trigger to disarm that sensor and maybe use geofencing to show when I leave to re-enable.

No, I haven´t fixed it. It´s not been a priority. @amg0 prehaps have a workaround or solution?