Home Assistant Automations

borski

Grand Magistrate; Referral Code - Q1BTN5Y3
Moderator
Verified Owner
Joined
Nov 19, 2021
Messages
8,345
Reaction score
9,378
Location
Cupertino, CA
Cars
Air DE-P, ZR, 21"
DE Number
241
Referral Code
Q1BTN5Y3
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!
 
Sounds very cool! I'm not nearly as tech savvy as many here. But after reading this, I'm excited to see what some people do with connecting HA to their cars. If there's enough cool stuff, I might venture out of my comfort zone 🤣
 
I’ll kick it off - part of the reason I don’t care about anyone’s homelink woes anymore is because I no longer have to wait for Lucid to give me geolocated garage opening and closing.

I installed an Infinity Shield, after seeing people like it on this forum. It’s a completely offline tool that just replaces your single beam sensor with a multi-beam array, meaning any obstruction breaks the beam, not just the single line at the bottom. This is optional but made me more comfortable shutting the door automatically.

I used to use MyQ to control the door, but after they turned off API access because they’re proper asshats, I installed ratgdo for $45 in about five minutes instead. It’s infinitely better. Orders of magnitude better, seriously.

Because it’s local and there’s no cloud service, I not only get access to control the door in what feels like actual real-time with no wait, but I also get to see the obstruction and motion sensor status, in what seems like real time.

As a result, here are my automations (all of which I set up in the UI, without touching a single line of code). If you’ve got HA set up, I am happy to help build the automation for you, if the UI is confusing.

To automatically close the garage door six minutes after I leave (or whenever it’s left open for any reason):
YAML:
alias: Auto close garage door
description: ""
trigger:
  - platform: state
    entity_id:
      - binary_sensor.ratgdov2_1b599b_1b599b_obstruction
    from: null
    for:
      hours: 0
      minutes: 6
      seconds: 0
    to: "off"
  - platform: state
    entity_id:
      - binary_sensor.ratgdov2_1b599b_1b599b_motion
    from: null
    to: "off"
    for:
      hours: 0
      minutes: 6
      seconds: 0
  - platform: state
    entity_id:
      - cover.ratgdov2_1b599b_1b599b_door
    from: null
    to: open
    for:
      hours: 0
      minutes: 6
      seconds: 0
condition:
  - condition: and
    conditions:
      - condition: state
        entity_id: cover.ratgdov2_1b599b_1b599b_door
        state: open
        for:
          hours: 0
          minutes: 6
          seconds: 0
      - condition: state
        entity_id: binary_sensor.ratgdov2_1b599b_1b599b_motion
        state: "off"
        for:
          hours: 0
          minutes: 6
          seconds: 0
      - condition: state
        entity_id: binary_sensor.ratgdov2_1b599b_1b599b_obstruction
        state: "off"
        for:
          hours: 0
          minutes: 6
          seconds: 0
action:
  - device_id: 5bd3f28166bb4dffa429afdf09830d32
    domain: cover
    entity_id: d73cba0eb4d59525ea7a76e1e1dabfea
    type: close
mode: single

And to open the garage as I get home (which works literally flawlessly, 100% of the time being open by the time I drive up):

YAML:
alias: Auto open garage door (Borski)
description: ""
trigger:
  - platform: zone
    entity_id: device_tracker.lulu
    zone: zone.home
    event: enter
condition:
  - condition: state
    entity_id: cover.ratgdov2_1b599b_1b599b_door
    state: closed
action:
  - service: cover.open_cover
    metadata: {}
    data: {}
    target:
      entity_id: cover.ratgdov2_1b599b_1b599b_door
mode: single
 
Sounds very cool! I'm not nearly as tech savvy as many here. But after reading this, I'm excited to see what some people do with connecting HA to their cars. If there's enough cool stuff, I might venture out of my comfort zone 🤣
Buy an HA Green. Give yourself a chance. If you don’t find it easy, just return it!
 
I think the best simple "car feature" (as opposed to nerdy automation / statistics feature) we've gained from this is the ability to completely turn off exterior lights. Turns out the API can do it, the mobile app and in-car UI just don't have a button for it. So via this HA integration, we now have a button for it.

Also, I haven't done anything clever with it yet, but we have the ability to send a full route (multiple waypoints) to the car for navigation. I don't use the in-car nav often, but I imagine this could be useful for some of you.
 
I think the best simple "car feature" (as opposed to nerdy automation / statistics feature) we've gained from this is the ability to completely turn off exterior lights. Turns out the API can do it, the mobile app and in-car UI just don't have a button for it. So via this HA integration, we now have a button for it.

Also, I haven't done anything clever with it yet, but we have the ability to send a full route (multiple waypoints) to the car for navigation. I don't use the in-car nav often, but I imagine this could be useful for some of you.
I realize this is a dumb question but I have no experience with HA. So is there an app for HA that you use somehow to turn off the lights from your phone?
 
Buy an HA Green. Give yourself a chance. If you don’t find it easy, just return it!
So I'm going to buy this HA green to access features on the Lucid...done and ordered
 
I realize this is a dumb question but I have no experience with HA. So is there an app for HA that you use somehow to turn off the lights from your phone?
Correct - there's an HA app for iPhone and Android, it will connect to your HA remotely to access these features. The easiest path to this if you're not a techie is to pay for the Home Assistant Cloud service offered by HA's sponsor company Nabu Casa: https://www.nabucasa.com/ - otherwise you have to fiddle with things yourself to make remote access (outside of your house / your own wifi network) work properly. The cloud service takes care of that for you, all you have to do is sign in.
 
I’ll kick it off - part of the reason I don’t care about anyone’s homelink woes anymore is because I no longer have to wait for Lucid to give me geolocated garage opening and closing.

I installed an Infinity Shield, after seeing people like it on this forum. It’s a completely offline tool that just replaces your single beam sensor with a multi-beam array, meaning any obstruction breaks the beam, not just the single line at the bottom. This is optional but made me more comfortable shutting the door automatically.

I used to use MyQ to control the door, but after they turned off API access because they’re proper asshats, I installed ratgdo for $45 in about five minutes instead. It’s infinitely better. Orders of magnitude better, seriously.

Because it’s local and there’s no cloud service, I not only get access to control the door in what feels like actual real-time with no wait, but I also get to see the obstruction and motion sensor status, in what seems like real time.

As a result, here are my automations (all of which I set up in the UI, without touching a single line of code). If you’ve got HA set up, I am happy to help build the automation for you, if the UI is confusing.

For the garage door automation, do you need HA? Or can you just buy the ratgdo?
 
For the garage door automation, do you need HA? Or can you just buy the ratgdo?
You could certainly do it with just a ratgdo, but the easy path is to integrate ratgdo with HA. HA is the glue that holds all kinds of "smart" things together. Otherwise you'll have to do some DIY. Happy to help if you want to do that and have questions.
 
HA is awesome for those who haven’t used it. RATGDO is such an improvement over MyQ.

The Lucid API exposes lots of information. For example, here’s my latest EA charging curve attached.
 

Attachments

  • IMG_5527.webp
    IMG_5527.webp
    30.5 KB · Views: 127
Dumb question: can I use two ratdgo devices if I have two garage doors?

I currently have a fully-functional and debugged Hubitat installation with 58 Zwave, Lutron, and Zigbee devices and dozens of automations. You guys are slowly wearing me down toward plunging into another rabbit hole!
 
Last edited:
Dumb question: can I use two ratdgo devices if I have two garage doors?

I currently have a fully-functional and debugged Hubitat installation with 58 zwave and zigbee devices and dozens of automations. You guys are slowly wearing me down toward plunging into another rabbit hole!
You will need two RATGDO for two doors.
 
Another garage door control option that interfaces with HA.

 
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!
I have been playing with this for a while and it works great!

I am an avid HA user and plan several HA automations to give me data on the Lucid, such as, needs to be charged because I have trips out of the house planned for tomorrow or the temp will be very cold and I might need extra range, etc.
 
I'm also a Home Assistant user (via the very nice/easy HA Green device @borski mentions), and have been playing with this very cool Lucid interface he's created. It allows for SO much control and information, I'm excited to really start playing with it. Easy to do useful things, as one example, like send an alert to my phone (or talk to me over my Alexa) if it's 10pm, car isn't plugged in, and range left in battery is <100 miles. And frankly, i just love seeing the TONS of data that the API reports about my Lucid via my H.A. dashboard now.

In addition to all the cool Lucid stuff, my H.A. is now controlling and interfacing with: my 90-device Lutron RadioRa 2 lighting and shading system, our Simplisafe security system, 3 Ecobee thermostats, our Kaleidescape movie servers and players, 4 AppleTVs, 7 Sonos zones of audio, 6 Alexa devices, 7 Unifi Protect video cameras and doorbells, all of our iOS devices for people detection and location, and our Tesla Model 3 (in similar ways to @borski's API for Lucid). It's a pretty amazing system.
 
Dumb question: can I use two ratdgo devices if I have two garage doors?

I currently have a fully-functional and debugged Hubitat installation with 58 Zwave, Lutron, and Zigbee devices and dozens of automations. You guys are slowly wearing me down toward plunging into another rabbit hole!
Yes, trivially. Those same devices will all work in HA.
 
Another garage door control option that interfaces with HA.

This works the same way as MyQ did - uses a sensor on the door and a laser. Drawback is no info about proximity / motion sensor, and it relies on the cloud so it’s slower.
 
Been meaning to go HA for a while now, and this thread is making me dump my Smarthings setup right now.
 
You could certainly do it with just a ratgdo, but the easy path is to integrate ratgdo with HA. HA is the glue that holds all kinds of "smart" things together. Otherwise you'll have to do some DIY. Happy to help if you want to do that and have questions.
Amazon garage delivery might need MyQ.
 
Back
Top