From 69184b70476031d1b4b4a13cfff9f9faf3852b3c Mon Sep 17 00:00:00 2001 From: Mark Huson Date: Thu, 24 Aug 2017 02:38:03 -0400 Subject: [PATCH] Update sensor.otp.markdown (#2990) * Update sensor.otp.markdown * Minor changes and add container name --- source/_components/sensor.otp.markdown | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source/_components/sensor.otp.markdown b/source/_components/sensor.otp.markdown index 9810cf0bc9f..2381fa180d7 100644 --- a/source/_components/sensor.otp.markdown +++ b/source/_components/sensor.otp.markdown @@ -34,11 +34,17 @@ Configuration variables: 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: ```shell -$ pip install pyotp -$ python -c 'import pyotp; print("Token: " + pyotp.random_base32())' +$ pip3 install pyotp +$ python3 -c 'import pyotp; print("Token:", pyotp.random_base32())' Token: IHEDPEBEVA2WVHB7 ``` +To run in a Docker container: + +```shell +$ docker exec -it home-assistant python -c 'import pyotp; print("Token:", pyotp.random_base32())' +Token: IHEDPEBEVA2WVHB7 +``` Copy and paste the token into your Home Assistant configuration and add it to your OTP generator. Verify that they generate the same code.