You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-4Lines changed: 13 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -183,10 +183,14 @@ optional arguments:
183
183
-D, --debug debug mode
184
184
-V, --version show program's version number and exit
185
185
```
186
-
The default action is to try to retrieve model information from the controller files on your computer. I don't recommend this. the best way to use it, is to run it as follows:
186
+
The default action is to try to retrieve model information from the controller files on your computer. I don't recommend this, the best way to use it, is to run it as follows:
Where `192.168.x.x:8443` is the ip address and port of your UniFi controller (no login or password required).
191
+
189
192
This will retrieve the javascript from your controller, extract the model information from it, ask you some easy questions, and finally update the `models.json` file.
193
+
190
194
It takes a while to retrieve the javascript, as it's huge. If you want to run it multiple times without downloading the javascript all the time, add the `-D` option, it will be more verbose, but it will store the javascript locally in a temporary directory and doesn't delete it. The next time you run with the `-D` option, the local files are loaded, so it's fast. Run without the `-D` if you want to download again (new controller release or something).
191
195
192
196
When new devices are found in the download, you need to answer the questions, the defaults are usually correct - **BUT read them carefully - they may not be!** if you make a mistake, just hit `^C` and run again.
@@ -195,10 +199,15 @@ One crucial question is:
195
199
```
196
200
Do you want to add the full Unifi data to the database (recommended)?
197
201
```
198
-
This adds the full data from the controller download to the models.json database. When you do this, it overrides all the answers you just gave, and allows`unifi.py` to read the port layout correctly from the controller configuration (so the ports on the devices are drawn with the correct spacing). This is a good thing!
199
-
Finally save the updated file `Do you want to overwrite the models.json file?`, there is no default answer, you have to enter `y` to update the file.
202
+
This adds the full data from the controller download to the `models.json` database. When you do this, it overrides all the default entries you just gave, and allows`unifi.py` to read the port layout correctly from the controller configuration (so the ports on the devices are drawn with the correct spacing). This is a good thing!
203
+
204
+
The supplied `models.json` file has all devices and unifi data in it (including beta devices) as of July 2019 (Controller Version 5.11.31).
205
+
206
+
Finally save the updated file `Do you want to overwrite the models.json file?`, there is no default answer, you have to enter `y` to update the file. The previos models.json file will be saved as a backup you can restore in case anything goes wrong.
207
+
208
+
When you have updaded the `models.json` file, start (or restart) `unifi.py`, and it will load the new database. Any new devices should now be displayed properly...
200
209
201
-
When you have updaded the `models.json` file, start (or restart) `unifi.py`, and it will load the new database. Any new devices should not be displayed properly...
210
+
This utility is a WIP, so it might be a bit buggy. Works on my systems.
202
211
203
212
## controller.py
204
213
`controller.py` is a module that gives access to the unifi API, and can be used for simple REST access to unifi data. it's cobbled together from various sources on the web (thanks to the contributors), I just added to it, it's not my work as such.
0 commit comments