We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb3bffd commit 69184b7Copy full SHA for 69184b7
source/_components/sensor.otp.markdown
@@ -34,11 +34,17 @@ Configuration variables:
34
A simple way to generate a `token` for a new sensor is to run this snippet of python code in your Home Assistant virtual environment:
35
36
```shell
37
-$ pip install pyotp
38
-$ python -c 'import pyotp; print("Token: " + pyotp.random_base32())'
+$ pip3 install pyotp
+$ python3 -c 'import pyotp; print("Token:", pyotp.random_base32())'
39
Token: IHEDPEBEVA2WVHB7
40
```
41
42
+To run in a Docker container:
43
+
44
+```shell
45
+$ docker exec -it home-assistant python -c 'import pyotp; print("Token:", pyotp.random_base32())'
46
+Token: IHEDPEBEVA2WVHB7
47
+```
48
Copy and paste the token into your Home Assistant configuration and add it to your OTP generator. Verify that they generate the same code.
49
50
<p class='note warning'>
0 commit comments