Python plugin: Presence detection from wireless router
Moderator: leecollings
-
- 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
Great that you got it working!
The default (ssh autodetect) tracker queries the router on a pretty low (chipset) level so you need te query every node in your mesh separately or use another tracker type that queries the mesh on the master router. For Asus the "aimesh_json" tracker type should work (at least it did when I had a Asus mesh).
The PyO3 issue is/was a known problem. You can find some discussion about it on this forum. From memory: it was a change in an underlying Python module for cryptography that in combination with the way Domoticz was loading plugins was causing the problem. Cryptography is used by paramiko and other common modules like requests.
The Domticz/Python version combination had been troublesome before, so I moved Domoticz into a docker container. That way I have more control over the isolated Domoticz environment, without limiting other programs on the host.
Within the docker container I just install all required modules globally on a first run of customstart.sh.
At this moment I am running Domoticz 2025.1 (build 16490) with Python Version: 3.9.2 without any issues. Other combination might also work. I don't remember if it was fixes by changing the python version or Domoticz.
The default (ssh autodetect) tracker queries the router on a pretty low (chipset) level so you need te query every node in your mesh separately or use another tracker type that queries the mesh on the master router. For Asus the "aimesh_json" tracker type should work (at least it did when I had a Asus mesh).
The PyO3 issue is/was a known problem. You can find some discussion about it on this forum. From memory: it was a change in an underlying Python module for cryptography that in combination with the way Domoticz was loading plugins was causing the problem. Cryptography is used by paramiko and other common modules like requests.
The Domticz/Python version combination had been troublesome before, so I moved Domoticz into a docker container. That way I have more control over the isolated Domoticz environment, without limiting other programs on the host.
Within the docker container I just install all required modules globally on a first run of customstart.sh.
At this moment I am running Domoticz 2025.1 (build 16490) with Python Version: 3.9.2 without any issues. Other combination might also work. I don't remember if it was fixes by changing the python version or Domoticz.
- Siewert308SW
- Posts: 290
- Joined: Monday 29 December 2014 15:47
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: The Netherlands
- Contact:
Re: Python plugin: Presence detection from wireless router
Don't know if this plug is still supported.
But wanted to try this one and run into an issue.
As far as i can see the plugin runs and don't have any errors.
Setup:
Installed according your GitHub Readme.
The log says the plug is running and mention the following.
At the setup page at Trackers i filled in "192.168.178.100#type=fritzbox"
As for the tags part is filled in "Siewert_GSM=XX:XX:XX:XX:XX:XX"
Now for the username and pass word i filled in my FritzBox username and password.
The issue is when i enter a IP for my phone it is detected as ON or Offline
But when i fill in the MAC nothing happens.
Could it be i don't use the WiFi interface of the FritzBox as it's disabled due to using a TP-link Deco mesh network?
If you need more information about my setup please let me know.
thx
But wanted to try this one and run into an issue.
As far as i can see the plugin runs and don't have any errors.
Setup:
Code: Select all
Version: 2024.7
Build Hash: b317cfab1
Compile Date: 2024-07-13 16:59:31
Python Version: 3.11.2 (main, Nov 30 2024, 21:22:50) [GCC 12.2.0]
FritzBox 7590
The log says the plug is running and mention the following.
Code: Select all
2025-03-27 15:00:25.338 Status: iDetect: Started.
2025-03-27 15:00:25.433 Status: iDetect: Initialized version 2.4, author 'ESCape'
2025-03-27 15:00:25.756 Status: iDetect: Starting address:192.168.178.100, port:None, user:Me, keyfile:, class:fritzbox and poll interval:30
2025-03-27 15:00:31.065 Status: iDetect: Fritzbox has 3 WLAN services
As for the tags part is filled in "Siewert_GSM=XX:XX:XX:XX:XX:XX"
Now for the username and pass word i filled in my FritzBox username and password.
The issue is when i enter a IP for my phone it is detected as ON or Offline
But when i fill in the MAC nothing happens.
Could it be i don't use the WiFi interface of the FritzBox as it's disabled due to using a TP-link Deco mesh network?
If you need more information about my setup please let me know.
thx
Setup:
- RPi4 - Domo Stable / Aeotec Z-stick7 / PiHole Unbound Gemini
- RPi4 - PiHole / PiVPN Unbound Gemini
- Synology DS923+ / DS218j
- P1 Gas/Power, SmartGateway watermeter
- Fibaro switches, contacts, plugs, smoke/Co2 ect
- rootfs @ USB HDD
- RPi4 - Domo Stable / Aeotec Z-stick7 / PiHole Unbound Gemini
- RPi4 - PiHole / PiVPN Unbound Gemini
- Synology DS923+ / DS218j
- P1 Gas/Power, SmartGateway watermeter
- Fibaro switches, contacts, plugs, smoke/Co2 ect
- rootfs @ USB HDD
-
- 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
Indeed, the plugin won't be able to detect any wifi presence if you disabled wifi on the router. The ip-address works because it will use ping instead of wifi detection. The ping approach won't even use the router.
- Siewert308SW
- Posts: 290
- Joined: Monday 29 December 2014 15:47
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: The Netherlands
- Contact:
Re: Python plugin: Presence detection from wireless router
thx for the answer...
Setup:
- RPi4 - Domo Stable / Aeotec Z-stick7 / PiHole Unbound Gemini
- RPi4 - PiHole / PiVPN Unbound Gemini
- Synology DS923+ / DS218j
- P1 Gas/Power, SmartGateway watermeter
- Fibaro switches, contacts, plugs, smoke/Co2 ect
- rootfs @ USB HDD
- RPi4 - Domo Stable / Aeotec Z-stick7 / PiHole Unbound Gemini
- RPi4 - PiHole / PiVPN Unbound Gemini
- Synology DS923+ / DS218j
- P1 Gas/Power, SmartGateway watermeter
- Fibaro switches, contacts, plugs, smoke/Co2 ect
- rootfs @ USB HDD
-
- Posts: 215
- Joined: Friday 12 January 2018 8:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python plugin: Presence detection from wireless router
Hi! I've been forced to upgrade the system to bookworm and I have iDetect errors again.
I've doe a lot to system wide get rid of errors, most are done.
What I've done so far:
1. Got rid of all iDetect elements, in Devices, everywhere
2. Installed a freash version of iDetect, the beta version (should handel bookworm better): sudo git clone -b DomoticzEx-based-beta https://github.com/d-EScape/Domoticz_iDetect.git iDetect
3. Made a version of PYTHONPATH for the virtal handling of Python3
4. Ran Paramiko: sudo pip3 install requests paramiko
I'm getting a message that Paramiko isn't installed:Error: iDetect: Required modules for default tracker are not installed:No module named 'paramiko'
I don't know anymore lol, what is going wrong?
I've doe a lot to system wide get rid of errors, most are done.
What I've done so far:
1. Got rid of all iDetect elements, in Devices, everywhere
2. Installed a freash version of iDetect, the beta version (should handel bookworm better): sudo git clone -b DomoticzEx-based-beta https://github.com/d-EScape/Domoticz_iDetect.git iDetect
3. Made a version of PYTHONPATH for the virtal handling of Python3
4. Ran Paramiko: sudo pip3 install requests paramiko
I'm getting a message that Paramiko isn't installed:Error: iDetect: Required modules for default tracker are not installed:No module named 'paramiko'
I don't know anymore lol, what is going wrong?
-
- 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
As long as you are running the same version of the plugin there is no reason to remove any iDetect elements. That step is only needed if you switch between the (still) "beta" and the master version, because the beta uses the DomoitczEx framework and the older version uses the old plugin framework.
Just follow the error message. Paramiko is not installed in the environment that Domoticz is using.
Are you still running a docker container?
Do you have a python virtual environment (VENV)?
I don't know what this means: "Made a version of PYTHONPATH for the virtal handling of Python3". It should not be needed if your python environment is correctly setup.
Are you sure that sudo pip3 install requests paramiko was successful? By default the bookworm versions of pip will refuse to intstall modules this way and it will exit with a message saying so.
Just follow the error message. Paramiko is not installed in the environment that Domoticz is using.
Are you still running a docker container?
Do you have a python virtual environment (VENV)?
I don't know what this means: "Made a version of PYTHONPATH for the virtal handling of Python3". It should not be needed if your python environment is correctly setup.
Are you sure that sudo pip3 install requests paramiko was successful? By default the bookworm versions of pip will refuse to intstall modules this way and it will exit with a message saying so.
-
- Posts: 215
- Joined: Friday 12 January 2018 8:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python plugin: Presence detection from wireless router
It says:
hjz@debian:~/domoticz/plugins/iDetect$ sudo pip3 install requests paramiko
Requirement already satisfied: requests in /usr/local/lib/python3.10/site-packages (2.32.3)
Requirement already satisfied: paramiko in /usr/local/lib/python3.10/site-packages (3.5.1)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/site-packages (from requests) (3.4.2)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/site-packages (from requests) (3.10)
Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/site-packages (from requests) (2.4.0)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/site-packages (from requests) (2025.4.26)
Requirement already satisfied: bcrypt>=3.2 in /usr/local/lib/python3.10/site-packages (from paramiko) (4.3.0)
Requirement already satisfied: cryptography>=3.3 in /usr/local/lib/python3.10/site-packages (from paramiko) (44.0.3)
Requirement already satisfied: pynacl>=1.5 in /usr/local/lib/python3.10/site-packages (from paramiko) (1.5.0)
Requirement already satisfied: cffi>=1.12 in /usr/local/lib/python3.10/site-packages (from cryptography>=3.3->paramiko) (1.15.1)
Requirement already satisfied: pycparser in /usr/local/lib/python3.10/site-packages (from cffi>=1.12->cryptography>=3.3->paramiko) (2.22)
but this refers to python3.10, but i am running 3.11.2?
hjz@debian:~/domoticz/plugins/iDetect$ sudo pip3 install requests paramiko
Requirement already satisfied: requests in /usr/local/lib/python3.10/site-packages (2.32.3)
Requirement already satisfied: paramiko in /usr/local/lib/python3.10/site-packages (3.5.1)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/site-packages (from requests) (3.4.2)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/site-packages (from requests) (3.10)
Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/site-packages (from requests) (2.4.0)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/site-packages (from requests) (2025.4.26)
Requirement already satisfied: bcrypt>=3.2 in /usr/local/lib/python3.10/site-packages (from paramiko) (4.3.0)
Requirement already satisfied: cryptography>=3.3 in /usr/local/lib/python3.10/site-packages (from paramiko) (44.0.3)
Requirement already satisfied: pynacl>=1.5 in /usr/local/lib/python3.10/site-packages (from paramiko) (1.5.0)
Requirement already satisfied: cffi>=1.12 in /usr/local/lib/python3.10/site-packages (from cryptography>=3.3->paramiko) (1.15.1)
Requirement already satisfied: pycparser in /usr/local/lib/python3.10/site-packages (from cffi>=1.12->cryptography>=3.3->paramiko) (2.22)
but this refers to python3.10, but i am running 3.11.2?
-
- 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
Sorry, can’t really help you. Seems like your python environment is not properly setup.
I would start undoing whatever you tried to do with the python path, but repairing a broken python installation is not my area of expertise.
I would start undoing whatever you tried to do with the python path, but repairing a broken python installation is not my area of expertise.
-
- Posts: 22
- Joined: Wednesday 13 January 2016 16:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Contact:
Re: Python plugin: Presence detection from wireless router
Not sure how your setup looks like, but I had the same issue running on Rpi4 with Buster and Python 3.7.
I upgraded to Bookworm and created a venv called venv (you can create a venv with any name) and successfully installed iDetect in the venv. My Python version is 3.11. After I also used/upgraded to DomoticzEx-based-beta but this is not really relevant.
Check also what Python version Domoticz is using: In Domoticz - Setup - About Domoticz the python version should be shown.
iDetect install procedure:
Hope it helps...
I upgraded to Bookworm and created a venv called venv (you can create a venv with any name) and successfully installed iDetect in the venv. My Python version is 3.11. After I also used/upgraded to DomoticzEx-based-beta but this is not really relevant.
Check also what Python version Domoticz is using: In Domoticz - Setup - About Domoticz the python version should be shown.
iDetect install procedure:
Code: Select all
https://github.com/d-EScape/Domoticz_iDetect
source venv/bin/activate
pip install requests paramiko
cd /home/pi/domoticz/plugins
deactivate
Rpi4B,RFX433e,PiFace2, LCD, Hue bridge, Alexa (+TTS), HA-Bridge, Sonoff NSPanel, Sonoff RF (+IR) bridge, Nefit CV, Tasmota/MQTT, Enphase Solar, Smartmeter, Alarm I/F, H13726B Weather Station, CM180 Energy meter, Sonoff, KaKu, Tuya, Gledopto, AriLux,...
Who is online
Users browsing this forum: No registered users and 1 guest