I’ve installed an integration for my car (BMW Connected Drive).
Via the integration, I can start the pre-conditioning of the car so it’s nice and warm when I step in.
Just like in the BMW mobile app, it takes a while between toggling the “pre-condition” switch and the car actually beginning to pre-condition.
I was wondering if there is a way to retrieve that the switch is busy being toggled, if you know what I mean?
The goal is to show that it is being toggled on/off before the entity reflects it being on/off. Right now, when I click the button in my dashboard to toggle the switch, the button’s reflecting the state as of it hasn’t been toggled. After some time, when the car “responded” back, the state changes and my icon/text/… in the button changes.
So I’m looking for a way to retrieve when the command to the switch was made until the enity shows it renewed state.
Don’t know if this all makes sense? Anyone with any experience on this? I’m guessing to look for something event-related? Don’t know how to start, though.
Here’s one approach, though I’m sure there are other good ones too.
Create a template switch (call it “BMW pre-condition”) and an input_boolean helper (call it “Target BMW pre-condition state”) and a timer (call it “BMW pre-condition timeout”).
For the template switch, the the “on” action should set the helper to true and turn the real BMW pre-condition switch on. It should also start the timer (perhaps for 10 seconds or so, depending on how long it normally takes the car to respond). The value_template should be set to reflect to real BMW pre-condition switch. And, as the most important part, the availability template should be true if the state of the input boolean and the real BMW pre-conditioning switch are the same. I.e. something like:
Finally, create an automation that has two triggers: the timer finishing and the real BMW pre-condition switch changing. On either trigger, the action is the same: set the input_boolean to whatever the current value of the real BMW switch.
Add the template switch to your dashboard where ever you had previously had the real BMW pre-conditioning switch.
So the idea here is that during the time between when you interact with the switch and when the car responds to the command, the template switch goes to unavailable, which gives you a visual indication that it is working. It returns to normal (available) and shows the correct state as soon as the car acknowledges or after the timer times out (perhaps there was a problem and you should try again).
You’ll notice I didn’t mention the turn off command for the template switch. That’s because I don’t know how your BMW integration works, and if it makes any sense to “turn off” pre-conditioning. If so, perhaps you can work out that part on your own.
This seems like a possible solution, indeed!
Problem is that all my configuration is done via UI, and it seems that this doesn’t provide the option to define an availability template.