Skip to content
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

possible night latch fix - lock pro #245

Closed
wants to merge 1 commit into from

Conversation

Michal4K
Copy link
Contributor

@Michal4K Michal4K commented Jul 23, 2024

After analyzing publicly posted lock pro adv data. I think I found the right bit indicating night latch.
But this needs to be tested by someone who actually have lock pro.

update pySwitchbot library in HomeAssistent from my fork
pip install --upgrade --no-deps --force-reinstall git+https://github.com/Michal4K/pySwitchbot@night_latch_lock_pro

Do not forget --no-deps, unless you want broke up your HA dependencies.
Then restart HA and reload switchbot integration.

So anyone feel free to test this and report back.

@funkyweb
Copy link

Hi,

I just tried it on my lock, sadly to no avail. Nothing positive or negative, just the same as before.
I tried what you suggested and even removed the lock and re-added it in Homeassistant.
My lock has firmware version V1.8, if that matters.

If you need someone for further testing, I would be happy to help.

@Michal4K
Copy link
Contributor Author

@funkyweb
Hi, first thanks for your help. Can you post your lock ADV data from HA Debug log?

In switchbot integration enable debug logging then make some action with your lock unlock or lock does not matter.
After that disable logging and somewhere at the end of the log file you will find line with mrf_data:
2024-07-25 20:44:42.184 DEBUG (MainThread) [switchbot.adv_parsers.lock] mfr_data: XXXXXXXXXXXX1f8200550000
You can mask your lock mac address with X, first 12 character like in my example.

Thanks

@funkyweb
Copy link

@Michal4K
Is this enough?

2024-07-25 19:37:52.967 DEBUG (MainThread) [switchbot.adv_parsers.lock] mfr_data: XXXXXXXXXXXX109200640000
2024-07-25 19:37:54.212 DEBUG (MainThread) [switchbot.adv_parsers.lock] mfr_data: XXXXXXXXXXXX118200640000
2024-07-25 19:38:02.094 DEBUG (MainThread) [switchbot.adv_parsers.lock] mfr_data: XXXXXXXXXXXX129a00640000
2024-07-25 19:38:03.837 DEBUG (MainThread) [switchbot.adv_parsers.lock] mfr_data: XXXXXXXXXXXX14b200640000

@Michal4K
Copy link
Contributor Author

@funkyweb
Did you have night latch enabled on your lock when you test this? Because if you have it enabled then i think the pro model no longer have this information in ADV.

@funkyweb
Copy link

funkyweb commented Jul 25, 2024

@Michal4K
Yes, i just checked again.
It's definitely enabled in the app and it pulls the latch when i tell it to open the door.
Here are some fresh mfr_data, just in case that bit does only appear when using the latch for some reason.

XXXXXXXXXXXX209a00640000
XXXXXXXXXXXX218a00640000
XXXXXXXXXXXX22b200640000
XXXXXXXXXXXX239200640000

@Michal4K
Copy link
Contributor Author

@funkyweb
They must remove it from ADV. I think the easiest way around this would be: making this feature manually configurable in Home Assistant. I will try make a pull request for this workaround next week.

For now you can update your pySwitchbot library from my repo to branch lock_pro_night_latch_enabled. I set nighlatch in adv there to be always true.
pip install --upgrade --no-deps --force-reinstall git+https://github.com/Michal4K/pySwitchbot@lock_pro_night_latch_enabled
Then restart HA and reload switchbot integration.

@funkyweb
Copy link

@Michal4K
It works perfectly using that workaround. Considering your idea just enables you to toggle between the two operating modes, it should not impact any existing users. That is, assuming the default is false. Here's hoping everyone else agrees.

Thank you very much, looking forward to seeing this in HA.

@boeserwolf
Copy link

@Michal4K Thank you so much for this workaround! Just bought the Lock Pro, and was about to return the device because of this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants