ricott / homey-no.easee

Easee app for Homey
GNU General Public License v3.0
5 stars 5 forks source link

Thousands of poll requests from this app blocks the Easee cloud from further input. #57

Closed rikardlundgren closed 8 months ago

rikardlundgren commented 11 months ago

The Easee cloud freezes and is unable to receive more requests due to excessive polling from this Homey Easee app. I've received logs from Easees dev team showing there is a poll from this app every ten minutes requesting the charger(s) lifetime energy continuously. This means on average 730.5h/month x 6 requests/hour = 4383 requests monthly.

Can this be changed to something less frequent like once per hour (which would still mean short of 1000 requests/month), or even better, be turned of completely and instead have a flow-card for this?

Once the cloud stopped accepting further inputs I'm not able to use even the Easees own android app to give inputs. Only output, data from the charger, is sent back to me.

This also means that the only way to start charging is if you already have set it up to start whenever a car is connected or if you have a physical NFC tag that you have already set up to work locally with the charger. To stop charging you have to use the cars functionality for that.

Last but not least the only way to reset this is to either 1. cut the power to the charger for 2 hours so that it disconnects from the Easee cloud long enough for the cloud to initiate a fresh session once you turn the power on again OR 2. Send a ticket to Easee customer support which they will relay to the dev team to initiate a new session trough the backend.

I have two integrations active to my Easee setup, it's this Homey app and a Monta integration. Look at the log 03 and you will clearly see when the handful number of Monta requests has been sent in. The rest has been confirmed to come from the Homey app.

I can confirm that it is Homey, not Monta, as Monta commands appear as follows and clearly show Monta (See log 03 attached) And there are very few commands coming from Monta. I hope this helps. Med vennlig hilsen, Kamal at Easee support

For info: The support at Easee didn't give me a straight answer on how many requests per unit of time the Easee cloud are supposed to be able to handle and they said that their dev team are working on a potential fix on their side as well.

01 Logs 02 Logs 03 Logs

ricott commented 11 months ago

This is the first time I have heard of this being a problem, but not surprised. A pretty common problem across lots of different Homey apps where refreshing values is based on polling. I have two chargers and thus issue twice the amount of calls to the Easee cloud that you do (assuming you only have one charger?) and still no problems here. Maybe your second integration still is what is adding up to the total so that you are "blocked"? The only thing we see on the screen shots you shared are calls to 124, ie life time energy. This is one of the endpoint that is invoked the least number of times, even if it is one that forces Easee cloud to ping to the charger.

But for sure I know there are thousands of calls made to their cloud services - most don't reach the charger though. I have added a counter to the app. In the Homey mobile app go to settings / Apps / Easee home / settings - here you see a summary since last Homey restart, and stats per endpoint. There will likely be tens of thousands of invocations over time, I have 91k invocations in total since 30th of September (on two chargers).

There are apps like Piggy bank for Homey that controls an Easee charger through the Easee Homey app. The little I have seen in logs from other users tells me that users using this combo of apps issue lots of additional calls to the Easee cloud and the charger. Haven't heard of them being locked out though.

To identify the homey app when calling the Easee cloud the app sets the User-Agent header field to homey-no.easee/<version of the Easee app>. This is what was agreed with the Easee developers in their slack channel, the pyeasee home assistant app does the same.

If this was a common a problem I assume they would reach out to me on the slack channel where we from time to time interact. They know I'm the developer of the Easee homey app and there are not many third party app developers in the slack channel. They have also in the past created tickets for me here on GitHub.

When did the problem start to appear? Is it constant, ie happens all the time? Have you tried disabling one integration and checked if the problem persists?

Can this be changed to something less frequent like once per hour (which would still mean short of 1000 requests/month), or even better, be turned of completely and instead have a flow-card for this?

Of course, most things are possible to change. I fail to see how one API call each 10 minutes can be a problem though. There are other endpoints being invoked 20 times during those 10 minutes. I can post a question in the slack channel and see what they tell me.

rikardlundgren commented 11 months ago

First of all, thank you for this thorough answer in such a short time. :)

Secondly, I do actually have two chargers of the same type and model so it should be more or less the same as for you. As what I can see the logs do not say to which device the requests are sent to.

