ReneNulschDE / mbapi2020

Custom Component to integrate MercedesME devices into Home-Assistant
Other
152 stars 29 forks source link

Feature: add loading indicators to commands #104

Closed klejejs closed 1 year ago

klejejs commented 1 year ago

When I trigger lock/unlock or auxiliary heating, it is sometimes hard to know if I pressed the button or not. Would it be possible to add loading state and icon when the, e.g, unlock button has been pressed but the state has not been updated yet? This idea comes from my smart lock integration which does exactly that, it might be the case that the lock itself provides the loading state while Mercedes does not, but I don't think it would be hard to mimic that, would it?

P.S. Thank you for the great integration, I use it often and it is really convenient. Keep up the amazing work!

ReneNulschDE commented 1 year ago

thanks for this request. Unfortunately, this is not so easy to implement has the communication with the MB System is async and a implementation would be more complex. The diagnostic sensor "Car" has some attributes "lastcommand*". These attributes show the status of the last command. You can try to create your own sensor to show the status in the frontend. See template sensor in the HA-docs.

Nevertheless, I will add this to the list but please do not expect a fast implementation.

Thx Rene

klejejs commented 1 year ago

Thanks for the reply! I tried with a template sensor and it works for me as well though an API implementation would be better as it would integrate with the lock entity. One thing I noticed while tinkering with this was that the lock state often updates some time after the doors have been locked or unlocked. Can an update from API be somehow forced?

ReneNulschDE commented 1 year ago

The master branch contains an update to the lock. Now the status is_locking and is_unlocking is provided. (But for the first 30 seconds only after initiating). I will integrate this in one of the next releases.

Frontend Result (see icon changes): Screencast from 2023-01-24 10-39-51

klejejs commented 1 year ago

Thank you! This looks amazing.

ReneNulschDE commented 1 year ago

solved wit v0.8.1