Python plugin: Presence detection from wireless router

Python and python framework
mvzut
Posts: 376
Joined: Thursday 12 November 2015 11:55
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Marum, The Netherlands
Contact:

Python plugin: Presence detection from wireless router

Post by mvzut » Friday 12 October 2018 8:22

hjzwiers wrote:With Asus AImesh putting in both IP addresses does not work, still only sees the main router.

=arp fails, =brctl works

Just giving the info, I'll stick to brctl thnx
Is it easy/possible to temporarily switch off this AImesh feature? I suspect this is causing your problem.
On my system I have two routers (Asus and Linksys) just using the same SSID (but another channel), so no AImesh or anything. The plugin perfectly finds the correct HW methods on both routers, I don't need to force anything.
Raspberry Pi 3 - RFXtrx433 - Aeon Z-Stick gen5 - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - Xiaomi Gateway - Sonos - IP cameras - Wall mounted tablet + Imperihome - MANY switches/sensors

vamp
Posts: 6
Joined: Saturday 06 October 2018 13:20
Target OS: Linux
Domoticz version:
Contact:

Re: Python plugin: Presence detection from wireless router

Post by vamp » Friday 12 October 2018 12:53

Hello there,

i would like to use this plugin to Vyos Router.

it show arp table to "show arp" command

If i try to add it to pre configured command i get this:

2018-10-12 12:51:05.898 Error: (teszt) Unsupported command (pre)configured for 192.168.31.1: show
2018-10-12 12:52:47.549 Error: (teszt) Failed 3 times to get capabilities for 192.168.31.1. Retry interval automatically reduced for this router

How to use your plugin it this router?

mikeoo
Posts: 153
Joined: Sunday 22 March 2015 8:35
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Holland
Contact:

Re: Python plugin: Presence detection from wireless router

Post by mikeoo » Friday 12 October 2018 15:01

vamp wrote:
Friday 12 October 2018 12:53
Hello there,

i would like to use this plugin to Vyos Router.

it show arp table to "show arp" command

If i try to add it to pre configured command i get this:

2018-10-12 12:51:05.898 Error: (teszt) Unsupported command (pre)configured for 192.168.31.1: show
2018-10-12 12:52:47.549 Error: (teszt) Failed 3 times to get capabilities for 192.168.31.1. Retry interval automatically reduced for this router

How to use your plugin it this router?
It is better when you give the info you use in the plug-in.
Is SSH working to your router?

Try to use it like
Wifi router IP Address: <ip router>:<port number>=arp

Different SSH port
example: 192.168.31.1:8325=arp

Default SSH port
example: 192.168.31.1=arp

You only need to add the port number when you use a different port number for SSH to the router.

When it is not working make a screenshot of the plugin settings en mask the username and password ;)

vamp
Posts: 6
Joined: Saturday 06 October 2018 13:20
Target OS: Linux
Domoticz version:
Contact:

Re: Python plugin: Presence detection from wireless router

Post by vamp » Friday 12 October 2018 15:19

I found a other way :)

My Vyos VM run in a host (proxmox, Debian based) so i SSH to Proxmox and check brtcl. It working, but need some changes in python script.

I replace this line

from:

Code: Select all

 generic['brctl']=";brctl showmacs br0 | grep '..:..:..:..:..:..' | awk '{print $ 2}'"
to:

Code: Select all

generic['brctl']=";brctl showmacs vmbr0 | grep '..:..:..:..:..:..' | awk '{print $ 2}'"
It need, because Proxmox rename the normal bridge interface.

vmbr0 is the "LAN" virtual switch on Proxmox.

AurelioF
Posts: 9
Joined: Wednesday 03 October 2018 18:01
Target OS: Raspberry Pi
Domoticz version:
Location: Spain
Contact:

Re: Python plugin: Presence detection from wireless router

Post by AurelioF » Monday 15 October 2018 10:26

mikeoo wrote:
Friday 12 October 2018 7:20
AurelioF wrote:
Thursday 11 October 2018 15:10
I confirm that it works with Unifi AP Pro :D
Thanks for sharing
Do you use ARP with the Unifi. I use also Unifi and interesting how you use it.
My installation has two unifi devices, with a single ssid but two IP addresses.
the plugin is working on raspberry. I'm only using this plugin, I do not perform other ARP queries.
I have to say that sometimes I experience repeated reconnections on an iphone for no apparent reason, I am still investigating.

mikeoo
Posts: 153
Joined: Sunday 22 March 2015 8:35
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Holland
Contact:

Re: Python plugin: Presence detection from wireless router

Post by mikeoo » Monday 15 October 2018 10:38

AurelioF wrote:
Monday 15 October 2018 10:26
mikeoo wrote:
Friday 12 October 2018 7:20
AurelioF wrote:
Thursday 11 October 2018 15:10
I confirm that it works with Unifi AP Pro :D
Thanks for sharing
Do you use ARP with the Unifi. I use also Unifi and interesting how you use it.
My installation has two unifi devices, with a single ssid but two IP addresses.
the plugin is working on raspberry. I'm only using this plugin, I do not perform other ARP queries.
I have to say that sometimes I experience repeated reconnections on an iphone for no apparent reason, I am still investigating.
I have an Edgerouter X and 3 Unifi AP but i can only use the Edgerouter for scanning the ip and app. Can you scan the AP directly for an ip ?

For 95% the plugin is working great. But sometimes a phone (android) is not at home but system still think it is, even after a few hours.
Reconnection i have also sometimes. Some day it is working great an then suddenly it disconnects for a few minutes and the comes back again.

Would Be nice if there was a better option then ARP with Unifi so we could kill this sort of problems.

AurelioF
Posts: 9
Joined: Wednesday 03 October 2018 18:01
Target OS: Raspberry Pi
Domoticz version:
Location: Spain
Contact:

Re: Python plugin: Presence detection from wireless router

Post by AurelioF » Monday 15 October 2018 12:16

mikeoo wrote:
Monday 15 October 2018 10:38
AurelioF wrote:
Monday 15 October 2018 10:26
mikeoo wrote:
Friday 12 October 2018 7:20


Do you use ARP with the Unifi. I use also Unifi and interesting how you use it.
My installation has two unifi devices, with a single ssid but two IP addresses.
the plugin is working on raspberry. I'm only using this plugin, I do not perform other ARP queries.
I have to say that sometimes I experience repeated reconnections on an iphone for no apparent reason, I am still investigating.
I have an Edgerouter X and 3 Unifi AP but i can only use the Edgerouter for scanning the ip and app. Can you scan the AP directly for an ip ?

For 95% the plugin is working great. But sometimes a phone (android) is not at home but system still think it is, even after a few hours.
Reconnection i have also sometimes. Some day it is working great an then suddenly it disconnects for a few minutes and the comes back again.

Would Be nice if there was a better option then ARP with Unifi so we could kill this sort of problems.
I access the unifi by IP and ssh using the plugin, I guess your unifi team must allow access by ssh, my unifi is "unifi ap pro"

mikeoo
Posts: 153
Joined: Sunday 22 March 2015 8:35
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Holland
Contact:

Re: Python plugin: Presence detection from wireless router

Post by mikeoo » Monday 15 October 2018 12:45

AurelioF wrote:
Monday 15 October 2018 12:16
mikeoo wrote:
Monday 15 October 2018 10:38
AurelioF wrote:
Monday 15 October 2018 10:26


My installation has two unifi devices, with a single ssid but two IP addresses.
the plugin is working on raspberry. I'm only using this plugin, I do not perform other ARP queries.
I have to say that sometimes I experience repeated reconnections on an iphone for no apparent reason, I am still investigating.
I have an Edgerouter X and 3 Unifi AP but i can only use the Edgerouter for scanning the ip and app. Can you scan the AP directly for an ip ?

For 95% the plugin is working great. But sometimes a phone (android) is not at home but system still think it is, even after a few hours.
Reconnection i have also sometimes. Some day it is working great an then suddenly it disconnects for a few minutes and the comes back again.

Would Be nice if there was a better option then ARP with Unifi so we could kill this sort of problems.
I access the unifi by IP and ssh using the plugin, I guess your unifi team must allow access by ssh, my unifi is "unifi ap pro"
I have one UniFi AP-AC-LR and two UniFi AP-AC-Lite but as fas as i know iu can only be managed with Unify Controller or with the Android App but nut directly. I can SSH to the Edgerouter with putty but i need to sort out how to create SSH key for it. That part i have no experience in so but difficult for the moment. And don't know if that part gowning to work and if it fix the problem.

So if you one a share some info for how you did it :mrgreen: But maby the Pro works different.

AurelioF
Posts: 9
Joined: Wednesday 03 October 2018 18:01
Target OS: Raspberry Pi
Domoticz version:
Location: Spain
Contact:

Re: Python plugin: Presence detection from wireless router

Post by AurelioF » Monday 15 October 2018 13:18

mikeoo wrote:
Monday 15 October 2018 12:45
AurelioF wrote:
Monday 15 October 2018 12:16
mikeoo wrote:
Monday 15 October 2018 10:38


I have an Edgerouter X and 3 Unifi AP but i can only use the Edgerouter for scanning the ip and app. Can you scan the AP directly for an ip ?

For 95% the plugin is working great. But sometimes a phone (android) is not at home but system still think it is, even after a few hours.
Reconnection i have also sometimes. Some day it is working great an then suddenly it disconnects for a few minutes and the comes back again.

Would Be nice if there was a better option then ARP with Unifi so we could kill this sort of problems.
I access the unifi by IP and ssh using the plugin, I guess your unifi team must allow access by ssh, my unifi is "unifi ap pro"
I have one UniFi AP-AC-LR and two UniFi AP-AC-Lite but as fas as i know iu can only be managed with Unify Controller or with the Android App but nut directly. I can SSH to the Edgerouter with putty but i need to sort out how to create SSH key for it. That part i have no experience in so but difficult for the moment. And don't know if that part gowning to work and if it fix the problem.

So if you one a share some info for how you did it :mrgreen: But maby the Pro works different.
unifi ap pro has native SSH access, it is only necessary to configure user and password, it seems that unifi AP-AC-Lite and AP-AC-LR do not have ssh access, I did not know this difference, this can be a problem for your solution.
I do not know how to manage Edgerouter, if possible create a plain text key in your Edgerouter, using certificates is safer, but it is much more difficult.

if you can use a plain text password, make sure you have installed sshpass (sudo apt-get install sshpass). in Domoticz

mikeoo
Posts: 153
Joined: Sunday 22 March 2015 8:35
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Holland
Contact:

Re: Python plugin: Presence detection from wireless router

Post by mikeoo » Monday 15 October 2018 14:27

AurelioF wrote:
Monday 15 October 2018 13:18
mikeoo wrote:
Monday 15 October 2018 12:45
AurelioF wrote:
Monday 15 October 2018 12:16


I access the unifi by IP and ssh using the plugin, I guess your unifi team must allow access by ssh, my unifi is "unifi ap pro"
I have one UniFi AP-AC-LR and two UniFi AP-AC-Lite but as fas as i know iu can only be managed with Unify Controller or with the Android App but nut directly. I can SSH to the Edgerouter with putty but i need to sort out how to create SSH key for it. That part i have no experience in so but difficult for the moment. And don't know if that part gowning to work and if it fix the problem.

So if you one a share some info for how you did it :mrgreen: But maby the Pro works different.
unifi ap pro has native SSH access, it is only necessary to configure user and password, it seems that unifi AP-AC-Lite and AP-AC-LR do not have ssh access, I did not know this difference, this can be a problem for your solution.
I do not know how to manage Edgerouter, if possible create a plain text key in your Edgerouter, using certificates is safer, but it is much more difficult.

if you can use a plain text password, make sure you have installed sshpass (sudo apt-get install sshpass). in Domoticz
tnx that is different indeed. For now i am working with just the password and sshpass indeed and that is working but with sometimes a problem. But wil search for hopefully other option witch works better in the future.

jackjhon
Posts: 2
Joined: Tuesday 16 October 2018 12:56
Target OS: Linux
Domoticz version:
Contact:

Re: Python plugin: Presence detection from wireless router

Post by jackjhon » Tuesday 16 October 2018 13:03

How do we use asp plugin to Optus router?
Optus Technical Support Number

jackjhon
Posts: 2
Joined: Tuesday 16 October 2018 12:56
Target OS: Linux
Domoticz version:
Contact:

Re: Python plugin: Presence detection from wireless router

Post by jackjhon » Tuesday 16 October 2018 13:37

how do we use asp plugging to my republic broadband?
Myrepublic internet support

EscApe
Posts: 210
Joined: Thursday 02 April 2015 8:46
Target OS: Raspberry Pi
Domoticz version: v3+beta
Location: The Netherlands
Contact:

Re: Python plugin: Presence detection from wireless router

Post by EscApe » Tuesday 16 October 2018 17:22

@jackjhon

Ik you can supply a router make and model, then maybe someone can help you.
In general: if the router supports ssh just follow the instructions on GitHub. If it doesn't the plugin will not work with your router.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 2 guests