tesla-local-control / tesla_ble_mqtt_core

Core content for the tesla_ble tools
Apache License 2.0
2 stars 2 forks source link

Any potential to "read state" via bluetooth? #115

Open m-chandler opened 2 months ago

m-chandler commented 2 months ago

Thank you for setting this up it's amazing. The Fleet API was cumbersome to set up, then I realised the API usage limits...

I'm resurrecting my solar charging automation with this solution, and it's working great so far.

Something I'd like, and I don't know if it's even possible purely via BLE is the ability to read if the car is plugged in, and whether or not it's charging. Otherwise I probably need to disable my automation overnight (I assume constantly trying to stop the charger will keep the car awake?). I know I could get the read-only state via the Fleet API... I just need to set this up for a couple of people, trying to keep it simple :-D.

m-chandler commented 2 months ago

I did some DYOR and realised it's a limitation of the CLI tool. https://github.com/teslamotors/vehicle-command/issues/52

I hope they add this... would be perfect.

iainbullock commented 2 months ago

Agreed. If it becomes available I will add the functionality. Until then we'll have to use both BLE and Fleet API. At least we can now change the charge current as often as we like.

raphmur commented 2 months ago

Reopening this to track your request.

When we send a BLE command, somewhat the car answers:

  1. no answer if command succeeded
  2. answer Failed to execute ... if command sent but could not be executed --> car is awake, but for some reason, could not execute. We did not yet look at all the messages...
  3. answer from tesla-control when failing to establish a connection --> car may be too far, asleep, or issue with bluetooth device

I see hacks around this:

For my automation, I have set two key rules:

Quite complex, but I can give you my .yaml automation & variables if you want --> Maybe open another issue

m-chandler commented 2 months ago

I'm yet to go digging to see what information this actually returns, but there's been a commit last week to get vehicle info via BLE.

https://github.com/teslamotors/vehicle-command/commit/05bc5dd8d0649b4ccb45a765b9127d06f1050a6f

It might just return boring stuff, lock / closure state (judging by the models in the commit).

raphmur commented 1 month ago

Linking to this: https://github.com/tesla-local-control/tesla_ble_mqtt_core/issues/25