Thirdly, It seems that they are aware of this problem and are trying to reproduce the error. I will forward your reply to the customer service with the aim to maybe get the devs talking directly to you in your Slack environment and thus cutting out the unknowledgable middle man (me) in their efforts to reproduce the error. Additionally I will paste the latest reply from Kamal down below. I will also paste the entire conversation with the Easee support.

As to your other questions:

When did the problem start to appear?

I had my initial talks with the Monta support on the 5th of September. The issue must have started before that point but not earlier than the 8th of August when I know it worked properly. Thereafter filing a ticket to Easee on the 7th of September to be able to find the source of the problem.

Is it constant, ie happens all the time?

Since the 5th of September, only a power cut will help the situation momentarily. After a while it fails again, have not been able to time the exact period and if the length of this is consistent.

Have you tried disabling one integration and checked if the problem persists?

I'm open to suggestions here. Due to different logics and setup in the Homey as well as with Monta I'm reluctant to uninstall/delete the integrations and thus have to re-do the setup from scratch. However, if there are a way to temporarily disable/pause the integration(s) and then get them back into flows etc again when enabling, I'm all ears to to try. Is this possible for this app?

Can` this be changed to something less frequent like once per hour (which would still mean short of 1000 requests/month), or even better, be turned of completely and instead have a flow-card for this?

Of course, most things are possible to change. I fail to see how one API call each 10 minutes can be a problem though. There are other endpoints being invoked 20 times during those 10 minutes. I can post a question in the slack channel and see what they tell me.

I agree, the absolute number of 4000+ might seem big but considering the time frame between them it shouldn't pose any bigger concern or threat to bandwidth / processing power. In any case, should they have implemented some sort of limitation/restriction on this I believe it should be clearly mentioned in the documentation for the APIs etc.

Last reply from Easee:

Kamal Karaa (Easee)

  1. okt. 2023, 16:05 CEST Hello Rikard,

The issue is something our cloud team is aware of and they have assured me that it is a top priority.

Unfortunately, there is no date as to when it will be implemented. At the moment, they are still in the investigation phase and are still trying to reproduce the issue on one of the test chargers.

There is also no way for end users to follow progress on internal processes such as this.

I apologise for all the inconvenience this may have caused. Med vennlig hilsen, Kamal 2023-10-12 1636 Summary ticket communication.pdf

ricott commented 11 months ago

Easee asked for charger id's experiencing the problem. Don't think there is anything sensitive in sharing them here, otherwise email them to me on richard@barkestam.se

rikardlundgren commented 11 months ago

You've got mail.

Med vänliga hälsningar / Best regards

Rikard Lundgren

Easee asked for charger id's experiencing the problem. Don't think there is anything sensitive in sharing them here, otherwise email them to me on @.**@.>

— Reply to this email directly, view it on GitHubhttps://github.com/ricott/homey-no.easee/issues/57#issuecomment-1760194773, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BBCE6PYGNTNN3QHCB33XWGLX7A3RBANCNFSM6AAAAAA55ST2VE. You are receiving this because you authored the thread.Message ID: @.***>

ricott commented 8 months ago

Didn't get much from Easee when chatting to them via Slack, other than you had already heard. Closing the issue for now, if it appears again create a new ticket.

rikardlundgren commented 8 months ago

It seems they have other things to focus on at the moment.

The issue is persistent, and has never stopped. I solve it by cutting the power on the circuit-board to both chargers. This will within two hours refresh the session to the cloud and then I can use it for a couple of days more before the next time.

It works for manually charging the car but to automate or achedule anything during e.g. the night is out of the question. To unreliable unfortunately.

Thanks for your effort looking into this though, I appreciate it alot.

God fortsättning!

Med vänliga hälsningar / Best regards

Rikard Lundgren VD

Cell: +46761872000 Email: @.***

2change World AB 559047-8755 Munga byväg 15 72594 Västerås

BG: 392-5922

Didn't get much from Easee when chatting to them via Slack, other than you had already heard. Closing the issue for now, if it appears again create a new ticket.

— Reply to this email directly, view it on GitHubhttps://github.com/ricott/homey-no.easee/issues/57#issuecomment-1879656276, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BBCE6PYG6G654RLR2WB7VM3YNE3ZPAVCNFSM6AAAAAA55ST2VGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZZGY2TMMRXGY. You are receiving this because you authored the thread.Message ID: @.***>