tesla-local-control / tesla-local-control-addon

Control your Tesla locally from HomeAssistant
Apache License 2.0
21 stars 2 forks source link

[Request] MQTT entity "is ready" / backlog of commands #28

Closed raphmur closed 2 months ago

raphmur commented 3 months ago

We can spam the MQTT buttons as frequently as we want and then the loop will progressively process the mqtt messages...

My automation has wait times of 30 sec after each button press, but sometimes (ex. lower than 5a charge request) it is not sufficient and the mqtt messages start accumulating over time.

I see three options:

What do you think?

raphmur commented 3 months ago

In addition, is there a way to show the backlog of messages not yet processed?

iainbullock commented 3 months ago

Let me have a think about it. However my initial thought is this.

If the BLE presence scanning can be done in a parallel thread (I'm not sure where we are with this; there have been some reports it doesn't work, but maybe it does). We could set QOS to 0 instead of 1, and stop using the durable client session options in mosquitto_sub, and have it time out using the -W option.

It would stop listening after the timeout and when the loop restarts any unread messages would be dropped

raphmur commented 2 months ago

Closing for now. The simple error parsing works. Will re-open when it becomes too irritating