Python plugin: Presence detection from wireless router
Moderator: leecollings
-
- Posts: 2
- Joined: Monday 17 December 2018 13:38
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python plugin: Presence detection from wireless router
@ EscApe, thanks for this plugin. I have implement it to my configuration.
Cool.
Kind regards
Cool.
Kind regards
-
- Posts: 535
- Joined: Thursday 02 April 2015 8:46
- Target OS: Linux
- Domoticz version: 2020+
- Location: The Netherlands
- Contact:
Re: Python plugin: Presence detection from wireless router
Looks like plug-in is not connecting. Are you sure you tried it from the command line with the same user profile that is running Domoticz? (Root by default).
The starting part of the log is missing. It might include some extra info,
Are you running Domoticz on linux?
The starting part of the log is missing. It might include some extra info,
Are you running Domoticz on linux?
-
- Posts: 2
- Joined: Sunday 16 December 2018 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: v4.10278
- Contact:
Re: Python plugin: Presence detection from wireless router
That was it! I had created keys for the "pi" user, while the Domoticz daemon is running as root. So it was a connection issue all along.EscApe wrote: ↑Monday 17 December 2018 20:12 Looks like plug-in is not connecting. Are you sure you tried it from the command line with the same user profile that is running Domoticz? (Root by default).
The starting part of the log is missing. It might include some extra info,
Are you running Domoticz on linux?
Now it's working as a charm, thanks for your help and for this awesome plugin!
/Tomas
-
- Posts: 30
- Joined: Wednesday 09 January 2019 17:10
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.1
- Location: Nederland
- Contact:
Re: Python plugin: Presence detection from wireless router
Can someone acknowledge that iDetect is working with Ubiquiti AmpliFi AFi-HD Multiroom wifi. If not I have to make other choices 
Thanks
=====
Frans

Thanks
=====
Frans
-
- Posts: 535
- Joined: Thursday 02 April 2015 8:46
- Target OS: Linux
- Domoticz version: 2020+
- Location: The Netherlands
- Contact:
Re: Python plugin: Presence detection from wireless router
@Franzie,
Seems like no one folowing this thread can confirm. Did you try it yourself? As long as the amplifi supports ssh access it might just work or you could search for a amplifi specific command I can add to the plugin.
Seems like no one folowing this thread can confirm. Did you try it yourself? As long as the amplifi supports ssh access it might just work or you could search for a amplifi specific command I can add to the plugin.
-
- Posts: 22
- Joined: Sunday 06 December 2015 21:15
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python plugin: Presence detection from wireless router
Hi, I have a unifi network. USG, UniFi AP-AC-LR and UniFi AP-AC-Lite.
I followed mikeoo tutorial, but it still wouldn't work with my USG. and it will not discover my device
then i added the =unifiusg-arp and get these errors. any ideas? im not sure what i would achieve off the USG tbh, i don't know if i would be able to detect when wired devices are detected?
on a plus note i did notice that if i put the ip addresses of both my access points into the router section (with out =unifi bit) that the system seemed to work.
many thanks
I followed mikeoo tutorial, but it still wouldn't work with my USG. and it will not discover my device
then i added the =unifiusg-arp and get these errors. any ideas? im not sure what i would achieve off the USG tbh, i don't know if i would be able to detect when wired devices are detected?
on a plus note i did notice that if i put the ip addresses of both my access points into the router section (with out =unifi bit) that the system seemed to work.
many thanks
-
- Posts: 535
- Joined: Thursday 02 April 2015 8:46
- Target OS: Linux
- Domoticz version: 2020+
- Location: The Netherlands
- Contact:
Re: Python plugin: Presence detection from wireless router
Looks like you are using ssh key based login, but it does not appear to be working. Please make sure key based ssh login is possible from the command line under the same user account that is running Domoticz. Even if it is configured for the correct user (root?) trying key based login from the command line will probably return some more info about the login proces (like key mismatches).
-
- Posts: 374
- Joined: Friday 23 May 2014 7:55
- Target OS: Linux
- Domoticz version: 2022.1
- Location: Saint Pierre de Jards
- Contact:
Re: Python plugin: Presence detection from wireless router
Hi
I'm trying to get the plugin working on a RaspPI Jessie with Python 3.4.2 installed (unifi AP's). Domoticz version is V3.9139
As we can see in the log file SSH with public key to all AP's is working. However the plugin reports some errors. How can I get it working?
Is it a matter og Python version? Something else?
Thank you
EDIT : plugin has been installed under root. Plugin has execution rights
I'm trying to get the plugin working on a RaspPI Jessie with Python 3.4.2 installed (unifi AP's). Domoticz version is V3.9139
As we can see in the log file SSH with public key to all AP's is working. However the plugin reports some errors. How can I get it working?
Is it a matter og Python version? Something else?
Thank you
EDIT : plugin has been installed under root. Plugin has execution rights
- Spoiler: show
Debian buster on NUC and three RPi with buster.
-
- Posts: 535
- Joined: Thursday 02 April 2015 8:46
- Target OS: Linux
- Domoticz version: 2020+
- Location: The Netherlands
- Contact:
Re: Python plugin: Presence detection from wireless router
@number8,
It looks like the Domoticz.Status (logging) method was not available in your version of Domoticz. It should work if you update, but if you want to stay with that Domoticz version there might also be a solution: replace every ‘Domoticz.Status’ with ‘Domoticz.Log’ in plugin.
It looks like the Domoticz.Status (logging) method was not available in your version of Domoticz. It should work if you update, but if you want to stay with that Domoticz version there might also be a solution: replace every ‘Domoticz.Status’ with ‘Domoticz.Log’ in plugin.
-
- Posts: 374
- Joined: Friday 23 May 2014 7:55
- Target OS: Linux
- Domoticz version: 2022.1
- Location: Saint Pierre de Jards
- Contact:
Re: Python plugin: Presence detection from wireless router
Thanks EscApe.
You have guessed well. I don't want to update now, rather complex setup, I'll wait spring time when there is no needed for heating.
I tried what you suggested. Unfortunately I get new errors
You have guessed well. I don't want to update now, rather complex setup, I'll wait spring time when there is no needed for heating.
I tried what you suggested. Unfortunately I get new errors
2019-02-24 20:41:17.567 Error: (idetect) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/Domoticz_iDetect/:/usr/lib/python3.4/:/usr/lib/python3.4/plat-arm-linux-gnueabihf:/usr/lib/python3.4/lib-dynload'.
2019-02-24 20:41:17.567 Error: (SalleàManger) Module Import failed, exception: 'SyntaxError'
2019-02-24 20:41:17.567 Error: (SalleàManger) Import detail: File: /home/pi/domoticz/plugins/Domoticz_iDetect/plugin.py, Line: 213, offset: 13
2019-02-24 20:41:17.567 Error: (SalleàManger) Error Line ' sendir,1:3,1("Using preconfigured custom command on router " + host + ": " + pollscript)
Debian buster on NUC and three RPi with buster.
-
- Posts: 535
- Joined: Thursday 02 April 2015 8:46
- Target OS: Linux
- Domoticz version: 2020+
- Location: The Netherlands
- Contact:
Re: Python plugin: Presence detection from wireless router
@Number8
Strange that you now get a syntax error. Maybe you accidentally changed more than just the Domoticz.Status to Domoticz.Log?
I have created a new brach on GitHub called 'For-older-Domoticz-(not-maintained)'. This version does not use the Domoticz.Status method. If you take the plugin.py from that branch it should work.
Strange that you now get a syntax error. Maybe you accidentally changed more than just the Domoticz.Status to Domoticz.Log?
I have created a new brach on GitHub called 'For-older-Domoticz-(not-maintained)'. This version does not use the Domoticz.Status method. If you take the plugin.py from that branch it should work.
-
- Posts: 374
- Joined: Friday 23 May 2014 7:55
- Target OS: Linux
- Domoticz version: 2022.1
- Location: Saint Pierre de Jards
- Contact:
Re: Python plugin: Presence detection from wireless router
Tripled checked. Unfortunately no error on my side
Thanks lot for that, I'll check this week-end and keep you postedI have created a new brach on GitHub called 'For-older-Domoticz-(not-maintained)'. This version does not use the Domoticz.Status method. If you take the plugin.py from that branch it should work.
Nicolas
Debian buster on NUC and three RPi with buster.
-
- Posts: 374
- Joined: Friday 23 May 2014 7:55
- Target OS: Linux
- Domoticz version: 2022.1
- Location: Saint Pierre de Jards
- Contact:
Re: Python plugin: Presence detection from wireless router
Brilliant, it works like a charm now. Thanks a lot for your support.EscApe wrote: ↑Wednesday 27 February 2019 7:55 @Number8
Strange that you now get a syntax error. Maybe you accidentally changed more than just the Domoticz.Status to Domoticz.Log?
I have created a new branch on GitHub called 'For-older-Domoticz-(not-maintained)'. This version does not use the Domoticz.Status method. If you take the plugin.py from that branch it should work.
Debian buster on NUC and three RPi with buster.
-
- Posts: 374
- Joined: Friday 23 May 2014 7:55
- Target OS: Linux
- Domoticz version: 2022.1
- Location: Saint Pierre de Jards
- Contact:
Re: Python plugin: Presence detection from wireless router
@EscApe I have 3 Unifi AP's and likely more to come, so I ended up up with 3 Anyone buttons. Would be great I guess to have one master Anyone button. Is this something that could considered?
Debian buster on NUC and three RPi with buster.
-
- Posts: 535
- Joined: Thursday 02 April 2015 8:46
- Target OS: Linux
- Domoticz version: 2020+
- Location: The Netherlands
- Contact:
Re: Python plugin: Presence detection from wireless router
<something went wrong with this post... please ignore it>
Last edited by EscApe on Sunday 03 March 2019 8:39, edited 1 time in total.
-
- Posts: 535
- Joined: Thursday 02 April 2015 8:46
- Target OS: Linux
- Domoticz version: 2020+
- Location: The Netherlands
- Contact:
Re: Python plugin: Presence detection from wireless router
@Number8,
There already are a few options:
1. Configure the plugin once, with 3 routers (separated with comma) instead of adding the plugin 3 times. (described on configuration page)
2. Use the override button in the 'master' plugin. It's a bit tricky: set the override mode for the master to 'Override indefinately' and use a (Lua) script to turn the Override switch on that master on/off based on the Anyone switch of the other AP's.
3. Use te plugin on only one of the AP's en force it to use ARP instead of (the preferred!) chipset based detection approach. (described on GitHub page)
4. If you happen to find a (proprietary Unifi) command on the AP's that returns all connected Mac addresses on all AP's in a network/mesh from one command on one AP then I can add it to the plugin (has to be something quicker and more reliable than ARP).
I would go with option 1
There already are a few options:
1. Configure the plugin once, with 3 routers (separated with comma) instead of adding the plugin 3 times. (described on configuration page)
2. Use the override button in the 'master' plugin. It's a bit tricky: set the override mode for the master to 'Override indefinately' and use a (Lua) script to turn the Override switch on that master on/off based on the Anyone switch of the other AP's.
3. Use te plugin on only one of the AP's en force it to use ARP instead of (the preferred!) chipset based detection approach. (described on GitHub page)
4. If you happen to find a (proprietary Unifi) command on the AP's that returns all connected Mac addresses on all AP's in a network/mesh from one command on one AP then I can add it to the plugin (has to be something quicker and more reliable than ARP).
I would go with option 1

