Home Assistant Automations

Amazon garage delivery might need MyQ.
Indeed it does. But now they charge for it (unless it’s on your “Amazon Day”) and my garage is in the back of the house down a long road easement, so I just got calls for every delivery anyway asking where the garage was lol.
 
Indeed it does. But now they charge for it (unless it’s on your “Amazon Day”) and my garage is in the back of the house down a long road easement, so I just got calls for every delivery anyway asking where the garage was lol.
Yes and no. You can designate a garage delivery day for something critical at no charge
 
@borski I haven't dug too far into this myself, but did you guys only reverse engineered the gRPC calls (of course they're using protobuf lol)?

Did you happen to dig into their web socket telemetry APIs? I _assume_ their not polling protobuf stuff and have some form of a web socket open for live telemetry data, but could be wrong.

Also, given I've wondered this for a while now, but do they have a "garage" like service providing a list of vehicles for a profile?
 
@borski I haven't dug too far into this myself, but did you guys only reverse engineered the gRPC calls (of course they're using protobuf lol)?
Yes.

Did you happen to dig into their web socket telemetry APIs? I _assume_ they’re not polling protobuf stuff and have some form of a web socket open for live telemetry data, but could be wrong.
Not sure I know what you mean.

Also, given I've wondered this for a while now, but do they have a "garage" like service providing a list of vehicles for a profile?
Yeah there’s a user and each user can have multiple vehicles.
 
Yeah there’s a user and each user can have multiple vehicles.
Ah, yeah I didn’t see any fields linking out to multiple vehicles from the profile definition, so I assumed there might be a missing API call to get all of the associated VINs.


(Python isn’t my primary language 😅)

I think I see it here: https://github.com/nshp/python-luci...4fb1482d14d09191/lucidmotors/__init__.py#L379
 
Last edited:
Did you guys reverse engineer any of their wss:// calls? I assume they have websocket calls as well for real time vehicle telemetry data?
We were only looking at calls out from the mobile apps, not from the vehicle itself. The vehicle, like Teslas, only communicates through an OpenVPN tunnel, so external sniffing doesn’t tell us anything. I have no idea what you might be able to find if you hooked up to the car’s Ethernet jack. Being in a lease, I’m not looking to explore that part myself. Definitely violates the lease terms.
 
We were only looking at calls out from the mobile apps, not from the vehicle itself. The vehicle, like Teslas, only communicates through an OpenVPN tunnel, so external sniffing doesn’t tell us anything. I have no idea what you might be able to find if you hooked up to the car’s Ethernet jack. Being in a lease, I’m not looking to explore that part myself. Definitely violates the lease terms.
Oh no, I’m definitely referencing the mobile app. It would be quite inefficient and silly for them to hit these gRPC endpoints in a polling manner in the app. I expect the majority of these calls to be the one off calls versus the primary drivers for vehicle telemetry in the app (live data). If they are the primary drivers and they are polling the endpoints — woof.

I’d also expect vehicle commands + command status updates to work the same way with a one off request and a live telemetry response over a websocket like system (hence how the app holds a state during a command and updates the UI).
 
Oh no, I’m definitely referencing the mobile app. It would be quite inefficient and silly for them to hit these gRPC endpoints in a polling manner in the app. I expect the majority of these calls to be the one off calls versus the primary drivers for vehicle telemetry in the app (live data). If they are the primary drivers and they are polling the endpoints — woof.

I’d also expect vehicle commands + command status updates to work the same way with a one off request and a live telemetry response over a websocket like system (hence how the app holds a state during a command and updates the UI).
Oh, this app is far less fancy than you think. It is just polling as far as we can tell. That’s part of the reason why things are so slow. We’re actually able to send commands noticeably faster than the mobile app for example, because we just fire off a “wake up” request and e.g. an “unlock doors” request without waiting for the wake up to complete. The app sits there polling until the car is awake before it lets you do anything. There really isn’t any live telemetry in the app either, it gets its status by polling the same endpoint.

The exception to all of the above, and something we do not have support for currently, is that Lucid fires off Firebase push notifications for some things, triggering the app to refresh.
 
Oh, this app is far less fancy than you think. It is just polling as far as we can tell. That’s part of the reason why things are so slow. We’re actually able to send commands noticeably faster than the mobile app for example, because we just fire off a “wake up” request and e.g. an “unlock doors” request without waiting for the wake up to complete. The app sits there polling until the car is awake before it lets you do anything. There really isn’t any live telemetry in the app either, it gets its status by polling the same endpoint.

The exception to all of the above, and something we do not have support for currently, is that Lucid fires off Firebase push notifications for some things, triggering the app to refresh.
Yeah, I opened up a proxyman session just to see what I could initially see without needing any protobuff definitions in play. Top of the list was launch darkly and firebase tied items (both have their own forms of push/polling/websocket like integrations). HereMaps and some other miscellaneous stuff (GCP stuff).

