Skip to content

Commit

Permalink
Add description how to extract & decrypt token manually
Browse files Browse the repository at this point in the history
  • Loading branch information
domibarton committed Jan 20, 2019
1 parent 5e5f129 commit 26bbcaa
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/discovery.rst
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,29 @@ to the tool with ``--password <password>``.
Token: 476e6b70343055483XXX
MAC: 28:6C:07:XX:XX:XX
Extracting tokens manually
--------------------------

Run the following SQLite command:

.. code-block:: bash
sqlite3 <path of *_mihome.sqlite database> "select ZNAME,ZLOCALIP,ZTOKEN from ZDEVICE"
You should get a list which looks like this:

.. code-block:: text
Device 1|x.x.x.x|0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
Device 2|x.x.x.x|0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
Device 3|x.x.x.x|0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
These are your device names, IP addresses and tokens. However, the tokens are encrypted and you need to decrypt them.
The command for decrypting the token manually is:

.. code-block:: bash
echo '0: <YOUR 32 CHARACTER TOKEN>' | xxd -r -p | openssl enc -d -aes-128-ecb -nopad -nosalt -K 00000000000000000000000000000000
Environment variables for command-line tools
============================================
Expand Down

0 comments on commit 26bbcaa

Please sign in to comment.