Python plugin: Presence detection from wireless router

Python and python framework

Moderator: leecollings

Kubra
Posts: 22
Joined: Wednesday 01 April 2015 22:06
Target OS: NAS (Synology & others)
Domoticz version: latest
Location: Hollanda
Contact:

Re: Python plugin: Presence detection from wireless router

Post by Kubra »

EscApe wrote: Wednesday 17 April 2024 21:23 Any maintancance (update) jobs on the Fritzbox at 22:00? Maybe some timed blocking rules?
Hi EscApe,
Thanks for the reply. I had been looking for tasks/blocking rules running around that time (it's GMT btw) but couldn't find any. However I now disabled "AVM Services" > "Searching for updates" and "Sending Diagnostic data" (can't even remember when I switched that on). Let's see how that works out.
hjzwiers
Posts: 163
Joined: Friday 12 January 2018 8:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Presence detection from wireless router

Post by hjzwiers »

Is there any planning for the beta to be released?
EscApe
Posts: 528
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

Post by EscApe »

hjzwiers wrote: Thursday 20 June 2024 10:15 Is there any planning for the beta to be released?
I have been testing it for a while because it looked like something was causing a memory leak. However, on my setup the Domoticz memory usage indeed rises the first few days but then stabilizes. I don't know if there is any relation with the plugin itself, the plugin framework, domoticz or anything else. Could just have been a coincidence.
Any other results out there?

The release or beta status is a bit arbitrary in this case. It is not like the beta will be unsupported in a production environment..... there is no guaranteed supported for either of them and we are not running domoticz to control nuclear power plants ;)

I can make it the new 'master' if no-one objects. It is a breaking change for existing setups, since you will have te recreate the devices.

Will look into making it the master this weekend.
rensbr
Posts: 61
Joined: Friday 27 July 2018 19:01
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Presence detection from wireless router

Post by rensbr »

EscApe wrote: Friday 21 June 2024 6:54
hjzwiers wrote: Thursday 20 June 2024 10:15 Is there any planning for the beta to be released?
we are not running domoticz to control nuclear power plants ;)
My wife and kids think otherwise, when it does not work, it's 'rubbish' and they don't want to have it in their house. So like a nuclair plant, it has to work all the time, or we get a meltdown. :lol:
EscApe
Posts: 528
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

Post by EscApe »

rensbr wrote: Friday 21 June 2024 8:17
EscApe wrote: Friday 21 June 2024 6:54
hjzwiers wrote: Thursday 20 June 2024 10:15 Is there any planning for the beta to be released?
we are not running domoticz to control nuclear power plants ;)
My wife and kids think otherwise, when it does not work, it's 'rubbish' and they don't want to have it in their house. So like a nuclair plant, it has to work all the time, or we get a meltdown. :lol:
:lol: I think you are onto something … this might even be much more dangerous
hjzwiers
Posts: 163
Joined: Friday 12 January 2018 8:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Presence detection from wireless router

Post by hjzwiers »

I changed my router to Asus XT8. I'm still running into issues using type=aimesh_json.

It used to be fool-proof, not so much anymore. Thats why I was wondering about the Beta
EscApe
Posts: 528
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

Post by EscApe »

hjzwiers wrote: Monday 01 July 2024 15:29 I changed my router to Asus XT8. I'm still running into issues using type=aimesh_json.

It used to be fool-proof, not so much anymore. Thats why I was wondering about the Beta
The beta uses the newer DomoticzEx framework to manage the Domoticz devices. There have also been some structural changes, but the polling methods haven't changed. I have tried to move to another ssh client, but in the end reverted to back to paramiko, because the other client introduced other problems.
So, if you have trouble getting data from you router you will probably still have it using the 'beta' version.

I was unable to diagnose your problem earlier, based on the issues you were experiencing and the logging you provided. You can of course try the beta to see if it makes a difference, but I'm afraid I cannot offer any more help on your peculiar case. It was and probably is too contradictory and complicated for me to diagnose remotely.
hjzwiers
Posts: 163
Joined: Friday 12 January 2018 8:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Presence detection from wireless router

Post by hjzwiers »

What are the optimal settings for my router? The Asus xt8
hjzwiers
Posts: 163
Joined: Friday 12 January 2018 8:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Presence detection from wireless router

Post by hjzwiers »

Error: IDetect: Call to function 'onStart' failed, exception details:
2024-07-02 15:30:30.966 Error: IDetect: Traceback (most recent call last):
2024-07-02 15:30:30.966 Error: IDetect: File "/home/hjz/domoticz/plugins/iDetect/plugin.py", line 431, in onStart
2024-07-02 15:30:30.966 Error: IDetect: _plugin.onStart()
2024-07-02 15:30:30.966 Error: IDetect: File "/home/hjz/domoticz/plugins/iDetect/plugin.py", line 262, in onStart
2024-07-02 15:30:30.966 Error: IDetect: if get_domoticz_status(self.OVERRIDE_UNIT):
2024-07-02 15:30:30.966 Error: IDetect: File "/home/hjz/domoticz/plugins/iDetect/plugin.py", line 181, in get_domoticz_status
2024-07-02 15:30:30.966 Error: IDetect: if Devices[unit].nValue == True:
2024-07-02 15:30:30.966 Error: IDetect: KeyError: 255

This is the result from a fresh re-install using 192.168.2.1#type=aimesh_json as the call to start iDetect

Update: deleted everything in the iDetect folder, reinstalled the Beta without the logging on in the iDetect sheet, all ok again with 192.168.2.1#type=aimesh_json I don't get it ........ This is how the install must go, but why then the installs with the errors?
EscApe
Posts: 528
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

Post by EscApe »

hjzwiers wrote: Tuesday 02 July 2024 15:53 Update: deleted everything in the iDetect folder, reinstalled the Beta without the logging on in the iDetect sheet, all ok again with 192.168.2.1#type=aimesh_json I don't get it ........ This is how the install must go, but why then the installs with the errors?
If you switch back and forth between the master and beta branch then you MUST delete all devices that te plugin has created, including the override switch and anyone home. The DomticzEx framework used by the beta addresses the devices differently, so if you do not delete them there will be a mismatch when you change versions. After deleting the devices you can restart and the devices will be (re)created the richt way.
hjzwiers
Posts: 163
Joined: Friday 12 January 2018 8:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Presence detection from wireless router

Post by hjzwiers »

Thanks, I didn't do that.

I deleted all devices iDetect installs, restarted, installed the Beta, restarted and all was installed again. I wonder how it goes!
hjzwiers
Posts: 163
Joined: Friday 12 January 2018 8:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Presence detection from wireless router

Post by hjzwiers »

I did a clean install with the beta version of iDetect.

I runs fine over several days, then all of a sudden

Error: IDetect: 192.168.2.1 ====> SSH failed with exception:
IDetect: 192.168.2.1 ====> SSH Could not connect (using password). Exception: Error reading SSH protocol bannertimed out

From the router I get a message that the password connection is succes

I can reset the router and restart Domoticz:

iDetect: 192.168.2.1 ====> SSH Could not connect (using password). Exception: Error reading SSH protocol bannertimed out

I can log into the router with: sudo ssh [email protected]

I added the password to the tracker: 192.168.2.1#type=aimesh_json&user=HJZ&password=xxxxxxxx same result

Then if I delete the iDetect directory and reinstall the tracker, it works for a few days ....
EscApe
Posts: 528
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

Post by EscApe »

I already spent many hours trying to reproduce your issues back in januari. Unfortunately I could not, so I am unable to offer any new insights. Maybe someone with a comparable setup can help?

Btw: i would not consider replacing the plugin directory a “clean install”. The files in the plug-in directory do not change while using it. All status and configuration data is in the Domoticz database. If you want to try a really clean setup you could instal Linux on an empty drive with a fresh Domoticz install without the old database. Nothing from backups or existing configurations. I don’t mean you should immediately reinstall your entire setup, but this would be the correct way to create a suitable test machine.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest