mbillow / ha-chargepoint

Home Assistant ChargePoint EV Charger Integration
MIT License
44 stars 6 forks source link

Would be nice to have poll frequency configurable #16

Open hari2m opened 1 year ago

hari2m commented 1 year ago

In cases where automations are setup for closing the garage door when the charger is plugged in, it takes lot of time for HA to know that the charger is plugged in, if we can configure the poll frequency we can avoid lag in automations.

mbillow commented 1 year ago

The polling interval that is set it to avoid causing undue stress on the ChargePoint APIs. Unfortunately, given the nature of pure-polling integrations, they aren't suited for real-time automation. Even if the polling interval was configurable, it still be on the scale of minutes. Which, in the best case scenario, means your garage door would close a minute after you plugged your car in. That still seems pretty sub-optimal.

That said, in the global settings API endpoint, it returns a panda_websocket_endpoint which might be a path forward for us to get push updates from ChargePoint on charger status changes. I haven't had time to play with this yet, so I am just speculating though.

tylerpieper commented 3 months ago

I know this is bumping an old topic, but would it be possible to add a diagnostic entity to "update now" with an internal cooldown to prevent too many refreshes in a short period? Then, we could automate a refresh based on 5 minutes after coming home, or when the garage door tripwire sensor is triggered.

almoney commented 3 months ago

Be careful with over polling. Charge point is getting a bill for those polls. Hourly should be fine.