mjg59 / python-broadlink

Python module for controlling Broadlink RM2/3 (Pro) remote controls, A1 sensor platforms and SP2/3 smartplugs
MIT License
1.38k stars 479 forks source link

Unable to issue broadlink commands #704

Closed daserra23 closed 2 years ago

daserra23 commented 2 years ago

Hi, I have installed Broadlink on a Raspberry pi (Buster)

I have a Broadlink RM3 mini which I can ping and I added it to the network using the official app but stopped the app once the WLAN was connected.

if I do this...

sudo pip3 install broadlink

Python3 import Broadlink devices.broadlink.discover()

I get the unexpected response

Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: module 'broadlink' has no attribute 'discover'

This also occurs when I issue any other broadlink.xxx command.

It appears something is amiss.

Perhaps I am missing something obvious.

daserra23 commented 2 years ago

OK, after looking in /usr/local/lib/python3.7 I noticed 2 versions of broadlink, probably after following an unsupported but for some reason still existing Domoticz wiki. I uninstalled braodlink using pip3 which removed both versions, and then re-installed. I am now able to make commands but I don't get anything back, for example, if I put the device in learning mode using device.enter_learning() The LED comes on and once I press a remote button it goes off. This to me indicates the device is detected and available to the script. However, no data is returned to the python console, just the arrow cursors and I have not been able to find out if the script creates a file somewhere with this information.

The same occurs with the other commands such as

device = broadlink.hello('192.168.0.16')

However these simply return to the cursor and no LED's are lit.

Any help greatly appreciated.

daserra23 commented 2 years ago

It appears the install instructions almost anywhere online are out of date. I was finally able to get things working using the instructions here https://gist.github.com/jovimon/1c236815b0382152e17b4742347dabf7