lprhodes / homebridge-broadlink-rm

Broadlink RM Mini and Pro plugin for homebridge: https://github.com/nfarina/homebridge
Apache License 2.0
574 stars 284 forks source link

Unable to learn codes #553

Open ghost opened 4 years ago

ghost commented 4 years ago

Hello,

I am unable to learn codes. Could you please help me?

Hardware: Raspberry PI 2 Broadlink RM Mini 3

Here is my config.json:

{ "platform": "BroadlinkRM", "name": "Broadlink RM", "hideWelcomeMessage": true, "hideScanFrequencyButton": true, "hideLearnButton": false, "hosts": [ { "address": "192.168.86.17", "mac": "24:df:a7:b1:f7:d6", "isRFSupported": false }, { "address": "192.168.86.14", "mac": "24:df:a7:b1:ef:c2", "isRFSupported": false } ], "accessories": [ { "accessory": "Broadlink RM Learner", "name": "Learn Salón", "type": "learn-code", "host": "192.168.86.17" }, { "accessory": "Broadlink RM Learner", "name": "Learn Dormitorio", "type": "learn-code", "host": "192.168.86.14" } ] }

Log output:

Jan 30 14:22:13 raspberrypi homebridge[13402]: [30/01/2020, 14:22:13] [Broadlink RM] Learn Salón getSwitchState: undefined Jan 30 14:22:13 raspberrypi homebridge[13402]: [30/01/2020, 14:22:13] [Broadlink RM] Learn Dormitorio getSwitchState: undefined Jan 30 14:22:17 raspberrypi homebridge[13402]: [30/01/2020, 14:22:17] [Broadlink RM] [INFO] Learn Code initializing (192.168.86.14) Jan 30 14:22:17 raspberrypi homebridge[13402]: [30/01/2020, 14:22:17] [Broadlink RM] [ERROR] Learn Code (Couldn't learn code, device not found) Jan 30 14:23:42 raspberrypi homebridge[13402]: [30/01/2020, 14:23:42] [Broadlink RM] Learn Salón getSwitchState: undefined Jan 30 14:23:42 raspberrypi homebridge[13402]: [30/01/2020, 14:23:42] [Broadlink RM] Learn Dormitorio getSwitchState: undefined

Thanks in advance, Best regards

ocsocs commented 4 years ago

I'm by far not an expert, but I daresay your problem is

device not found

Until the driver connects to the device, which would look somewhat like

[1/30/2020, 4:16:51 PM] [Broadlink RM] [INFO] Discovered Broadlink RM3 Pro Plus (279d) at [IP] ([MAC])

or perhaps

[1/30/2020, 4:48:40 PM] [Broadlink RM] Broadlink RM device at [IP] ([MAC]) has been re-discovered.

in the log, there's really nothing the driver can do.

Given you have the „hosts“ item in your config, well, I am not sure what to recommend. Perhaps the device itself got locked somehow; I'd try (a) restarting it (simply by pulling out its power line for a moment, then wait until it stops blinking blue), (b) if it does not help by itself, restarting homebridge, too.

Good luck! The device discovery problems are sorta inconvenient indeed :(

ocsocs commented 4 years ago

By the way, that reminds me of another feature request I wanted to add — IMHO not worth a separate issue: it would be great if it was possible to show somehow in the Home GUI that the device is not accessible at the moment.

As for how, I am not sure. Does the Apple API allow to show perhaps “no response” for the accessories, although homebridge itself is reachable and communicates all right? No idea...

ghost commented 4 years ago

I tried to discovery the devices using the python-broadlink tool (https://github.com/mjg59/python-broadlink) and i get the following.

16:57 $ python3 broadlink_discovery Discovering... Error authenticating with device : ('192.168.86.14', 80) Error authenticating with device : ('192.168.86.17', 80)

ghost commented 4 years ago

Looks like the devices are discovered but for some reason the learn-code is not working.

Feb 01 11:05:08 raspberrypi homebridge[13945]: [01/02/2020, 11:05:08] [Broadlink RM] Broadlink RM device at 192.168.86.14 () is no longer reachable. (192.168.86.14, Request timed out) Feb 01 11:05:16 raspberrypi homebridge[13945]: [01/02/2020, 11:05:16] [Broadlink RM] Broadlink RM device at 192.168.86.14 () has been re-discovered.

ocsocs commented 4 years ago

So are you still getting

... [Broadlink RM] [ERROR] Learn Code (Couldn't learn code, device not found)

even after

Broadlink RM device at 192.168.86.14 () has been re-discovered

? That seems pretty weird, and if so, I am afraid I'm not able to help — this vastly exceeds my knowledge of the software :(

Just one idea, most probably wrong and misleading, but well, you were warned :) Perhaps there might be some mess caused by the two separate devices? Myself,. so far, I have always used only one. In your situation, I would probably try to temporarily remove one of the devices and check with only one to see whether it works all right or not.