hsakoh / switchbot-mqtt

SwitchBot MQTT Home Assistant add-on
MIT License
55 stars 1 forks source link

Switchbot Lock state appears inversed in Home Assistant sensor #12

Closed PanMat closed 10 months ago

PanMat commented 10 months ago

Hi,

I'm running Home Assistant in supervised and recently installed SwitchBot-MQTT (version 1.0.7). It seems to be working fine and I am able to lock/unlock the door from the button sensors this add-on has created. But when the door is "locked" the mobile app for SwitchBot shows it as "locked", the MQTT payload received from SwitchBot-Mqtt shows "lockState = locked" but for some reasons the binary sensor this add-on created for "lockState" seems to show the opposite state i.e. "unlocked" in this case.

When I unlock the door from SwitchBot's mobile app, the MQTT payload shows "lockState= unlocked" but now Home Assistant sensors shows it as :locked".

Is this a bug or is there a setting that I am not using correctly?

hsakoh commented 10 months ago

Thank you for your feedback.

I fixed two bugs and released v1.0.8. There was a problem with the binary sensor's ON/OFF being reversed, and an issue where the Webhook payload was in all uppercase, preventing the values from being reflected in the binary sensor.

Could you please update and confirm that the issues are resolved?

PanMat commented 10 months ago

Yes now the lock state is shown correctly! Thanks for taking care of it!