Home Assistant Automations

Thanks for that. I think Lucid may have finally started rate limiting the API to some extent. I'll have to mess with it and see if I can figure out what the rate limit is so we stop hitting it.
Fwiw, I haven’t seen this on my HA instance, but I also don’t have LucidLogger running.

So I wonder if it’s the combo?

But good on them for finally enabling some rate limits haha
 
Just a quick note that I shut down LucidLogger this morning and I'm still getting the API exhaustion errors.

1759115733150.webp
 
Just curious if others who are using the HA integration are seeing the same thing as me (and presumably @Electric123). You can check by going to Settings, System, Logs and see if you have an error like this:
1759338728999.webp


If so, could you include your vehicle and vehicle software version?

Thanks
 
Just curious if others who are using the HA integration are seeing the same thing as me (and presumably @Electric123). You can check by going to Settings, System, Logs and see if you have an error like this:
View attachment 32974

If so, could you include your vehicle and vehicle software version?

Thanks
Yeah, I'm seeing the same. There's clearly a bug, we need to stay within their new rate limits. We are more than happy to accept pull requests! I may take a look, but I'm technically on vacation in Wisconsin until next week. Maybe @segbrk gets a minute to take a look or...

you! Work with Claude or your favorite IDE and send us a PR! <3
 
Just curious if others who are using the HA integration are seeing the same thing as me (and presumably @Electric123). You can check by going to Settings, System, Logs and see if you have an error like this:

If so, could you include your vehicle and vehicle software version?

Thanks
Yes, same error in my log, Gravity on latest 3.3.2.
I wish I could help with coding, but this is above my head at this point, even though I might dig into it in the future as I have some programming experience.
Also, Gravity software is way too buggy right now to trust it with any sensitive automations like garage doors, etc.
I can barely trust it to act as a car right now, it reminds me of early Windows NT/95 days when you expected BSODs at any moment for no reason.
 
Getting this when i try to update the integration in HA. Anyone else?
IMG_0066.webp
 
Getting this when i try to update the integration in HA. Anyone else?
View attachment 32976
That’s not updating the integration; that’s updating your Lucid Air’s firmware. :)

You can update (or redownload) from the HACS interface on the left side
 
Yeah, I'm seeing the same. There's clearly a bug, we need to stay within their new rate limits. We are more than happy to accept pull requests! I may take a look, but I'm technically on vacation in Wisconsin until next week. Maybe @segbrk gets a minute to take a look or...

you! Work with Claude or your favorite IDE and send us a PR! <3
Not a py dev but with AI, I’ll give a shot. 😊
 
LucidLogger is heavily impacted also. Pretty sure I didn't drive through the landfill on the way to work.
 

Attachments

  • Screenshot from 2025-10-01 13-11-10.webp
    Screenshot from 2025-10-01 13-11-10.webp
    35 KB · Views: 131
Not a py dev but with AI, I’ll give a shot. 😊
My first python pull requests submitted (please be gentle):
 
It seems like the Europe server is affected es well.

So if Lucid has introduced a rate limit for polling their APIs and we want to run HA and LucidLogger / TeslaLogger side by side, LucidLogger needs to get the latest response from the server via the Home Assistant Plugin. I would suggest to make a HTTP Request on HA Plugin and get the latest response?

that's what I execute from LucidLogger right now:

FileName = "python3.13",
Arguments = @$"/etc/lucidapi/examples/teslalogger.py --username {username} --password {password} --region {region}",



1760044121004.webp
 

Attachments

  • 1760044013316.webp
    1760044013316.webp
    229 KB · Views: 96
Phew glad I'm not the only one experiencing problems. I updated my firewall and core switch a few weeks ago and my garage door integration stopped working. I'd assumed I bungled something to do with the HA firewall rules during the upgrade. Just sitting down to troubleshoot, it seems connectivity is super spotty when the vehicle is awake:

1760044334534.webp
 
It seems like the Europe server is affected es well.

So if Lucid has introduced a rate limit for polling their APIs and we want to run HA and LucidLogger / TeslaLogger side by side, LucidLogger needs to get the latest response from the server via the Home Assistant Plugin. I would suggest to make a HTTP Request on HA Plugin and get the latest response?

that's what I execute from LucidLogger right now:

FileName = "python3.13",
Arguments = @$"/etc/lucidapi/examples/teslalogger.py --username {username} --password {password} --region {region}",



View attachment 33289
…or just poll less frequently?
 
I wrote some Pyscript to email me a basic trip report every time I park the car. To use it, you need to install @borski's Lucid integration and Pyscript. Put the contents of the gist into a file in your pyscript/ directory, edit the two config variables at the top, and you should be good to go. I attached a screenshot of what it gave for my most recent drive; I'm not sure how accurate these numbers are for short trips.

I was using this script and found it stopped working recently. Here is how I fixed it - in case anyone is interested. The fixed script is attached. Remove the .txt extension if you are copying it over.

The Problem​


If you're using the original Lucid trip report PyScript with Home Assistant, you may have noticed that emails never arrive after drives. This happens because the power_state sensor often flickers between "Drive" and "unavailable" during trips, causing the automation to fail. The original script expects a clean transition from "Drive" to another state (like "Accessory" or "Sleep"), but when the sensor becomes unavailable during the drive, this transition never happens, and the email is never sent.

Key Changes​


The updated script solves the flickering sensor problem by:

  1. Adding state tracking: Uses is_driving and drive_started flags to track drive sessions across sensor interruptions
  2. Ignoring "unavailable" states: The script continues tracking your drive even when the sensor temporarily becomes unavailable
  3. Triggering on stable states: Email is sent only when the car transitions to a stable state (Accessory, Sleep, Wink) after driving, not when the sensor is unavailable


Installation​

  1. Save this script to /config/pyscript/trip_report.py or whatever name you are using
  2. Edit the CAR_NAME and EMAIL_TARGET variables at the top
  3. Reload PyScript: Developer Tools → YAML → PyScript Python scripting → Reload

Configuration Requirements​


You'll need email notifications configured in your configuration.yaml: In this example, I am using Gmail.

notify:
- name: "email_xxxx" # Change this name as needed
platform: smtp
server: "smtp.gmail.com"
port: 587
timeout: 15
sender: "[email protected]"
encryption: starttls
username: "[email protected]"
password: "your-app-password" # Use Gmail App Password (no spaces)
recipient:
- "[email protected]"
sender_name: "Your Name Automation"

Testing​


  1. Uncomment the test function line in the script: @time_trigger("startup")
  2. Save and reload PyScript (Developer Tools → YAML → PyScript Python scripting → Reload)
  3. Check your email - you should receive a test trip report
  4. Comment out the test function again
  5. Take a short drive and verify that you receive the email after parking

​

 

Attachments

…or just poll less frequently?
Yep. I had to do that recently, too. Changed const.py to the following values for now.

# Base vehicle info refresh interval (seconds)
DEFAULT_UPDATE_INTERVAL = 120 # Changed from 30

# "Faster" interval used while vehicle is awake
AWAKE_UPDATE_INTERVAL = 30 # Changed from 7

# "Fast" refresh interval used when new information is expected
FAST_UPDATE_INTERVAL = 15 # Changed from 3
 
Yep. I had to do that recently, too. Changed const.py to the following values for now.

# Base vehicle info refresh interval (seconds)
DEFAULT_UPDATE_INTERVAL = 120 # Changed from 30

# "Faster" interval used while vehicle is awake
AWAKE_UPDATE_INTERVAL = 30 # Changed from 7

# "Fast" refresh interval used when new information is expected
FAST_UPDATE_INTERVAL = 15 # Changed from 3
Can you explain how to make these changes in Home Assistant? I am having trouble with my garage door automation due to the car’s location being sporadically unavailable, which is likely due to this polling issue.

I am using the Lucid integration on my Home Assistant Green. Thanks!
 
Back
Top