Open AdyRock opened 2 years ago
@KiraPC while running the script it should create an app that handles those authentication URLs and removes it after the script exits. While the script is running you can check in the /Applications
directory there should be switchbot URL handler.app
.
Yes,
I did a little bit of reverse engineering and found.
Anyway it doesnโt want works.
I also tried to pack an app with py2app that listen on url as yours.
It works if I call the app directly from the browser typing switchbot:// and works (I also started a listener for debugging) but not when is cognito to call the app.
Could you help me?
EDIT: after another test (whiteout changing anything) it worked. Anyway you need to fix the creation of the app because like as it now, it doesn't work
@donavanbecker I pushed an update to the branch mentioned earlier that adds support for macOS and Windows could you check it out? This might require updating
python3
to newer version because I had some problems with the default version provided by macOS.
Sorry @dsypniewski, been busy. sorry for not knowing much about python. Want to learn more about it, but how do I run the script? I have the zip downloaded and I tried to execute it using python3 switchbot_get_lock_key.py --web-auth XX:XX:XX:XX:XX:XX
but then I receive this:
Traceback (most recent call last):
File "/Users/xxxxxx/xxxxxxxxxxx/pySwitchbot-lock-key-script-web-auth/scripts/switchbot_get_lock_key.py", line 6, in <module>
import requests
ModuleNotFoundError: No module named 'requests'
@KiraPC Do you have any ideas on how this could be improved? This is my first time working with an app for Mac.
@donavanbecker Sorry for the delay but I've also been busy recently - the script is not standalone and needs the pySwitchbot and other libraries installed to work so you need to install the package using pip:
pip install git+https://github.com/dsypniewski/pySwitchbot.git@lock-key-script-web-auth
If pip
is not found or not working you might need to use pip3
instead.
This will also install the script as executable, so there should be no need to use the downloaded one.
No problems! and thanks @dsypniewski. I just get stuck here and receive this error when opening up the handler
Registering switchbot:// url handler
Opening auth page
Waiting for the auth response.
@donavanbecker Hmm, this error message is not very helpful but there was one thing that I could think of and I pushed an update, could you check if that fixes your problem?
@donavanbecker Hmm, this error message is not very helpful but there was one thing that I could think of and I pushed an update, could you check if that fixes your problem?
This was the same error i had.
I pushed here the standalone application to be installed manually.
Try it and let me now.
@KiraPC Do you have any ideas on how this could be improved? This is my first time working with an app for Mac.
@dsypniewski Check my repository. The code is basically equals to yours, but it is standalone.
@KiraPC when I run the commands, I get this:
The 'rumps' distribution was not found and is required by the application
@KiraPC when I run the commands, I get this:
The 'rumps' distribution was not found and is required by the application
Damn!
I stared from an old project, and I forget to remove a dependecy.
In setup.py file remove the "install_requires" line and check again if it compile.
I'm from my smartphone, tomorrow I'll fix on the repo.
still getting:
ImportError: No module named 'rumps'
No rush, I can wait till tomorrow.
still getting:
ImportError: No module named 'rumps'
No rush, I can wait till tomorrow.
Mmm, I'll test it on a virtual environment tomorrow.
@donavanbecker how about changes in my branch I mentioned earlier, does that work for you?
@donavanbecker fixed it. Should work now!
Sorry to interrupt your conversation but maybe you can help with this related issue: https://github.com/home-assistant/home-assistant.io/issues/25859
Sorry to interrupt your conversation but maybe you can help with this related issue: home-assistant/home-assistant.io#25859
Hello @federicotravaini I'm using the switchbot Lock too. It's working fine.
I read the 3rd you posted and seems strange.
Could you report your system? Are you using a BLE adapter?
Sorry to interrupt your conversation but maybe you can help with this related issue: home-assistant/home-assistant.io#25859
Hello @federicotravaini I'm using the switchbot Lock too. It's working fine.
I read the 3rd you posted and seems strange.
Could you report your system? Are you using a BLE adapter?
I am running HA in a VM on a Synology NAS DS920+. I have a BT usb adapter in the NAS that is in the basement (out of range) and an ESP32 bt proxy in the house, and a Shelly Plus with BT enabled (active mode). Everything works fine unless the BT lock that most of the times is not updated. Also, sometimes they became unavailable randomly and dont get back until I reload the switchbot integration.
I also had a switchbot HUB that I powered off and now back on cause didn't impact on the behaviour of the integration.
Will provide all the information you need.
Sorry to interrupt your conversation but maybe you can help with this related issue: home-assistant/home-assistant.io#25859
Hello @federicotravaini I'm using the switchbot Lock too. It's working fine. I read the 3rd you posted and seems strange. Could you report your system? Are you using a BLE adapter?
I am running HA in a VM on a Synology NAS DS920+. I have a BT usb adapter in the NAS that is in the basement (out of range) and an ESP32 bt proxy in the house, and a Shelly Plus with BT enabled (active mode). Everything works fine unless the BT lock that most of the times is not updated. Also, sometimes they became unavailable randomly and dont get back until I reload the switchbot integration.
I also had a switchbot HUB that I powered off and now back on cause didn't impact on the behaviour of the integration.
Will provide all the information you need.
Mmm. What firmware version is installed on the lock?
Pretty sure it's the latest one, I checked a couple of days ago. Now I not at home and I can't check since it requires BT connection.
Pretty sure it's the latest one, I checked a couple of days ago. Now I not at home and I can't check since it requires BT connection.
It is not so sure.
The firmware is not delivered to all users togethers.
If you don't have the v6.5, ask to the support, they will send you it.
Will check for sure tonight and let you know.
Now I am also using the web API to retrieve the door status (via the hub) and they work fine.
It's really weird, I hope it's not related to the ESP32...
Will check for sure tonight and let you know.
Now I am also using the web API to retrieve the door status (via the hub) and they work fine.
It's really weird, I hope it's not related to the ESP32...
I'm using a respberrypi 4pi with a usb doongle CSR and it works fine.
Pretty sure it's the latest one, I checked a couple of days ago. Now I not at home and I can't check since it requires BT connection.
It is not so sure.
The firmware is not delivered to all users togethers.
If you don't have the v6.5, ask to the support, they will send you it.
I have version 6.4 holy moly No update available Will ask support...
Pretty sure it's the latest one, I checked a couple of days ago. Now I not at home and I can't check since it requires BT connection.
It is not so sure.
The firmware is not delivered to all users togethers.
If you don't have the v6.5, ask to the support, they will send you it.
I have version 6.4 holy moly No update available Will ask support...
Yes, ask for the V6.5. it should fix the sends update status.
Comunque, italiano anche io! ๐
Pretty sure it's the latest one, I checked a couple of days ago. Now I not at home and I can't check since it requires BT connection.
It is not so sure.
The firmware is not delivered to all users togethers.
If you don't have the v6.5, ask to the support, they will send you it.
I have version 6.4 holy moly No update available Will ask support...
Yes, ask for the V6.5. it should fix the sends update status.
Comunque, italiano anche io! ๐
Ahah ottimo!
When I update I'll let you know if it fixed
@KiraPC, yours worked.
@dsypniewski, yours worked when I used @KiraPC "switchbot.app" in the Applications Folder, but when I deleted that and tried again with the switchbot Url handler it didn't work and got the same error.
FYI: I did have to right click and Open the "switchbot.app" before @dsypniewski script would recognize that it is installed.
@KiraPC, yours worked.
Great!. You could think to link the repository and install the macos app externally.
Pretty sure it's the latest one, I checked a couple of days ago. Now I not at home and I can't check since it requires BT connection.
It is not so sure. The firmware is not delivered to all users togethers. If you don't have the v6.5, ask to the support, they will send you it.
I have version 6.4 holy moly No update available Will ask support...
Yes, ask for the V6.5. it should fix the sends update status.
Comunque, italiano anche io! ๐
After a couple of days with V6.5 I can confirm it works way better than before. Still happens sometimes that the device goes offline and I just need to reload the integration.
Grazie per la dritta!
Current Situation
There is no BLE API documentation for the lock API except for the device id
Proposed Change
Add documentation for the Lock BLE API
Additional Context
It is desirable to integrate the lock into other home automation systems.