2017-01-11 01:57:35 +01:00
|
|
|
Command line interface for python-broadlink
|
|
|
|
===========================================
|
|
|
|
|
2021-03-14 16:20:25 +01:00
|
|
|
This is a command line interface for the python-broadlink API.
|
2017-01-11 01:57:35 +01:00
|
|
|
|
|
|
|
|
|
|
|
Requirements
|
|
|
|
------------
|
2021-03-14 16:20:25 +01:00
|
|
|
You need to install the module first:
|
2017-01-11 01:57:35 +01:00
|
|
|
```
|
2021-03-14 16:20:25 +01:00
|
|
|
pip3 install broadlink
|
2017-01-11 01:57:35 +01:00
|
|
|
```
|
|
|
|
|
2018-08-31 07:43:42 +02:00
|
|
|
Installation
|
2017-01-11 01:57:35 +01:00
|
|
|
-----------
|
2021-03-14 16:20:25 +01:00
|
|
|
Download "broadlink_cli" and "broadlink_discovery".
|
2017-01-11 01:57:35 +01:00
|
|
|
|
|
|
|
|
|
|
|
Programs
|
|
|
|
--------
|
2021-03-14 16:20:25 +01:00
|
|
|
* broadlink_discovery: Discover Broadlink devices connected to the local network.
|
2017-01-11 01:57:35 +01:00
|
|
|
|
2021-03-14 16:20:25 +01:00
|
|
|
* broadlink_cli: Send commands and query the Broadlink device.
|
2017-01-11 01:57:35 +01:00
|
|
|
|
|
|
|
|
2021-03-14 16:20:25 +01:00
|
|
|
Device specification formats
|
2017-01-11 01:57:35 +01:00
|
|
|
----------------------------
|
|
|
|
|
|
|
|
Using separate parameters for each information:
|
|
|
|
```
|
|
|
|
broadlink_cli --type 0x2712 --host 1.1.1.1 --mac aaaaaaaaaa --temp
|
|
|
|
```
|
|
|
|
|
|
|
|
Using all parameters as a single argument:
|
|
|
|
```
|
|
|
|
broadlink_cli --device "0x2712 1.1.1.1 aaaaaaaaaa" --temp
|
|
|
|
```
|
|
|
|
|
|
|
|
Using file with parameters:
|
|
|
|
```
|
|
|
|
broadlink_cli --device @BEDROOM.device --temp
|
|
|
|
```
|
2021-03-14 16:20:25 +01:00
|
|
|
This is prefered as the configuration is stored in a file and you can change
|
|
|
|
it later to point to a different device.
|
2017-01-11 01:57:35 +01:00
|
|
|
|
2021-03-14 16:20:25 +01:00
|
|
|
Example usage
|
|
|
|
-------------
|
|
|
|
|
|
|
|
### Common commands
|
2017-01-11 01:57:35 +01:00
|
|
|
|
2021-03-14 16:20:25 +01:00
|
|
|
#### Join device to the Wi-Fi network
|
|
|
|
```
|
|
|
|
broadlink_cli --joinwifi SSID PASSWORD
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Discover devices connected to the local network
|
|
|
|
```
|
|
|
|
broadlink_discovery
|
|
|
|
```
|
|
|
|
|
|
|
|
### Universal remotes
|
|
|
|
|
|
|
|
#### Learn IR code and show at console
|
2017-01-11 01:57:35 +01:00
|
|
|
```
|
|
|
|
broadlink_cli --device @BEDROOM.device --learn
|
|
|
|
```
|
|
|
|
|
2021-03-14 16:20:25 +01:00
|
|
|
#### Learn RF code and show at console
|
|
|
|
```
|
|
|
|
broadlink_cli --device @BEDROOM.device --rfscanlearn
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Learn IR code and save to file
|
|
|
|
```
|
|
|
|
broadlink_cli --device @BEDROOM.device --learnfile LG-TV.power
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Learn RF code and save to file
|
|
|
|
```
|
|
|
|
broadlink_cli --device @BEDROOM.device --rfscanlearn --learnfile LG-TV.power
|
|
|
|
```
|
2017-01-11 01:57:35 +01:00
|
|
|
|
2021-03-14 16:20:25 +01:00
|
|
|
#### Send code
|
|
|
|
```
|
|
|
|
broadlink_cli --device @BEDROOM.device --send DATA
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Send code from file
|
2017-01-11 01:57:35 +01:00
|
|
|
```
|
|
|
|
broadlink_cli --device @BEDROOM.device --send @LG-TV.power
|
|
|
|
```
|
|
|
|
|
2021-03-14 16:20:25 +01:00
|
|
|
#### Check temperature
|
2017-01-11 01:57:35 +01:00
|
|
|
```
|
|
|
|
broadlink_cli --device @BEDROOM.device --temperature
|
|
|
|
```
|
2018-04-19 22:45:50 +02:00
|
|
|
|
2021-03-14 16:20:25 +01:00
|
|
|
#### Check humidity
|
2018-04-19 22:45:50 +02:00
|
|
|
```
|
2021-03-14 16:20:25 +01:00
|
|
|
broadlink_cli --device @BEDROOM.device --temperature
|
|
|
|
```
|
|
|
|
|
|
|
|
### Smart plugs
|
|
|
|
|
|
|
|
#### Turn on
|
|
|
|
```
|
|
|
|
broadlink_cli --device @BEDROOM.device --turnon
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Turn off
|
|
|
|
```
|
|
|
|
broadlink_cli --device @BEDROOM.device --turnoff
|
2018-04-19 22:45:50 +02:00
|
|
|
```
|
2020-03-04 22:27:55 +01:00
|
|
|
|
2021-03-14 16:20:25 +01:00
|
|
|
#### Turn on nightlight
|
|
|
|
```
|
|
|
|
broadlink_cli --device @BEDROOM.device --turnnlon
|
2020-03-04 22:27:55 +01:00
|
|
|
```
|
2021-03-14 16:20:25 +01:00
|
|
|
|
|
|
|
#### Turn off nightlight
|
|
|
|
```
|
|
|
|
broadlink_cli --device @BEDROOM.device --turnnloff
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Check power state
|
|
|
|
```
|
|
|
|
broadlink_cli --device @BEDROOM.device --check
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Check nightlight state
|
|
|
|
```
|
|
|
|
broadlink_cli --device @BEDROOM.device --checknl
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Check power consumption
|
|
|
|
```
|
|
|
|
broadlink_cli --device @BEDROOM.device --energy
|
2020-03-04 22:27:55 +01:00
|
|
|
```
|