bretterer / home-assistant-rivian

Rivian (Unofficial) Integration for Home Assistant
Apache License 2.0
125 stars 20 forks source link

FR: Add control to integration #105

Open poldim opened 1 year ago

poldim commented 1 year ago

It would be great if it would be possible to initiate a charge with a given charge rate via the integration. As described here, I could then use HA to see when my solar production is above my home's use and send that excess power into the Rivian at a specified charge rate.

I aware that Rivian is currently limiting the vehicle/account to only two phones. For me, having HA as one of those is acceptable, although I think Rivian needs to increase this limit.

Sample automation: Set the charge rate to house_power - pv_power and start charging. It's likely that rate would either need to be rounded to the nearest 1kw or nearest setpoint.

bretterer commented 1 year ago

Hi @poldim

Thanks for the FR. Right now however, we're not wanting to add anything that communicates to the truck to handle control. There is a lot of security and safety concerns around that that we do not want to be liable for.

I am going to keep this open however, but it is not currently on our roadmap to handle.

ksheyman commented 11 months ago

Hey @bretterer I just found this issue. It seems like since this FR you added some ability to control the truck... but am I correct in understanding that it can only be done using Bluetooth from my HA machine? Meaning the truck would have to be at home, and in range of the server to work?

I get the hesitation to add control functionality via internet but I was hoping to use this integration to wake my truck when it is in the parking lot at work. It frequently takes me many, many attempts to wake the truck using the Rivian app and I often am unsuccessful in getting it to wake up and heat before it is time to leave. I was going to set a script to just keep trying until it wakes and then notify me when it does. Sounds like that won't be possible using this? Even JUST waking would be enough functionality, I wouldn't need any other controls since I can use the app once it is indeed awake.

Thank you for your time.

natekspencer commented 11 months ago

Hey @bretterer I just found this issue. It seems like since this FR you added some ability to control the truck... but am I correct in understanding that it can only be done using Bluetooth from my HA machine? Meaning the truck would have to be at home, and in range of the server to work?

I get the hesitation to add control functionality via internet but I was hoping to use this integration to wake my truck when it is in the parking lot at work. It frequently takes me many, many attempts to wake the truck using the Rivian app and I often am unsuccessful in getting it to wake up and heat before it is time to leave. I was going to set a script to just keep trying until it wakes and then notify me when it does. Sounds like that won't be possible using this? Even JUST waking would be enough functionality, I wouldn't need any other controls since I can use the app once it is indeed awake.

Thank you for your time.

The actual commands are run on the cloud (not Bluetooth), but to enable them, you have to fully pair your device with the vehicle which requires a one-time Bluetooth connection to set up. This is part of security mechanism that Rivian has implemented.

ksheyman commented 11 months ago

Hey @bretterer I just found this issue. It seems like since this FR you added some ability to control the truck... but am I correct in understanding that it can only be done using Bluetooth from my HA machine? Meaning the truck would have to be at home, and in range of the server to work? I get the hesitation to add control functionality via internet but I was hoping to use this integration to wake my truck when it is in the parking lot at work. It frequently takes me many, many attempts to wake the truck using the Rivian app and I often am unsuccessful in getting it to wake up and heat before it is time to leave. I was going to set a script to just keep trying until it wakes and then notify me when it does. Sounds like that won't be possible using this? Even JUST waking would be enough functionality, I wouldn't need any other controls since I can use the app once it is indeed awake. Thank you for your time.

The actual commands are run on the cloud (not Bluetooth), but to enable them, you have to fully pair your device with the vehicle which requires a one-time Bluetooth connection to set up. This is part of security mechanism that Rivian has implemented.

Oooh okay thanks a lot. I misunderstood the instructions! Appreciate it

ksheyman commented 11 months ago

Hey @bretterer I just found this issue. It seems like since this FR you added some ability to control the truck... but am I correct in understanding that it can only be done using Bluetooth from my HA machine? Meaning the truck would have to be at home, and in range of the server to work? I get the hesitation to add control functionality via internet but I was hoping to use this integration to wake my truck when it is in the parking lot at work. It frequently takes me many, many attempts to wake the truck using the Rivian app and I often am unsuccessful in getting it to wake up and heat before it is time to leave. I was going to set a script to just keep trying until it wakes and then notify me when it does. Sounds like that won't be possible using this? Even JUST waking would be enough functionality, I wouldn't need any other controls since I can use the app once it is indeed awake. Thank you for your time.

The actual commands are run on the cloud (not Bluetooth), but to enable them, you have to fully pair your device with the vehicle which requires a one-time Bluetooth connection to set up. This is part of security mechanism that Rivian has implemented.

Any tips for getting this to work? I could not get the vehicle to pair with HA, I even used a long active USB cable to take my HA machine's Bluetooth adapter all the way inside the truck. No matter what I do it fails to pair... I have BT set up correctly as I already use it to control several devices.

jrgutier commented 11 months ago

It was verified with HA on RPI, Macbook, and ESPHome BT Proxy. We didn't have a chance to fix a BT adapter on a virtual machine. I've just instructed others to get an ESP32 and set up a BT proxy if they have problems.

--

J.R. Gutierrez

On Thu, Dec 21, 2023 at 9:10 PM ksheyman @.***> wrote:

Hey @bretterer https://github.com/bretterer I just found this issue. It seems like since this FR you added some ability to control the truck... but am I correct in understanding that it can only be done using Bluetooth from my HA machine? Meaning the truck would have to be at home, and in range of the server to work? I get the hesitation to add control functionality via internet but I was hoping to use this integration to wake my truck when it is in the parking lot at work. It frequently takes me many, many attempts to wake the truck using the Rivian app and I often am unsuccessful in getting it to wake up and heat before it is time to leave. I was going to set a script to just keep trying until it wakes and then notify me when it does. Sounds like that won't be possible using this? Even JUST waking would be enough functionality, I wouldn't need any other controls since I can use the app once it is indeed awake. Thank you for your time.

The actual commands are run on the cloud (not Bluetooth), but to enable them, you have to fully pair your device with the vehicle which requires a one-time Bluetooth connection to set up. This is part of security mechanism that Rivian has implemented.

Any tips for getting this to work? I could not get the vehicle to pair with HA, I even used a long active USB cable to take my HA machine's Bluetooth adapter all the way inside the truck. No matter what I do it fails to pair... I have BT set up correctly as I already use it to control several devices.

— Reply to this email directly, view it on GitHub https://github.com/bretterer/home-assistant-rivian/issues/105#issuecomment-1867179571, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACTMO6O3WA2ZM7MADSQBV3YKT237AVCNFSM6AAAAAAZCOH7ASVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRXGE3TSNJXGE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

ksheyman commented 11 months ago

It was verified with HA on RPI, Macbook, and ESPHome BT Proxy. We didn't have a chance to fix a BT adapter on a virtual machine. I've just instructed others to get an ESP32 and set up a BT proxy if they have problems. -- J.R. Gutierrez On Thu, Dec 21, 2023 at 9:10 PM ksheyman @.> wrote: Hey @bretterer https://github.com/bretterer I just found this issue. It seems like since this FR you added some ability to control the truck... but am I correct in understanding that it can only be done using Bluetooth from my HA machine? Meaning the truck would have to be at home, and in range of the server to work? I get the hesitation to add control functionality via internet but I was hoping to use this integration to wake my truck when it is in the parking lot at work. It frequently takes me many, many attempts to wake the truck using the Rivian app and I often am unsuccessful in getting it to wake up and heat before it is time to leave. I was going to set a script to just keep trying until it wakes and then notify me when it does. Sounds like that won't be possible using this? Even JUST waking would be enough functionality, I wouldn't need any other controls since I can use the app once it is indeed awake. Thank you for your time. The actual commands are run on the cloud (not Bluetooth), but to enable them, you have to fully pair your device with the vehicle which requires a one-time Bluetooth connection to set up. This is part of security mechanism that Rivian has implemented. Any tips for getting this to work? I could not get the vehicle to pair with HA, I even used a long active USB cable to take my HA machine's Bluetooth adapter all the way inside the truck. No matter what I do it fails to pair... I have BT set up correctly as I already use it to control several devices. — Reply to this email directly, view it on GitHub <#105 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACTMO6O3WA2ZM7MADSQBV3YKT237AVCNFSM6AAAAAAZCOH7ASVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRXGE3TSNJXGE . You are receiving this because you are subscribed to this thread.Message ID: @.>

Alright thanks. I'll use the BT proxy option if I can't get it to work.

natekspencer commented 11 months ago

Also, it would be beneficial to enable debug logging to see where it gets in the process. Another thing of note, BT adapters have limited slots available for connections. If you have multiple devices already connecting via BT, it's possible they are taking up those slots and preventing a successful pairing. So it might be helpful to try disabling those other devices temporarily.

tmack8001 commented 11 months ago

Also to note. The BT connection for HA is only required during the initial key exchange, after that all commands are sent over WiFi over the public Internet to the Rivian cloud servers and not the truck directly