Skip to content

Commit 8368509

Browse files
committed
Include detailed instructions for HA OS in TOOLS.md
1 parent a09420d commit 8368509

File tree

1 file changed

+54
-14
lines changed

1 file changed

+54
-14
lines changed

TOOLS.md

Lines changed: 54 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,60 @@
22
The command line tools bundled with zigpy-znp do not depend in any way on Home Assistant
33
and will work with any Texas Instruments radio previously used with ZHA or Zigbee2MQTT.
44

5+
6+
# Table of Contents
7+
- [Installation](#installation)
8+
* [In Home Assistant OS](#in-home-assistant-os)
9+
* [In other environments](#in-other-environments)
10+
+ [Installing Python 3.7 or above](#installing-python-37-or-above)
11+
- [Linux](#linux)
12+
- [macOS](#macos)
13+
- [Windows](#windows)
14+
+ [Creating a virtualenv (recommended)](#creating-a-virtualenv-recommended)
15+
+ [Installing zigpy-znp](#installing-zigpy-znp)
16+
- [Tools](#tools)
17+
* [Backup and restore](#backup-and-restore)
18+
+ [Network backup (beta)](#network-backup-beta)
19+
+ [NVRAM backup](#nvram-backup)
20+
* [NVRAM reset](#nvram-reset)
21+
* [Network formation](#network-formation)
22+
* [Network scan](#network-scan)
23+
* [Energy scan](#energy-scan)
24+
* [CC2531 tools](#cc2531-tools)
25+
+ [Network migration for coordinator upgrades](#network-migration-for-coordinator-upgrades)
26+
+ [Flash operations](#flash-operations)
27+
- [Flash read](#flash-read)
28+
- [Flash write](#flash-write)
29+
30+
531
# Installation
6-
## A note about Home Assistant
7-
While zigpy-znp is already installed within the Python environment used by Home Assistant
8-
with ZHA, getting exclusive access to the radio's serial port and shell access within the
9-
Docker container is not always simple. For this reason, the following installation
10-
instructions will help you setup just zigpy-znp on another computer. Feel free to skip
11-
them if you know your way around the Home Assistant OS Docker container.
12-
13-
## Installing Python 3.7 or above
14-
### Linux
32+
## In Home Assistant OS
33+
zigpy-znp is already installed by Home Assistant's ZHA component and is used to communicate
34+
with your radio. You only need to gain access to the correct Docker container and temporarily
35+
disable ZHA to run any of the tools:
36+
37+
1. Install [the SSH addon](https://github.com/home-assistant/addons/blob/master/ssh/DOCS.md).
38+
Once you are logged in, you will be presented with the Home Assistant CLI.
39+
2. Drop into a regular shell by running `login`.
40+
3. At the root shell, log into the main Home Assistant Docker container:
41+
```bash
42+
docker exec -it $(docker ps -f name=homeassistant -q) bash
43+
```
44+
45+
4. Since ZHA is still using your Zigbee radio, you must temporarily *disable* the ZHA
46+
integration before continuing. This is done with the three-dot dropdown menu in the
47+
"Integrations" section of the Home Assistant web UI.
48+
49+
## In other environments
50+
### Installing Python 3.7 or above
51+
#### Linux
1552
For Ubuntu 20.04:
1653

1754
```console
1855
$ sudo apt install python3 python3-virtulenv # ensure this is Python 3.7 or above
1956
```
2057

21-
### macOS
58+
#### macOS
2259
[Homebrew](https://brew.sh/) allows easy installation of recent Python releases.
2360

2461
```console
@@ -29,7 +66,7 @@ If you want to use virtualenv (see below), install it as well
2966
$ brew install virtualenv
3067
```
3168

32-
### Windows
69+
#### Windows
3370
Download the latest release of Python 3 from the [Python homepage](https://www.python.org/downloads/).
3471

3572
If you are using a zzh! or any other device with a CH340 USB-serial adapter, you may have
@@ -53,7 +90,7 @@ Run this:
5390
> py -3 -m zigpy_znp.tools.foo
5491
```
5592
56-
## Creating a virtualenv (recommended)
93+
### Creating a virtualenv (recommended)
5794
It is recommended you install Python packages within a virtualenv to prevent dependency
5895
conflicts. You will need to activate the virtualenv again if you close your terminal
5996
emulator.
@@ -73,7 +110,7 @@ For Windows:
73110
> venv\Scripts\activate.bat # for cmd.exe
74111
```
75112
76-
## Installing zigpy-znp
113+
### Installing zigpy-znp
77114
The latest stable release from the PyPI
78115
```console
79116
$ pip install zigpy-znp
@@ -121,6 +158,9 @@ For example, a network backup will allow you to migrate from a CC2531 with Z-Sta
121158
fully documented so you can fill out the appropriate information by hand to form a network
122159
if you are migrating from a non-Texas Instruments device.
123160

161+
To get ZHA to utilize your new radio, make sure to change the coordiantor's `path` in
162+
`/config/.storage/core.config_entries`.
163+
124164
### NVRAM backup
125165
In contrast to the high-level coordinator backup described above, an exhaustive, low-level
126166
NVRAM backup can be performed to clone your entire device state. The backed up data is
@@ -213,7 +253,7 @@ button closest to the antenna (the LED will turn red), or running one of the fol
213253
commands:
214254

215255
#### Flash read
216-
This read only the firmware. NVRAM regions are not accessible from the serial bootloader.
256+
This reads only the firmware. NVRAM regions are not accessible from the serial bootloader.
217257

218258
```console
219259
$ python -m zigpy_znp.tools.flash_read -o firmware.bin /dev/cu.usbmodem14101

0 commit comments

Comments
 (0)