From 2a537b6112329ad6fb19754c0e943e9a39c3a0a7 Mon Sep 17 00:00:00 2001 From: ozlb Date: Wed, 3 May 2023 23:48:20 +0200 Subject: [PATCH 1/3] Update README.md Check humidity parameter --- cli/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/README.md b/cli/README.md index 7b40b4cf..b7e48dc9 100644 --- a/cli/README.md +++ b/cli/README.md @@ -97,7 +97,7 @@ broadlink_cli --device @BEDROOM.device --temperature #### Check humidity ``` -broadlink_cli --device @BEDROOM.device --temperature +broadlink_cli --device @BEDROOM.device --humidity ``` ### Smart plugs From d15bf85228cb7764d1dbd97d259548974f14bbfa Mon Sep 17 00:00:00 2001 From: ozlb Date: Fri, 5 May 2023 22:22:35 +0200 Subject: [PATCH 2/3] Print sensors and in json format --sensorsJson argument to check all sensors and print in json format --- cli/broadlink_cli | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cli/broadlink_cli b/cli/broadlink_cli index f7a24ade..01e255fd 100755 --- a/cli/broadlink_cli +++ b/cli/broadlink_cli @@ -82,6 +82,7 @@ parser.add_argument("--turnnloff", action="store_true", help="turn off nightligh parser.add_argument("--switch", action="store_true", help="switch state from on to off and off to on") parser.add_argument("--send", action="store_true", help="send command") parser.add_argument("--sensors", action="store_true", help="check all sensors") +parser.add_argument("--sensorsJson", action="store_true", help="check all sensors and print in json format") parser.add_argument("--learn", action="store_true", help="learn command") parser.add_argument("--rfscanlearn", action="store_true", help="rf scan learning") parser.add_argument("--learnfile", help="save learned command to a specified file") @@ -123,6 +124,16 @@ if args.sensors: data = dev.check_sensors() for key in data: print("{} {}".format(key, data[key])) +if args.sensorsJson: + data = dev.check_sensors() + print("{") + ftt = True + for key in data: + if not ftt: + print(",") + print(" \"{}\" : {}".format(key, data[key])) + ftt = False + print("}") if args.send: data = durations_to_broadlink(parse_durations(' '.join(args.data))) \ if args.durations else bytearray.fromhex(''.join(args.data)) From 8545cf3edc365ed332247108b720041bfd36dd2c Mon Sep 17 00:00:00 2001 From: ozlb Date: Thu, 11 May 2023 06:26:19 +0200 Subject: [PATCH 3/3] Update protocol.md Authorisation packet --- protocol.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol.md b/protocol.md index e2825640..b7a6f7ca 100644 --- a/protocol.md +++ b/protocol.md @@ -132,7 +132,7 @@ You must obtain an authorisation key from the device before you can communicate. |------|--------| |0x00-0x03|00| |0x04-0x12|A 15-digit value that represents this device. Broadlink's implementation uses the IMEI.| -|0x13|01| +|0x1e|0x01| |0x14-0x2c|00| |0x2d|0x01| |0x30-0x7f|NULL-terminated ASCII string containing the device name|