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

VeSync Integration causing throttling #122620

Open
JeffSteinbok opened this issue Jul 25, 2024 · 38 comments
Open

VeSync Integration causing throttling #122620

JeffSteinbok opened this issue Jul 25, 2024 · 38 comments

Comments

@JeffSteinbok
Copy link

The problem

I think the VeSync integration is causing throttling by the VeSync servers.

When I call their endpoint from a browser on my home network, I get this: https://smartapi.vesync.com/

{
    "traceId": "1721940128566",
    "code": -11103086,
    "msg": "internal server busy error"
}

If I turn off polling in the VeSync integration, things seem to start working again. I get this response:

{
    "traceId": "1721940393496",
    "code": -11000086,
    "msg": "illegal argument",
    "module": null,
    "stacktrace": null,
    "result": null
}

If I access VeSync from Cell or a different VPN, it all works, indicating that it has to do with my source IP location.

I do have a LOT of devices (15 or so) which may mean I need to drop the polling interval and do it manually? Unsure. Either way, this just started happening a day ago or so.

What version of Home Assistant Core has the issue?

core-2024.7.3

What was the last working version of Home Assistant Core?

core-2024.7.2

What type of installation are you running?

Home Assistant OS

Integration causing the issue

VeSync

Link to integration documentation on our website

https://www.home-assistant.io/integrations/vesync/

Diagnostics information

home-assistant_vesync_2024-07-25T07-05-15.207Z.log

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

Hey there @markperdue, @webdjoe, @TheGardenMonkey, @cdnninja, mind taking a look at this issue as it has been labeled with an integration (vesync) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of vesync can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign vesync Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


vesync documentation
vesync source
(message by IssueLinks)

@ewelin34
Copy link

ewelin34 commented Aug 8, 2024

I too am having this issue. At least once a day I see the same connectivity issues. I currently have 3 air purifiers in VeSync. Each time my connection drops it lasts for at least 3 hours.

@matthewpapa07
Copy link

+1 Seeing this as well

@jmunchies1
Copy link

Also just experienced this for the first time today. I have 3 x Core 400S air purifiers that have worked fine in HA for a while now. I just upgraded HA from 2024.7.4 to 2024.8.1 and noticed that VeSync integration wasn't working. I thought something went wrong on the upgrade but then the VeSync Android App says server error and won't load either so I'm guessing my VeSync account had been throttled. Hopefully this can be rectified somehow.

@leiyucs
Copy link

leiyucs commented Aug 12, 2024

+1. stopping HA auto polling solved the problem.

@tangix
Copy link

tangix commented Aug 12, 2024

+1. stopping HA auto polling solved the problem.

Having the same issue, did you turn off polling from the integration setting?

@jmunchies1
Copy link

I originally turned off polling in the integration setting but have since turned it back on. So far been ok for 24 hours, wonder what the threshold is. In any case, can the devs create a setting to reduce the polling rate? I would still like it to update but less frequently so we don't get throttled.

@mattryyc
Copy link

I'd like to also see options around polling rate added here, assuming that would solve the issue. The throttling also means that VeSync app can no longer control the devices (not just HA), so this is a big impact to the device functionality when the throttling kicks in.

@mtnbiker777
Copy link

Add me to the list of people having this issue.

@jmunchies1
Copy link

Had this issue happen again when going from 2024.8.3 to 2024.9.1. it seems that major HA version upgrades will trigger it for me but minor (in-month) upgrades don't.

Devs please see if there's a way to reduce the polling rate please.

@handfix
Copy link

handfix commented Sep 11, 2024

I also have the issue and I would love a poll rate setting as others mentioned.

@jlrosssc
Copy link

I’m having the same issue but with a twist. I have an install of 2024.9.1 with 24 devices total with no current issues. I’m monitoring wattage and voltage on several of these which changes frequently. Again, no problem on that install at all.

