Skip to content

Two Factor Authentication

mrlt8 edited this page May 6, 2024 · 7 revisions

Important

As of April 2024, two-factor/multi-factor authentication has been deprecated as due to changes in the authentication API (#1163). Please switch to the Wyze API Key/ID method listed below.

Two-factor authentication is supported and will be automatically detected. However, there are some additional steps you need to follow to enter your verification code.

Optional: If you have multiple two-factor authentication options configured for your Wyze account, you can use the MFA_TYPE option to specify the desired verification method for the bridge. The available options are:

  • Email
  • PrimaryPhone
  • TotpVerificationCode

Wyze API Key/ID

Tip

Starting with v2.3.0, two-factor authentication can be skipped entirely by setting the API_ID and API_KEY.

environment:
    - [email protected]
    - WYZE_PASSWORD=myPassword
    - API_ID=My-Unique-KeyID-From-WYZE
    - API_KEY=MySecretApiKeyFromWyze

See the official support page for generating your key and ID: https://support.wyze.com/hc/en-us/articles/16129834216731

Caution

The key and ID are unique to a single account, so you will need to generate a new set for each account.

WebUI

Note

Starting with v1.8.7, visiting the WebUI should give you a form where you can submit your 2FA code.

2fa

Auto generate a TOTP

You can have the bridge auto generate and enter a Time-based One-Time Password (TOTP) by setting the TOTP_KEY in your docker-compose.yml with the code from the Wyze App:

environment:
    - TOTP_KEY=MYSECRETKEY12345

This can also be done by adding the secret key to the file /tokens/totp on standard installs or /config/wyze-bridge/totp for Home Assistant installs. You will need to create the file if it doesn't exist and mount it if necessary.

Docker

  • Echo the verification code directly to /tokens/mfa_token.txt by opening a second terminal window and using:

    docker exec -it wyze-bridge sh -c 'echo "123456" > /tokens/mfa_token.txt'
  • Mount /tokens/ locally and add your verification code to a file named mfa_token.txt:

    volumes:
        - ./tokens:/tokens/

Home Assistant

Add your code to the text file: /config/wyze-bridge/mfa_token.txt.

Portainer

Use the console to echo your code to the container:

echo "123456" > /tokens/mfa_token.txt