I was contemplating using Burp (for fun) to see if there were any web socket stuff -- this has just been at the bottom of my best use of time list (https://github.com/nccgroup/wssip).

This is beyond disappointing to hear :(.

I guess the silent push notifications are the bridge for the lack of live telemetry data with the car (a "fake" web socket in essence to signal event changes).

Personally, I was already pretty disappointed they went down the Flutter route -- this is just another shot in the direction of "why are they working on widgets when they should be improving stack responsiveness".

FYI: This does give me confidence that my past 1-2 years of work is going to blow the Lucid app out of the water 😏 in regards to EV mobile app competitiveness.
 
Last edited:
Yeah, I opened up a proxyman session just to see what I could initially see without needing any protobuff definitions in play. Top of the list was launch darkly and firebase tied items (both have their own forms of push/polling/websocket like integrations). HereMaps and some other miscellaneous stuff (GCP stuff).

I was contemplating using Burp (for fun) to see if there were any web socket stuff -- this has just been at the bottom of my best use of time list (https://github.com/nccgroup/wssip).

This is beyond disappointing to hear :(.

I guess the silent push notifications are the bridge for the lack of live telemetry data with the car (a "fake" web socket in essence to signal event changes).

Personally, I was already pretty disappointed they went down the Flutter route -- this is just another shot in the direction of "why are they working on widgets when they should be improving stack responsiveness".

FYI: This does give me confidence that my past 1-2 years of work is going to blow the Lucid app out of the water 😏 in regards to EV mobile app competitiveness.
My understanding is that native apps are in the works. Lucid is still paying down a ton of tech debt from their early days. And the mobile app is yet another example of that.
 
Hey all, for those who don’t know, @segbrk and I reversed the Lucid Motors mobile API, and you can find the Python bindings for that here: https://github.com/nshp/python-lucidmotors

Pary of the reason we reversed it (other than it’s fun and we don’t know how not to open locked doors) was to build a Home Assistant integration, which is now fully featured and you can find here: https://github.com/borski/ha-lucidmotors

It’s super easy to install the HA integration through HACS, as explained in the link above - if you don’t have Home Assistant, it’s a fantastic tool that is trivial to set up and will handle all of your home automation, allowing you to do things you’ve never even considered doing before.

For example, my bathroom fan turns on whenever the humidity is above 60% automatically, and turns off when it’s at a reasonable humidity level - that is something I accomplished with a $3 temperature/humidity sensor that hooked right up to home assistant with zero lines of code.

If you are adept with the terminal, there are a myriad number of ways to install Home Assistant.

If you are not, and don’t want to learn, that’s totally fine! Even the most Luddite of us can set up Home Assistant Green - it’s a little $99 box you plug in, and is entirely plug-and-play, and comes with HA preinstalled. It’s really super duper easy. Seriously, here’s the 4-step tutorial.

If you are fancy and have any Zigbee or Thread devices, you can add on a SkyConnect for $35. If you don’t know what Zigbee or Thread is, don’t worry about it for now, but the gist is they are wireless local communication protocols for smart home devices; HA cannot hear them by default, but by buying this “USB key” it can hear those radio waves and interact with those home devices.

Anyway, this thread is meant to be for people to share their automations, useful ways they’ve set up the Lucid integration for their home, and so on. If enough people use it, it may become its own subforum, but for now this is fine. Have fun!
How can I add Lucid Integration to HA?
 
Totally gonna dive down the ha rabbit hole!! This looks too fun!
 
Just installed my first RATGDO and it's working flawlessly within Apple HomeKit:

The HA integration feels like a bit deeper water. Is there a known way to have HomeKit deliver the goods (i.e. The door automatically opens when the Lucid Arrives?) or does this need to go through the quasi-coding process via HACS/HA/etc?

Would really love the simplicity of having a Geofenced solution that "just works" although it's fun to learn some new skills.
 
Just installed my first RATGDO and it's working flawlessly within Apple HomeKit:

The HA integration feels like a bit deeper water. Is there a known way to have HomeKit deliver the goods (i.e. The door automatically opens when the Lucid Arrives?) or does this need to go through the quasi-coding process via HACS/HA/etc?

Would really love the simplicity of having a Geofenced solution that "just works" although it's fun to learn some new skills.
You can use iOS Shortcuts to create some simple automations with things iOS knows about, like maybe… “if I arrive at home, and I’m connected to Lucid bluetooth, open the garage door.” Still the same level of quasi programming, but with less setup?
If you do go that route I’d be interested to see what you come up with. I always seem to hit a wall where something isn’t possible with iOS Shortcuts.
 
You can use iOS Shortcuts to create some simple automations with things iOS knows about, like maybe… “if I arrive at home, and I’m connected to Lucid bluetooth, open the garage door.” Still the same level of quasi programming, but with less setup?
If you do go that route I’d be interested to see what you come up with. I always seem to hit a wall where something isn’t possible with iOS Shortcuts.
Yeah, this was what I was gonna say - check out the shortcuts app. And please post what you do!
 
This is awesome. I've been looking for a Lucid HA integration periodically. This is better than I had hoped. I also appreciate the recommendation for the RATGDO. I've been fuming since the MyQ integration was shut down. Time to start tinkering again! Thanks @borski and @segbrk!
 
I got an automation working via CarPlay and HomeAssistant.


It doesn’t automatically trigger by geofence yet, but I’ll continue to try stumbling forward as an HA Newbie.
IMG_0702.webp
IMG_0702.webp
IMG_0702.webp
 
Back
Top