-
- Posts: 110
- Joined: Sunday 22 March 2015 7:35
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Holland
- Contact:
Re: Python plugin: Presence detection from wireless router
I also use 3 Unify AP and have only one Anyhome button.
In Hardware page of Domoticz i use al 3 ip-adresses for Wifi Router Ip-adres like: 192.168.0.201,192.168.0.202,192.168.0.203
Now it scans al 3 AP without any problems.
Setup: https://www.domoticz.com/forum/viewtopi ... 20#p197905
- Varazir
- Posts: 377
- Joined: Friday 20 February 2015 22:23
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Contact:
Re: Python plugin: Presence detection from wireless router
I guess this has been asked before but please let us change the port to use.
Raspberry PI 2 with RaZberry Controller 2016 ZWave+ and CC2531(zigbee)
Several IKEA devices/z-wave devices
Several IKEA devices/z-wave devices
- Varazir
- Posts: 377
- Joined: Friday 20 February 2015 22:23
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Contact:
Re: Python plugin: Presence detection from wireless router
I have a pfSense router and trying to use this plugin.
I get this:
pfSense based on FreeBSD
I checked the plugin file and found it's using this command
Ran it manually and I got a list of MAC addresses.
I get this:
Code: Select all
2019-03-03 11:05:54.012 (iDetect) Could not construct router query command for <IP>
2019-03-03 11:05:54.013 (iDetect) Router initialized as:{'<IP>': {'initialized': False, 'cmd': '', 'port': <port>, 'prospone': datetime.datetime(2019, 3, 3, 11, 6, 6, 12931), 'user': 'domoticz', 'errorcount': 1}}
I checked the plugin file and found it's using this command
Code: Select all
arp -a | grep '..:..:..:..:..:..' | awk '{print $ 4}'
Last edited by Varazir on Sunday 03 March 2019 11:19, edited 2 times in total.
Raspberry PI 2 with RaZberry Controller 2016 ZWave+ and CC2531(zigbee)
Several IKEA devices/z-wave devices
Several IKEA devices/z-wave devices
Who is online
Users browsing this forum: No registered users and 1 guest