Skip to main content

CarConnectivity-connector-lucid

OpenSSF Scorecard

A CarConnectivity connector for Lucid Motors vehicles (Air and Gravity), built on python-lucidmotors.

Read-only by default. It polls the same mobile API the Lucid app uses and populates the CarConnectivity model: state, odometer, battery level / range / capacity / cell temperatures, charging state and target, position, doors and locks, climatization, software version. Reads never wake the car, so polling costs nothing in battery drain. Commands (lock, climate, charging, trunk and the rest) exist from 0.2.0 but stay off unless the config turns them on; see Commands.

Verified against a 2026 Gravity on 2026-09-03.

Install

pip install carconnectivity-connector-lucid

Python 3.12 or newer. The connector logs in with a refresh token only (login_with_refresh_token(), in lucidmotors 1.4.2 and later), so there is no password on disk.

Credentials

The connector needs only a Lucid refresh token, stored in a JSON file:

{"refresh_token": "…"}

Mint one once with the library's login example (username + password, interactively), save the refresh_token it returns, and never store the password. The token does not rotate, so the file can be mounted read-only. Point the config at it — never paste the token into the config file itself.

Config

{
    "carConnectivity": {
        "connectors": [
            {
                "type": "lucid",
                "config": {
                    "refresh_token_file": "~/.config/lucid-token.json",
                    "interval": 60,
                    "driving_interval": 15
                }
            }
        ]
    }
}

All options in doc/Config.md.

Commands

Off by default. Without the option the connector creates no command objects at all and the charge limit is read-only, so nothing CarConnectivity exposes (the REST API, MQTT, the web UI) can send anything to the car. To turn them on, add "commands": true to the connector's config. It must be the JSON boolean true; a string such as "true" is refused at startup.

command where values library call
Charging charging/commands/start-stop start, stop start_charging / stop_charging
Charge limit charging/settings/target_level whole percent, 50 to 100 set_charge_limit
Climatization climatization/commands/start-stop start [--target-temperature 21], stop set_cabin_temperature (precondition / off)
Defrost window_heating/commands/start-stop start, stop defrost_on / defrost_off
Locks doors/commands/lock-unlock lock, unlock doors_lock / doors_unlock
Trunk doors/commands/trunk open, close trunk_open / trunk_close
Frunk doors/commands/frunk open, close frunk_open / frunk_close
Lights and horn commands/honk-flash flash, honk-and-flash lights_flash, honk_horn
Wake commands/wake-sleep wake (a Lucid cannot be sent to sleep) wakeup_vehicle

How they behave:

  • Only commands wake the car. If the last poll saw the car asleep (any sleep or cloud power state, the same rule the poller reports), the command wakes it first, waits a few seconds, then sends. Polling still never wakes it.
  • Sent once. Nothing is retried. A retried unlock or trunk is a second one if the first landed and only its answer was lost, so a failure comes back as an error and the decision is yours. A command not answered within 60 seconds, counting any login and wake it needed, is reported as such; check the car before sending it again. One that waited out the 60 seconds behind a poll was never sent, and says so.
  • Errors are short. Rate limits, rejected sessions and refusals from the car all come back as a CarConnectivity CommandError naming the command and Lucid's reason.
  • Same session, same rate limit. Commands use the poller's login and count against the same per-account allowance. A successful one triggers an early poll so the model shows the result.
  • A climatization temperature in Fahrenheit is converted; anything outside 10 to 35 °C is refused as a probable unit mistake.

Session lifetime — read this if you run it long

interval is how often the car is polled, minimum 60 s. driving_interval is used instead while a car is driving or about to be, minimum 15 s, defaulting to interval so nothing changes unless you ask. A minute is plenty for a car on a driveway and too coarse for one moving: at 60 s a drive is a handful of points with straight lines between them. Driving is a small share of any day, so the extra requests are few.

Both are the spacing between polls, not the pause after one. A fetch of a sleeping car returns in about a tenth of a second, but Lucid has to reach a car that is awake and driving, and that fetch takes on the order of fifteen seconds — so waiting the full interval after it made a 15 s setting a 31 s cycle. The wait is the interval less however long the fetch took, and the fetch time is logged at debug level if you want to see it.

One account, one client. Lucid rate-limits per account, not per connection, and it says nothing useful when it does: RESOURCE_EXHAUSTED with an empty body, no quota and no retry-after. Running a second logger against the same credentials — another CarConnectivity instance, a Home Assistant integration, a bridge of your own — competes for the same allowance, and the refusals arrive mid-drive when both are polling hardest. When one does arrive the connector waits 5 s, then 10, 20, 40 and so on to a 15-minute ceiling, and drops back to 5 s as soon as a poll succeeds.

A Lucid session's bearer token lasts five minutes and the server enforces that to the second. The connector refreshes only when under 60 s remain, never on every poll: the refresh endpoint is rate-limited, back-to-back refreshes return the same session anyway, and a client that refreshed per poll was throttled thousands of times before this was measured. Keep interval under 240 s or raise the refresh margin.

Metadata

Release files for carconnectivity-connector-lucid 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for carconnectivity-connector-lucid 0.2.0
File Size Uploaded Provenance Actions
carconnectivity_connector_lucid-0.2.0.tar.gz 53.3 kB With provenance Details for carconnectivity_connector_lucid-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for carconnectivity-connector-lucid 0.2.0
File Interpreter ABI Platform Actions
carconnectivity_connector_lucid-0.2.0-py3-none-any.whl Python 3 none any Details for carconnectivity_connector_lucid-0.2.0-py3-none-any.whl

Total release size: 81.1 kB

Release files / carconnectivity_connector_lucid-0.2.0.tar.gz

Download URL carconnectivity_connector_lucid-0.2.0.tar.gz
Size 53.3 kB
Tags Source
SHA-256 checksum
How to use checksums
89da8a24c739036b83c705bd77d2303655e65c08886fe806a94a9220e6c34ecf
BLAKE2b-256 checksum
How to use checksums
a6e5f0adc57073033642da8971c5b41a37107228a9a338b3868992e044f3bc05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / carconnectivity_connector_lucid-0.2.0-py3-none-any.whl

Download URL carconnectivity_connector_lucid-0.2.0-py3-none-any.whl
Size 27.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bf1195b1b6b5465223567eaa99920fed67a39fc5f73fd95cd98fa914c9ada689
BLAKE2b-256 checksum
How to use checksums
ff255b4f891d20e1bcf6bab467d2c4f96b7f500babf79db4c5f951a67285d3ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Security for carconnectivity-connector-lucid 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for carconnectivity_connector_lucid-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page