I recently added 5 plugs to a family member’s home that also has HA 2024.9.1. They had 4 plugs in place that had been working fine with the iOS app with no issues simply to turn on lamps. The 5th switch was added to turn on a crawl space fan and I did that from the HA VeSync integration. When I added the Vesysc integration with these 5 plugs, the problems started. I contacted VeSync tech support and they said it was from high usage. I am only really doing anything with 1 plug but it’s causing issues as long as the integration is active. On my install with 24 devices and reading some data frequently, I’m not (currently) having any issues.

@loumarjr
Copy link

What functionality do we lose if polling is turned off in Home Assistant. Turning off VeSync Polling in HA worked but will I just lose the ability to see the status of the device in HA?

@jmunchies1
Copy link

What functionality do we lose if polling is turned off in Home Assistant. Turning off VeSync Polling in HA worked but will I just lose the ability to see the status of the device in HA?

Yes.

I'm wondering if the integration has been abandoned as it's been over two months and no devs have responded. I'm sure they are busy but at least an acknowledgement of the problem. Seems like it would be an easy fix too.

@loumarjr
Copy link

What functionality do we lose if polling is turned off in Home Assistant. Turning off VeSync Polling in HA worked but will I just lose the ability to see the status of the device in HA?

Yes.

I'm wondering if the integration has been abandoned as it's been over two months and no devs have responded. I'm sure they are busy but at least an acknowledgement of the problem. Seems like it would be an easy fix too.

It should be an easy fix. I would thing a setting related to polling would solve the problem. Seems that HA is flooding Vesync's servers with requests.

@tangix
Copy link

tangix commented Sep 30, 2024

What functionality do we lose if polling is turned off in Home Assistant. Turning off VeSync Polling in HA worked but will I just lose the ability to see the status of the device in HA?

Yes.

I'm wondering if the integration has been abandoned as it's been over two months and no devs have responded. I'm sure they are busy but at least an acknowledgement of the problem. Seems like it would be an easy fix too.

@JeffSteinbok reported the same issue on the underlying library with zero response so looks like we are out of luck here - webdjoe/pyvesync#245

@cdnninja
Copy link
Contributor

When I get time I will see what is involved to adding a setting for this.

@loumarjr
Copy link

When I get time I will see what is involved to adding a setting for this.

Thank you so much for your hard work! We all really appreciate it!!

@mtnbiker777
Copy link

It's interesting that when it hits the throttle, HA looses communication to the purifiers as does the official VeSync app ... oddly Alexa does not ...

@jlrosssc
Copy link

jlrosssc commented Sep 30, 2024 via email

@webdjoe
Copy link
Contributor

webdjoe commented Sep 30, 2024

I do not believe this should be handled by the pyvesync library itself. I have a branch that I am working on to customize the scan interval in HA. I'm 67% of the way there, just a bit short on time these days.

If you shut off automatic polling, you can set up an automation to update entities on a specific interval https://www.home-assistant.io/common-tasks/general/#defining-a-custom-polling-interval (Only update one entity per device)

@tangix
Copy link

tangix commented Oct 1, 2024

I’m seeing it not only loose communication but they disappear off the VeSync app as devices. Sent from my iPhoneOn Sep 30, 2024, at 5:14 PM, mtnbiker777 @.> wrote: It's interesting that when it hits the throttle, HA looses communication to the purifiers as does the official VeSync app ... oddly Alexa does not ... —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.>

Have you tried going to cellular when the VeSync app doesn't work?
Asking because I have HA and my IoT devices on a separate network that egress through NordVPN and thus get another IP-address. From my "normal" network I can still use the VeSync app to control my purifiers even when HA has lost connection. Guessing that is because HA polls from the NordVPN address and hits the limit from that IP.
Interesting to see that the purifier still can communicate with the VeSync servers via the NordVPN egress.
Regarding Alexa I wonder if that is because Alexa looks like coming through Amazon's servers and thus doesn't hit the throttle?

@jlrosssc
Copy link

jlrosssc commented Oct 1, 2024 via email

@webdjoe
Copy link
Contributor

webdjoe commented Oct 1, 2024

@cdnninja thank you for linking that PR, you just saved me a ton of time.

I'm going to test with update_entity to see if there is a sweet spot before making a new PR to set default.

@cdnninja
Copy link
Contributor

cdnninja commented Oct 1, 2024

No problem! It's missing a key part still of how to link to the entity value. Interface works though.

@cdnninja
Copy link
Contributor

cdnninja commented Oct 1, 2024

Just saw they closed my draft pr. Looks like we can adjust the interval but that's it.

@loumarjr
Copy link

loumarjr commented Oct 1, 2024

If this gets fixed, do we have to install a custom version of the Vesync integration or will it be integrated. Also, if I set up custom polling, as a temporary workaround, do I have to add only one entity per device (and it will update the whole device) and what should be the recommended polling interval? I have about 30 VeSync outlets and it is a major headache because I am constantly throttled. Thanks!

@webdjoe
Copy link
Contributor

webdjoe commented Oct 1, 2024

The update would be on the core platform, not custom component, but it can only be set to one value for the whole integration so we need some input on the best interval to use.

One entity per device updates all the device entities. You can enter multiple entities into one automation action. I would start with 60 seconds and adjust from there.

@loumarjr
Copy link

loumarjr commented Oct 1, 2024

Thank you. I can't tell you how many months I thought VeSync was having extreme problems with their servers. My nightlight throughout the house were set to turn on and off and some did and some didnt when they were suspose to. I did purchase some Shelly outlets that seem much better but after months of getting VesSync outlets, the extra cost hurt. Thanks to all for all your help and let me now if you need any feed back because I have several of these VeSync outlets still in use.

@webdjoe
Copy link
Contributor

webdjoe commented Oct 1, 2024

@loumarjr When you give it a chance to run, let us know which interval works for you

@loumarjr
Copy link

loumarjr commented Oct 2, 2024

Will do!

@tangix
Copy link

tangix commented Oct 2, 2024

The update would be on the core platform, not custom component, but it can only be set to one value for the whole integration so we need some input on the best interval to use.

I poll manually every 10 min but I only have two purifiers so use case is maybe not relevant because it only gets the air quality and filter life values.

@Mullin
Copy link

Mullin commented Nov 2, 2024

Any updates ? I'm having the issue for a couple of months now and it's really a issue as i drive all my air purifiers with Home Assistant. Everytime the throttling happen, i can't no longer pilot my air purifiers and it happen a lot !!

@cdnninja
Copy link
Contributor

cdnninja commented Nov 2, 2024

@Mullin follow these steps: https://www.home-assistant.io/common-tasks/general/#defining-a-custom-polling-interval

@XGhozt
Copy link

XGhozt commented Nov 13, 2024

I can confirm, I emailed them and got a response back. Here's what they said if anyone wants to know the limits:

It appears that your APP requests have been limited. Because there have been incidents of malicious access to our APP before, we have limited the number of APP requests per day. If the number of daily APP requests to the cloud does not exceed the limit of 3200+1500*current number of devices, there will be no impact on the normal use of the VeSync app on your phone.

@stefan-sherwood
Copy link

For what it's worth, I have had a script that has been polling the VeSync server every 3 seconds for years without issue. Then I was doing some testing and had a bunch of server logins in a short period of time (~30 in 30 minutes) it got cut off. It seems that the throttling is based on logins, not status update requests

I haven't read the HA plugin code but if it's doing independent logins for each poll, the solution may be to keep connected with a persistent connection and poll for updates from that connection.

@victorgrund
Copy link

This is definitely impacting me as well. Every day or so, I get throttled and associated entities become unavailable.

@cdnninja
Copy link
Contributor

cdnninja commented Jan 3, 2025

This should be resolved by #134087 as it drops the poll to 60 seconds. It has now been merged. It won't make 2025.1.1 but will be in a future release.

Big thanks to @iprak for doing this!

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

No branches or pull requests