ryanmac8 / HA-Mint-Mobile

Mint Mobile Integration for Data Usage Monitoring
MIT License
8 stars 4 forks source link

Reduce Polling Interval Option #24

Open zSprawl opened 1 year ago

zSprawl commented 1 year ago

Is your feature request related to a problem? Please describe. Mint Mobile’s website has auto blocked my IP for too many logins.

Describe the solution you'd like Ideally we have some way to fine tune the polling interval to keep Mint happy with less login attempts. Perhaps a polling interval option?

Describe alternatives you've considered N/A

Additional context They have banned my home IP, hopefully temporarily, because I login too often with HA. The Mint website no longer works from my home IP but if I change public IPs, like a mobile hot spot, it connects.

ryanmac8 commented 1 year ago

Sure. I can work on that.

Ali229 commented 1 year ago

Uh I have this happened to me and I'm on the phone with the "Tech" right now it's a nightmare trying to tell them that nothing is wrong with my service and I can access my account using mobile data and someone needs to unblock my home ip. The solution they are giving me is to fix my home wifi. (facepalm)

zSprawl commented 1 year ago

I’ve gone around in circles with Alex on Reddit from Mint Mobile. He said his IT department has many reports and is looking at it.

They basically implemented a web application firewall that triggers thinking this addon is a bot. I’m hoping the reduced polling to maybe once per day will work if they ever unban me because being able to monitor usage rocks.

He said it could take “up to 30 days”, but I suspect they outsourced their OpSec so they are confused.

ryanmac8 commented 1 year ago

So I've decided to leave Mint Mobile over this issue. They have blocked my ISP and their API even returns "BAD_ISP" yet their customer support staff will tell you that they don't block IP's and that you need to reach out to your ISP to fix their issues. They have put in a ticket before to solve this but upon follow up, say that the ticket was never worked.

Ali229 commented 1 year ago

I don't think they are trained for such a request, I don't think someone intentionally has blocked our IP. This is probably done as @zSprawl by a firewall. I can only hope this firewall whitelists us after X amount of time.

ryanmac8 commented 1 year ago

It probably is a firewall. They use an Imperva WAF as there web firewall but they don't know how to unblock my ISP, which I have Mint Mobile integration disabled for a few months now and can not manage my account anymore and everybody else in my building is blocked from Mint Mobile as well since we have a CGNAT and share IPv4 addresses. Blocking customer's IPs is not the answer and should instead preform a security challenge like a CAPTCHA. Since they are unwilling to work with you on the issue, I don't see a reason to continue using them for my service as their's other providers out there that will do better.

zSprawl commented 1 year ago

Dang that sucks. We are all using Mint likely cause it’s $15 per month. I’m locked into an annual contract but I’d be interested if you find a better provider and integrate it with HA.

How hard is it to change the polling interval to 1 day if they ever unban us? It is a simple variable change in the code for polling interval?

Not gonna hold my breath but I’m stuck with Mint for a year anyhow. Hopefully they figure out the WAF issue as I suspect they’ve outsourced the security to a 3rd party.

ryanmac8 commented 1 year ago

@zSprawl I've actually already updated the code to be a variable for the polling interval that you can set to any amount of time. In addition, I refactored the code to make as little of API calls as possible to reduce the risk of getting banned. I just don't have a way to test it.

I'm moving over to Visible that's $40 a month with unlimited data. Due to that being unlimited, I'm not sure it's worth even tracking that data in Home Assistant.

zSprawl commented 1 year ago

Awesome.

Well best of luck. I’ll try the code out if they ever unban me. It appears to have hit a lot of people so hopefully eventually they are pressed to fix it.

ryanmac8 commented 1 year ago

@zSprawl Sounds good. I'll push out the code as a beta version so you can select it from HACS then.

zSprawl commented 1 year ago

Did that beta ever get pushed to GitHub? They finally unblocked me and my annual is going to expire next month, so I wanted to try one more time.

ejpenney commented 1 year ago

I think this repo has basically been abandoned. I'm not sure what the original fix was. How long did it take for your IP to be un-banned? I think I was banned this morning, I am adding the below to sensor.py (just below line 22), but I'm curious how long it'll take before it starts working again!

SCAN_INTERVAL = datetime.timedelta(hours=6)

I have no idea if it'll do the trick...

zSprawl commented 1 year ago

It took almost 9 months... I think it's because they got purchased by T-Mobile, or at least, it seems to have happened around that time.

ejpenney commented 1 year ago

That's annoying. Could be it's related to the acquisition, it did (anecdotally) seem like a lot of churn happened surrounding Mint Mobile and their infrastructure during those weeks. Though the purchase isn't completed yet, so legally it's a little early for them to be taking any actions. It is possible they were doing some housekeeping at the same time, related or unrelated... But the big changes legally have to wait until the relevant government bodies approve the purchase (they're still separate legal entities for the moment).

That said, I can confirm the ban isn't an IP ban, but it is an account ban. I got banned about a month ago, I've tried from multiple IP addresses via multiple different ISPs, but gotten access forbidden messages every time. Would be great if there was at least some documentation letting us know how frequently we're allowed to ping the service before becoming banned. Is it a firm number of requests per year? Per contract term? In any event, I'm locked out for a month now. I'll cross my fingers it won't take 8 more months to become unbanned, though I may not stick with Mint Mobile in 2024 anyways.