skodaconnect / homeassistant-myskoda

Homeassistant integration for MySkoda.
19 stars 5 forks source link

Support configurable poll frequency #151

Open dvx76 opened 2 hours ago

dvx76 commented 2 hours ago

We currently have a hardcoded poll frequency of 30m. This is based on the assumption that any notable event will have an associated MQTT event which will result in entities being updated. In reality we're seeing that's not always the case. One example is that some Enyaq owners see soc events every 1% charger while other only every 10% charger.

Discord convo: https://discord.com/channels/877164727636230184/877167631935897621/1301289245951918152

The request here is to:

WebSpider commented 2 hours ago

I've given this some thought, and while I think you should be able to configure this yourself, I prefer that we also make an educated guess ourselves to see if MQTT is working by:

  1. Recording the date/time of last received MQTT message
  2. Comparing this with captured date/time at polls

If we then conclude we are missing MQTT messages, raise the polling interval, and if we get MQTT messages again, lower it.