Scheduled polling for Tesla

I have Hass.io configured to poll my Tesla car and I have automations to start/stop the car charging based on my solar panel output. This means I only ever use 100% home-grown solar juice in the car.
I have a polling interval of 300 and all is working well.
Is there a way to set a schedule for the polling so that I only poll the car between certain times of the day? The polling all day and night stops the car from sleeping and so causes significant energy consumption at times when the poling has zero value (eg: at night).

1 Like

Were you able to figure something out on this?

Nope. You are the first to respond and I’ve not worked out a way myself either.
Do you have any ideas?

sorry to revive an old thread, but I’m having the same issue. I would love to only poll when it is out of the garage (you know… when there is real value…)
I have a reeeeally janky fix and it is to block homeassistant at the OS level from being able to hit the tesla API by putting in a fake entry in /etc/hosts for owner-api.teslamotors.com
i accomplish this with an automation that removes the entry when i leave the house, and puts it back in when i arrive home. It may not work for hass.io, but i figured i would mention it in here anyway. the downside to my stupid fix is that the log is full of failures for the tesla component when im blocking the api calls. and if you want to trigger something, you have to unblock it first (which i made a cli switch for)
Ideally, we would be able to dynamically update the polling frequency through an automation.

3 Likes

I just started with HA and am using hassio and Node-RED for my automations. There is a packaged Node-RED component that you can import, node-red-contrib-teslams , and it gives basic control and status. There are a ton of other components such as time of day controls (bigtimer) that should make it possible to do what you want to do. You could also wire in a sensor that detects when your car shows up on WiFi or some other way of sensing that it is in the garage.
image

You can copy the example at the bottom of https://flows.nodered.org/flow/48778e2b3c2f90c155b8 and paste it into a tab (flow) to get started.

Example data:
{“battery_heater_on”:false,“battery_level”:71,“battery_range”:177.07,“charge_current_request”:48,“charge_current_request_max”:48,“charge_enable_request”:true,“charge_energy_added”:10.91,“charge_limit_soc”:90,“charge_limit_soc_max”:100,“charge_limit_soc_min”:50,“charge_limit_soc_std”:90,“charge_miles_added_ideal”:47.5,“charge_miles_added_rated”:38,“charge_port_cold_weather_mode”:null,“charge_port_door_open”:false,“charge_port_latch”:“Engaged”,“charge_rate”:0,“charge_to_max_range”:false,“charger_actual_current”:0,“charger_phases”:null,“charger_pilot_current”:48,“charger_power”:0,“charger_voltage”:0,“charging_state”:“Disconnected”,“conn_charge_cable”:"",“est_battery_range”:145.7,“fast_charger_brand”:"",“fast_charger_present”:false,“fast_charger_type”:"",“ideal_battery_range”:221.14,“managed_charging_active”:false,“managed_charging_start_time”:null,“managed_charging_user_canceled”:false,“max_range_charge_counter”:0,“not_enough_power_to_heat”:false,“scheduled_charging_pending”:false,“scheduled_charging_start_time”:null,“time_to_full_charge”:0,“timestamp”:1551051448856,“trip_charging”:false,“usable_battery_level”:71,“user_charge_enable_request”:null}

Just wanted to +1 on this. This component causes some serious vampire drain. Setting polling to 60min right now, because I don’t use it in any automations yet. But being able to schedule the polling would be great!

Edit: submitted an issue on GitHub for this https://github.com/home-assistant/home-assistant/issues/23227

4 Likes

Exactly the same here. The default polling interval of 300 seconds cause a huge amount of vampire / phantom drain. (~6-7% per day).
I set it at 60’, so 3600 second for now, but I am not even sure I will keep the component in it’s current state.
A example where it’s done right is the TezLab app, which tells you the car went into deep sleep, and warns you that you’ll wake it if you poll it right now.
OTOH, it would be nice it if Tesla API would allow the poll the “most recent values” without waking the car.

1 Like