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

Integration generates absurd amount of traffic #22

Open
k9rdu opened this issue Dec 23, 2024 · 7 comments
Open

Integration generates absurd amount of traffic #22

k9rdu opened this issue Dec 23, 2024 · 7 comments

Comments

@k9rdu
Copy link

k9rdu commented Dec 23, 2024

This integration is generating more traffic to and from the internet than the entire rest of my home assist installation with over 200 entities and a dozen integrations.

It generates between 45 and 55 kbs about every 10 seconds. This occurs whether or not "Enable newly added entities" and "Enable polling for updates" are enabled or disabled in the system options of the integration.

I have two smart feeders in this integration. See router images of data use with the integration enabled and disabled.

Clipped_image_20241223_094709

Clipped_image_20241223_094742

@dcmeglio
Copy link
Owner

Can you show me the entity list? I don’t own a feeder anymore but that entity count sounds very high.

@k9rdu
Copy link
Author

k9rdu commented Dec 23, 2024

Not sure where you are getting the entity count from as I did not provide it. Here are screenshots of the entities for this integration.
Clipped_image_20241223_135351
Screenshot_20241223_135320_Home Assistant

@k9rdu
Copy link
Author

k9rdu commented Dec 23, 2024

Just re-read my original post. Are you wanting a list of every entity in my entire home assistant setup?

@dcmeglio
Copy link
Owner

No that's what I was looking for. Based on the way the petsafe API works, this is expected behavior. Their API returns a lot more data than we need, but to poll, that's what they offer. The integration polls every 10s. Personally speaking, I have a 2Gb/s connection. Something that wouldn't have killed my 56k modem from the 90s I don't personally consider "absurd." It might be higher than other integrations you have, can't argue with you there, but it's how the integration works so I'd consider this expected behavior.

@k9rdu
Copy link
Author

k9rdu commented Dec 24, 2024 via email

@dcmeglio
Copy link
Owner

No offense taken. I'm not sure what to offer here. Their API is cloud only. While yes, the device itself can work without internet, that doesn't mean there is an API I can use. The only API I found is cloud based and this is how their API works. If you're trying to have everything local, this probably isn't the best device. I'd suggest getting a feeder that can be flashed with a Tasmota firmware or something like that which will let you control it locally. Unfortunately, this is cloud only.

As far as why every 10 seconds? I could reduce the polling frequency I suppose. I'll add though, you're the first person to raise it as an issue, again this is a very small amount of network traffic in the grand scheme of things. Most people are trying to get their devices to be as "real-time" as possible so making it every 4 hours instead of every 10 seconds may not be desirable for others. Also, and perhaps a bad decision, but this was designed to be generic for other Petsafe devices. Personally I have a litter box. When my cats use their litter box is unpredictable. Once a day? 10 times a day? When? No idea. Best way to get it accurate is to poll frequently. While I understand you don't necessarily see the value of the polling, mostly, I designed this foremost with my own needs in mind and for the litterboxes I do need the polling. I'll consider adding a setting to reduce the polling frequency in the future.

and more importantly that when I turn everything off in system options it is still polling I don't think these options do what you think they do, or if they're supposed to do what you think, then I can at least confirm it's not how I built the integration. If the integration didn't poll, it would never report any data and wouldn't work. These settings do not stop the integration from polling the API.

Like I said, I understand you're looking for something different, but this is how this integration is designed to work. If you're interested in raising a PR, I'd be happy to take a look, but I think you want an edge case that I don't think others will want. If there's no polling, none of the data displayed by the integration will ever be accurate. It'd basically just be something to trigger manual feeding.

@k9rdu
Copy link
Author

k9rdu commented Dec 25, 2024 via email

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

2 participants