tesla icon indicating copy to clipboard operation
tesla copied to clipboard

Polling Toggle - Existing state doesn't survive Restart

Open USAFPride opened this issue 1 year ago • 9 comments

Version 3.19.8 (previous versions as well)

Describe the bug

Setting Polling to Off via the toggle resets to the On position when HA restarts.

I would expect the behavior to remember the state .

USAFPride avatar Feb 10 '24 14:02 USAFPride

The integration config has a checkbox for "force awake on restart" that usually works to get the latest data to solve this

jtaseff avatar Feb 12 '24 03:02 jtaseff

The integration config has a checkbox for "force awake on restart" that usually works to get the latest data to solve this

The problem is just the opposite. I need the polling to remain off due to an upstream issue with Teslamate that triggers older vehicles with the MCU2 upgrade not to sleep properly, thus causing excessive vampire drain. I have automations that manually poll when I need to until the issue is resolved.

Regardless of the Teslamate issue, the toggle state should be restored to its previous state (OFF) after a restart. By default it turns back on when the integration loads.

USAFPride avatar Feb 12 '24 12:02 USAFPride

I noticed it was doing this also, as I have an MCU1 car which seems to never sleep and i'm trying to figure out why.

ddaddy avatar Feb 13 '24 08:02 ddaddy

Just tested this on my instance, safe to say this looks like a bug. As a temp fix, you could have an automation that fires after HA restart that could set the switch back to off after a reboot (not ideal but hopefully stops you hitting the drain issue you mentioned)

skipishere avatar Feb 13 '24 08:02 skipishere

@skipishere, I have an automation currently doing as you suggested. The upstream sleep issue has been discussed for quite a few months, and I just finally got around to submitting the bug issue here. It's not an end of the world issue.

USAFPride avatar Feb 13 '24 12:02 USAFPride

I have the same issue. Unfortunately the integration automation to turn off polling kicks in after an initial poll. I tried disabling the switch, but that didn't do anything. Hopefully this bug gets fixed sooner than later!

sg1888 avatar Apr 18 '24 23:04 sg1888

I've done some research and I believe async def async_setup(hass, base_config): in the file __init__py needs to be modified to add the Polling state. Unfortunately I do not have the time right now to put a proper PR request together for this issue.

USAFPride avatar Apr 19 '24 09:04 USAFPride

Have same issue, I have multiple cars and don't need to polling them all, but unable to remove cars from integration and polling settings aren't saved permanently.

Largelos avatar May 15 '24 03:05 Largelos

Saving non-Tesla saved settings on restart is an enhancement and not a bug. Regardless, we'll take a PR to add this if someone wants to include it.

By design, the integration will not poll a sleeping car. However, on HA restart, the integration has no idea when it last polled. By default we set a 660 second poll. You can change that in options to be even longer. Of course, this was before the fleet API and does not account for any other services that may communicate with your car.

alandtse avatar Jun 08 '24 05:06 alandtse