Dynamic polling of tesla-fleet

Now that the Tesla Fleet integration has changed its polling interval to a static one, and suggests using an automation to emulate the previous dynamic polling, I wonder if anyone has already made a nice automation, or have some ideas on what factors to include when creating a dynamic approach.

E.g. Poll more frequently

  • When shift state is in D or P
  • Up to 5 minutes? after shifting into P
  • When charging?
  • When Status = Connected?
  • Other ideas?
1 Like

Hello, I need a automation to open my Garage Door even when I open my Car!
Does anybody have any Idea?
It seems that obviosly function cannot be supported from the tesla app.
I have the following configuration
(Checked ON) …Force cars awake on startup !

Also I want to open my Garage Door if the location tracker (device_tracker.gerryteslam3_location_tracker) …triggered to be at “Home”.
But this also not working correct in case of delayes in sending / polling the data out of my Tesla to be received in hoemassistant.

I am trying an approach, let me summarise here;

  • have one automation
  • have three different time pattern triggers
  • longer duration every 4 hours - to be used in at home conditions
  • normal duration every 30 minutes - to be used in driving conditions but not very close to home and my phone is connected to the car
  • short duration every 15 seconds - to be used in driving conditions while my phone is 1 km close to home and while i am approaching to home and my phone is connected to the car
  • if the conditions of each respective triggers are satisfied, call update_entity service on home assistant for tesla integration.

Still not finalised properly, will keep you posted.

Keep in mind that each trigger has a specific id and i am using conditions to check if respective trigger’s conditions are satisfied before calling update entity service.

alias: "Tesla polling update "
description: ""
triggers:
  - trigger: time_pattern
    hours: /2
    id: Longer
  - trigger: time_pattern
    id: Normal
    minutes: /10
  - trigger: time_pattern
    id: Shorter
    seconds: /15
  - trigger: homeassistant
    event: start
    id: Start
conditions:
  - condition: or
    conditions:
      - condition: and
        conditions:
          - condition: trigger
            id:
              - Longer
            enabled: true
          - condition: state
            entity_id: device_tracker.model_3_location
            state: home
      - condition: and
        conditions:
          - condition: trigger
            id:
              - Normal
          - condition: not
            conditions:
              - condition: state
                entity_id: device_tracker.model_3_location
                state: home
      - condition: and
        conditions:
          - condition: trigger
            id:
              - Shorter
          - condition: state
            entity_id: binary_sensor.fuat_connected_to_tesla
            state: "on"
          - condition: state
            entity_id: device_tracker.fuat_mobile
            state: not_home
          - condition: numeric_state
            entity_id: sensor.home_proximity_fuatx3pro_distance_2
            below: 1000
          - condition: state
            entity_id: sensor.home_proximity_fuatx3pro_direction_of_travel_2
            state: towards
      - condition: trigger
        id:
          - Start
actions:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - Start
        sequence:
          - delay:
              hours: 0
              minutes: 1
              seconds: 0
              milliseconds: 0
  - action: homeassistant.update_entity
    data:
      entity_id:
        - device_tracker.model_3_location
mode: single

How did you go with this? I was using Teslametry which pulled regularly. But moved to Tesla fleet and trying to solve this. I am currently trying number plate recognition with frigate. No luck.

I moved to teslamate, it naturally handles this without any hassle.

yeah i am now trying with teslsa fleet - if my car shows destimation less than 2km away - to poll home status of car every 5 seconds. then it stops after 10 mins

Ill see how this goes. I just like the free credit with tesla fleet. teslemetry can cost a bit

Teslamate is free btw

How did I miss this

I am using both TeslaMate (MQTT to HA) and TeslaFleet (the official integration).

Both have their pros and cons.

Mostly, I use TeslaFleet to send commands to the car, and a combination of the sensors from Fleet and Mate for monitoring, alerting etc.

I have an automation that runs every minute, and will adjust the poll interval for TeslaFleet based on different sensors, both from TeslaFleet and TeslaMate.

  • If the car is actively charging, Poll Interval is set to 1 minute.
  • If the car is in Neutral, Drive or Reverse (e.g. not in Park), Poll Interval is set to 1 minute

This give me frequent (enough for me, at least) updates when the car is doing something interesting.
Energy usage is not that important, as the car is driving or chargin anyway, and the frequent polling does not add that much to it.
And this will usually keep me well below the included limit of poll requests without causing any high charges from using the API.

  • If the car is connected to a charger, but not actively charging, Poll Interval is set to 5 minutes.

This will ensure I get reasonably updated information about charging sessions, battery state etc. Energy usage is not that important, as the car is connected. And it allows for saving some poll requests when the car is not really doing anything.

  • If the car is Parked, and NOT connected to a charger, I set Poll Interval to 10 minutes.

This ensures that the car can sleep, and saves further API requests, while still ensuring that the data is not going stale.

Since I use both TeslaMate (MQTT) and TeslaFleet sensors, one or more of the relevant sensors will usually be updated as soon as the car wakes up when someone unlock it, so the Poll Interval change from 10 to 1 minute does usually not have to wait for the entire 10 minute interval to complete.

For me, this is an OK balance.