pySwitchbot icon indicating copy to clipboard operation
pySwitchbot copied to clipboard

Can you please explain it better?

Open fangoward opened this issue 2 years ago • 3 comments

I'm trying to do the configurantion manually for the Switchbot lock but I can't undestand anything I'm suposed to do.

The READ ME is written for people that understand. Explain better, with steps, please.

Where should I put the scritpt? I tried everywhere and the answer from the terminal is the same "No such file or directory".

fangoward avatar Apr 19 '23 11:04 fangoward

I wish I could help but am in the same boat. I get errors along the lines of: line 5, in from switchbot import SwitchbotLock ModuleNotFoundError: No module named 'switchbot'

emkayg avatar Apr 28 '25 02:04 emkayg

Yes that bad - you need follow these steps to be able to run that script (expectation are you are inside root dir of downloaded code)

#enable virtual python environment (do it every time to run script) python -m venv venv source venv/bin/activate

#install dependencies pip install -r requirements.txt

#This will setup switchbot module python3 ./setup.py build python3 ./setup.py install

Now you are ready to run ./scripts/get_encryption_key.py MAC_of_your_lock email@account_on_switchbotapp

(then requested to get password - if not password set - go to phone switchbot app and look to profile details)

kaaduu avatar Jul 03 '25 10:07 kaaduu

@kaaduu You do not need to run python -m venv venv every time to run the script. It creates a venv folder once, as long as you don't move or delete it. For Windows, run venv\Scripts\activate to activate the virtual environment. For linux, run source venv/bin/activate.

Next, just install the module with pip, instead of building it manually with setup.py:

pip install PySwitchbot

Next, download or copy-paste the scripts/get_encryption_key.py file and run it while venv is activated.

Teraskull avatar Jul 22 '25 21:07 Teraskull