-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with "Optimistic" and MQTT Lock. The state in HA is not updated even if optimistic=True #22874
Comments
Hey there @home-assistant/core, mind taking a look at this issue as its been labeled with a integration ( |
@home-assistant/core |
@plapointe6 thanks for reporting. As you suspect it's an issue with optimistic mode (introduced by #19468), I'll push a fix soon. Just a question, why does your lock include a |
Thanks for getting on this. @emontnemery, you are right, the state topic is useless. I will fix this in the lock. |
@plapointe6 If you remove the |
Hi, I have the same problem, on 0.91.2 I add the fan in the UI (lovelace). Same behaviour when I set a |
I will test the #22899 fix soon and I will update with the results when it will be done. |
I'm confused as #22899 touches only mqtt/lock.py and I have the similar behaviour with mqtt/fan.py. |
@raomin it's not the same bug. Can you please open a separate issue for MQTT fan optimistic mode not working? |
just did: #22967 MQTT fan does not work in optimistic mode |
I tested the changes referenced in fix #22899 (lock.py) and I confirm that it solved the issue with MQTT Lock and optimistic flag. Thanks ! |
Home Assistant release with the issue:
0.91.1
Last working Home Assistant release :
Upgraded form a version a little older than the Lovelace-UI release ( < 0.86 )
Operating environment :
Official Docker image running on a Raspberry PI 3.
Component/platform:
https://www.home-assistant.io/components/mqtt/
Could be linked to Lovelace-UI, not sure ...
Description of problem:
I am using MQTT to communicate with a door lock. This lock register to the Home Assistant MQTT Discovery like this :
The lock have a simple function : when it wake up, the lock connect to the MQTT broker and check if the value of the state topic is LOCK or UNLOCK. If the state is UNLOCK, the door will be allowed to open and it will go to sleep again.
So, within Home Assistant, I can LOCK or UNLOCK the lock entity in the front-end, even when my lock is offline because I use the "optimistic" flag.
This worked fine until I updated to 0.91.1 from an older release (0.8?.?, before 0.86.0).
Now, with the same config, the state of my lock in home assistant stay to "UNLOCKED" even if I try do LOCK it from the front-end.
The MQTT command message is sent, but the state is not updated. Maybe it's an issue with the "optimistic" functionnality ?
Problem-relevant
configuration.yaml
entries :Traceback :
Here is the discovery related message and shortly after I am trying to LOCK the lock two times.
We see that the message is sent and no state topic message is replied (but it's normal, my lock is offline).
After these log, if I go to my_home_assistant_url/dev_state, I see that my lock is "UNLOCKED"
The text was updated successfully, but these errors were encountered: