Is there a way to detect if client connected to domoticz web server ?
I need to run a script only when browser/user are connect to domoticz for saving api calls (my car, and lawn mower).
Run script when client connect
Moderators: leecollings, remb0
- waltervl
- Posts: 6001
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2025.1
- Location: NL
- Contact:
Re: Run script when client connect
What do you mean?
A user in your household is logging into Domoticz and only then a script should run querying the status of your car or lawn mower?
So far I am not aware of being able to see who is logged in.
There are some plugins or integrations to see if a device (eg smartphone) is connected to wifi to indicate the user is at home.
But perhaps find a better way to limit API calls to an external device? Are they so limited? Do you need the status to be so up to date that you need a high frequency device update?
A user in your household is logging into Domoticz and only then a script should run querying the status of your car or lawn mower?
So far I am not aware of being able to see who is logged in.
There are some plugins or integrations to see if a device (eg smartphone) is connected to wifi to indicate the user is at home.
But perhaps find a better way to limit API calls to an external device? Are they so limited? Do you need the status to be so up to date that you need a high frequency device update?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- Posts: 20
- Joined: Sunday 24 February 2019 10:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Run script when client connect
Yes exactly, a script running once logging in. The lawn mover api provider shut me down when my calls are to often and the dont provide any max number of calls in any documentation. When I connect to the car's API, all electronics wake up from sleep mode and drain the 12V battery if I do it too often. Let's say I don't use the car for a week and Domoticz keeps polling the API—then I have a problem.
I think it can be done with Nginx (by running a script on the side when forwarding the client), but I wonder if Domoticz has some workaround for that.
I think it can be done with Nginx (by running a script on the side when forwarding the client), but I wonder if Domoticz has some workaround for that.
- waltervl
- Posts: 6001
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2025.1
- Location: NL
- Contact:
Re: Run script when client connect
Are you talking about 1 default admin account (could be different persons in your family that use this) or do you use different user accounts to log on?
Perhaps better make a dummy push on device for status update for car and/or mower. So when you push on the button for status update it will trigger the script to update the status of mower or car.
What brand of car and mower do you have as this is the first time in hear of these kind of issues.
Perhaps better make a dummy push on device for status update for car and/or mower. So when you push on the button for status update it will trigger the script to update the status of mower or car.
What brand of car and mower do you have as this is the first time in hear of these kind of issues.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Who is online
Users browsing this forum: No registered users and 1 guest