tesla-local-control / tesla_ble_mqtt_core

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

Send a wake command after the first failure of sending a (non-wake) command #119

Closed raphmur closed 4 days ago

raphmur commented 1 week ago

See https://github.com/tesla-local-control/tesla_ble_mqtt_docker/discussions/48

I think it would be useful for other scenarios. For example in HA cards with entities to send commands it is currently necessary to either manually wake the car first or have some additional automation to send a wake command first

raphmur commented 1 week ago

As per comments from https://github.com/tesla-local-control/tesla-local-control-addon/issues/104 I suggest using the following messages as triggers:

Error: failed to find BLE beacon
Error: context deadline exceeded
Error: ble: failed to enumerate device services: ATT request failed: input channel closed: io: read/write on closed pipe
Error: failed to find BLE beacon for XXX (XXX): can't dial: can't dial: connection canceled

Step 1 of fix (quick and really dirty): Bruteforce wake once whenever this message is seen

Step 2 of fix (better): Then I will try to launch body-controller-state once and see if the car is actually awake. Then: