Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too many requests #53

Open
TonyFeestneus opened this issue Oct 23, 2016 · 12 comments
Open

Too many requests #53

TonyFeestneus opened this issue Oct 23, 2016 · 12 comments

Comments

@TonyFeestneus
Copy link

I am running this on a Raspberry Pi 2, clean install combined with Nginx and some simple php files.

I have 1 switch with brightness, when you scroll through the brightness an unbelievable amount of requests is generated. I have a PHP file set up to write the brightness to a .txt file (since MySQL couldn't keep up), but even this can't cope.
I am just reading the .txt file with tail -f, but it stops working FAST...

Do you have these issues too?

@NovaGL
Copy link
Collaborator

NovaGL commented Oct 24, 2016

Maybe you are running in debug mode or using realtime. Since I am not a great coder, realtime really just polls every second and then updates status if changed. I use PHP and have no problems with mine. Why do you need to write to a txt file I just poll the php direct.

@TonyFeestneus
Copy link
Author

I just poll the php direct as well, but need something to remember the current value to give back to the brightness setting.
It is far more than every second when you scroll through the brightness, more like 100x per second which chokes up the Pi...

sidebar: what do you actuate with your php file and how do you get status?

@NovaGL
Copy link
Collaborator

NovaGL commented Oct 25, 2016

Why do you need to remember the brightness value if you are just going to poll it again. Maybe don't use realtime polling, that's really just for motion sensors.

I use mine to poll things like sonos volume and if tv is on or off. I used to use it for motion sensors but dont have any at my current place.

@TonyFeestneus
Copy link
Author

I have devices which I can control in multiple ways, not only through homekit. Also, the status is not pollable in the device itself, so I must save it somewhere else...

@TonyFeestneus
Copy link
Author

So, I am using devices without saving status, which works, but dimmable devices need a brightness status or else Homekit will say they do not respond.
They do work though and I am able to set them at any brightness, but after that it just displays as On in stead of 45% for example...

Any fix for this? Can you make HomebridgeHTTP so that brightness does not need status?

@NovaGL
Copy link
Collaborator

NovaGL commented Oct 29, 2016

Not possible, it's a homekit thing not a homebridge thing. I also can't make changes that might break other people's installations. What lights do you have that won't tell you their brightness?

@TonyFeestneus
Copy link
Author

Zwave... I'm struggling with polling them through open zwave.

But also 433mhz can't tell you the brightness... I have some Hue which do of course.

@NovaGL
Copy link
Collaborator

NovaGL commented Oct 29, 2016

There might be a zwave plugin that might be more appropriate. Unfortunatly we don't have much say in the feedback Siri provides. Sometimes even when everything is correct and the action is performed Siri still says can't contact device.

You can make custom characteristics but then Siri won't work at all if you say set brightness

@fredylg
Copy link

fredylg commented Jul 1, 2017

I have a similar issue, my setup is ios-->raspberry--> sonoff (running tasmota firmare) but the amount of request to check the status of the device gets it slow that the micro cant respont and goes of.. would be great to have a refreshing rate parameter on the config.json

@NovaGL
Copy link
Collaborator

NovaGL commented Jul 3, 2017

Have you tried not using realtime? Maybe someone who is a better programmer than be can work out the refresh rate for you.

@fredylg
Copy link

fredylg commented Jul 4, 2017

@NovaGL is there any other options possible to set besides real-time, I tried adding one-minute cache into my php api but for some reason the light goes off randomly...

@NovaGL
Copy link
Collaborator

NovaGL commented Jul 4, 2017

If realtime is off. It only polls when the app is opened.

Try changing line 59, interval and see if that resolves anything

}, { longpolling: true, interval: 300, longpollEventName: "statuspoll" });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants