Python Plugin: Broadlink RM2

Python and python framework

Moderator: leecollings

davidrq78
Posts: 5
Joined: Sunday 26 November 2017 12:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by davidrq78 »

zak45 wrote: Sunday 26 November 2017 23:48 @davidrq78
you need to adapt plugin_http.sh to your env.
in your case, this should be :
nohup python3 /home/pi/domoticz/plugins/BroadlinkRM2/plugin_http.py $1 $2 $3 &

do not forget to give +x
Dude im super newbie i need a step by step instructions. Plz help :roll:
ill should go to :
cd /home/pi/domoticz/plugins/BroadlinkRM2
and than type sudo chmod +x plugin_http.py ? Or what?
Estyaah
Posts: 3
Joined: Saturday 07 April 2018 18:24
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by Estyaah »

Hi everyone ! I've read the entire topic, but i'm stuck with the "Error Connecting to Broadlink device..." message

Code: Select all

2018-04-07 18:20:48.838 (Broadlink Mini 3) Initialized version 3.0.0, author 'zak45'
2018-04-07 18:20:48.841 (Broadlink Mini 3) Debug log level set to: 'true'.
2018-04-07 18:20:48.841 (Broadlink Mini 3) 'HardwareID':'8'
2018-04-07 18:20:48.841 (Broadlink Mini 3) 'HomeFolder':'/home/seb/domoticz/plugins/BroadlinkRM2/'
2018-04-07 18:20:48.841 (Broadlink Mini 3) 'Version':'3.0.0'
2018-04-07 18:20:48.841 (Broadlink Mini 3) 'Author':'zak45'
2018-04-07 18:20:48.841 (Broadlink Mini 3) 'Name':'Broadlink Mini 3'
2018-04-07 18:20:48.841 (Broadlink Mini 3) 'Address':'192.168.0.13'
2018-04-07 18:20:48.842 (Broadlink Mini 3) 'Port':'0'
2018-04-07 18:20:48.842 (Broadlink Mini 3) 'Key':'BroadlinkRM2'
2018-04-07 18:20:48.842 (Broadlink Mini 3) 'Mode1':'780f77006f9f'
2018-04-07 18:20:48.842 (Broadlink Mini 3) 'Mode2':'/home/seb/domoticz/plugins/BroadlinkRM2'
2018-04-07 18:20:48.842 (Broadlink Mini 3) 'Mode3':'yes'
2018-04-07 18:20:48.842 (Broadlink Mini 3) 'Mode4':'yes'
2018-04-07 18:20:48.842 (Broadlink Mini 3) 'Mode5':'9000'
2018-04-07 18:20:48.842 (Broadlink Mini 3) 'Mode6':'Debug'
2018-04-07 18:20:48.842 (Broadlink Mini 3) 'DomoticzVersion':'3.8944'
2018-04-07 18:20:48.842 (Broadlink Mini 3) 'DomoticzHash':'9df30fb0'
2018-04-07 18:20:48.842 (Broadlink Mini 3) 'DomoticzBuildTime':'2018-02-23 23:42:52'
2018-04-07 18:20:48.842 (Broadlink Mini 3) Device count: 4
2018-04-07 18:20:48.842 (Broadlink Mini 3) Device: 1 - ID: 42, Name: 'Broadlink Mini 3 - Command', nValue: 0, sValue: 'Off'
2018-04-07 18:20:48.842 (Broadlink Mini 3) Device ID: '42'
2018-04-07 18:20:48.843 (Broadlink Mini 3) Device Name: 'Broadlink Mini 3 - Command'
2018-04-07 18:20:48.843 (Broadlink Mini 3) Device nValue: 0
2018-04-07 18:20:48.843 (Broadlink Mini 3) Device sValue: 'Off'
2018-04-07 18:20:48.843 (Broadlink Mini 3) Device LastLevel: 0
2018-04-07 18:20:48.843 (Broadlink Mini 3) Device: 2 - ID: 43, Name: 'Broadlink Mini 3 - Temp', nValue: 0, sValue: ''
2018-04-07 18:20:48.843 (Broadlink Mini 3) Device ID: '43'
2018-04-07 18:20:48.843 (Broadlink Mini 3) Device Name: 'Broadlink Mini 3 - Temp'
2018-04-07 18:20:48.843 (Broadlink Mini 3) Device nValue: 0
2018-04-07 18:20:48.843 (Broadlink Mini 3) Device sValue: ''
2018-04-07 18:20:48.843 (Broadlink Mini 3) Device LastLevel: 0
2018-04-07 18:20:48.843 (Broadlink Mini 3) Device: 254 - ID: 44, Name: 'Broadlink Mini 3 - Remote', nValue: 0, sValue: ''
2018-04-07 18:20:48.843 (Broadlink Mini 3) Device ID: '44'
2018-04-07 18:20:48.843 (Broadlink Mini 3) Device Name: 'Broadlink Mini 3 - Remote'
2018-04-07 18:20:48.843 (Broadlink Mini 3) Device nValue: 0
2018-04-07 18:20:48.843 (Broadlink Mini 3) Device sValue: ''
2018-04-07 18:20:48.844 (Broadlink Mini 3) Device LastLevel: 0
2018-04-07 18:20:48.844 (Broadlink Mini 3) Device: 255 - ID: 45, Name: 'Broadlink Mini 3 - Import', nValue: 0, sValue: 'Off'
2018-04-07 18:20:48.844 (Broadlink Mini 3) Device ID: '45'
2018-04-07 18:20:48.844 (Broadlink Mini 3) Device Name: 'Broadlink Mini 3 - Import'
2018-04-07 18:20:48.844 (Broadlink Mini 3) Device nValue: 0
2018-04-07 18:20:48.844 (Broadlink Mini 3) Device sValue: 'Off'
2018-04-07 18:20:48.844 (Broadlink Mini 3) Device LastLevel: 0
2018-04-07 18:20:48.844 (Broadlink Mini 3) Connecting to: 192.168.0.13:780f77006f9f
2018-04-07 18:20:48.844 Error: (Broadlink Mini 3) Error Connecting to Broadlink device....
2018-04-07 18:20:48.845 (Broadlink Mini 3) Device Number begin to : 2
2018-04-07 18:20:48.845 (Broadlink Mini 3) Entering work loop.
2018-04-07 18:20:48.868 (Broadlink Mini 3) No ini file :/home/seb/domoticz/plugins/BroadlinkRM2/remote/plugin_remote_8.ini
2018-04-07 18:20:48.869 (Broadlink Mini 3) Custom Commands for Remote not managed
2018-04-07 18:20:48.869 (Broadlink Mini 3) Heartbeat interval set to: 30.
2018-04-07 18:20:58.388 (Broadlink Mini 3) Calling message handler 'onHeartbeat'.
2018-04-07 18:20:58.389 Error: (Broadlink Mini 3) Error Connecting to Broadlink device...
Domoticz runs on an Ubuntu server 17.10 with python 3.6, and I try to reach the RM mini 3.
I've installed the last version of plugin.py (v3), I've copied all the content of crypto, broadlink & pyaes in /usr/lib/python3.6/

The RM mini 3 is well seen by the e-control app on android, and from my other PC, with advanced IP scanner, I have the line :
"OK 192.168.0.13 192.168.0.13 NBS Payment Solutions Inc. 78:0F:77:00:6F:9F"
which corresponds to the rule I set in my dhcp server settings.

To be sure, I've run the discovery thing, and the IP and the MAC was well the ones above.

I don't understand why I still have this message...

P.S: @davidrq78 : yes, you have to go to /home/pi/domoticz/plugins/BroadlinkRM2, then type sudo chmod +x plugin_http.py
ian13010
Posts: 4
Joined: Sunday 08 April 2018 17:46
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by ian13010 »

@Estyaah

Hello,

I have the same issue as you. Hope it's not a problem of compatibility with the newer version of Broadlink.
I continue to search and post a message if there's any evolution.
Estyaah
Posts: 3
Joined: Saturday 07 April 2018 18:24
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by Estyaah »

I've read the topic viewtopic.php?f=65&t=21645&hilit=broadlink&start=120 and I tried to use python3.4 instead of 3.6, but nothing better.
For information, if someone needs to install python3.4, i've used this : https://github.com/mhbashari/Install-Py ... untu-16.04
Then : https://linuxconfig.org/how-to-change-f ... bian-linux (the part with update-alternatives).

From my side, I've re-set the python version to 3.6.

Then, while I write this post, I thank to the post of the person who talk about changing the plugin for Ubuntu 18.04 :
Paint wrote: Sunday 01 April 2018 22:18 I am running Ubuntu 18.04 LTS and using the latest python 3.6 broadlink module (v0.8). I believe the script needs to be slightly updated to comply with the updated connection string. We now have to pass a devtype ID as well with the host and MAC address. Here is a sample line:

Code: Select all

def broadlinkConnect():
    global device, brohost, bromac, devtype

    try:
        devtype = 0x279d
        device = broadlink.rm(host=(brohost,80), mac=bytearray.fromhex(bromac), devtype=devtype)
        device.auth()
        device.host
        print( "Connected to Broadlink device.")
    except:
        print( "Error Connecting to Broadlink device....")
        sys.exit(2)

    return True

Please see my modified plugin.py and plugin_send.py files below.

plugin.py https://pastebin.com/3xy6Nr4q
plugin_send.py: https://pastebin.com/BQGD2i0Z
After reboot, I've some errors, but I think it works. I've tried to learn an IR command and it seams working !

Edit : It works ! I managed to learn some commands, then to play it from domoticz !
ian13010
Posts: 4
Joined: Sunday 08 April 2018 17:46
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by ian13010 »

Hello everybody !

I have the same issue since 1 week. Impossible to connect the Broadlink device with Domoticz.

I tried to install the plugin in a Synology NAS and follow this procedure (thanks to zak45 for the sharing). https://zhougy0717.github.io/2017/07/31 ... on%20Echo/

I'm in 3.5.1 for Python version and I tested the modified plugin.py and plugin_send.py files from Paint but still the same error.

Code: Select all

2018-04-09 18:17:52.288 (Broadlink) Connecting to: 192.168.0.18:780f7700bcb3
2018-04-09 18:17:52.288 Error: (Broadlink) Error Connecting to Broadlink device....192.168.0.18
2018-04-09 18:17:52.294 (Broadlink) No ini file :/usr/local/domoticz/var/plugins/BroadlinkRM2/remote/plugin_remote_3.ini
2018-04-09 18:17:52.294 (Broadlink) Custom Commands for Remote not managed
2018-04-09 18:17:52.294 (Broadlink) Device Number begin to : 2
2018-04-09 18:17:52.294 (Broadlink) Processing 'PollIntervalDirective' message
2018-04-09 18:17:52.294 (Broadlink) Heartbeat interval set to: 30.
2018-04-09 18:18:01.898 (Broadlink) Pushing 'onHeartbeatCallback' on to queue
2018-04-09 18:18:01.918 (Broadlink) Processing 'onHeartbeatCallback' message
2018-04-09 18:18:01.918 (Broadlink) Calling message handler 'onHeartbeat'.
2018-04-09 18:18:01.919 Error: (Broadlink) Error Connecting to Broadlink device....192.168.0.18
Thanks in advance for your help !

Edit : It's working ! So, what I did :
- uninstall my old version of broadlink
- git clone https://github.com/mjg59/python-broadlink --> isntall the final version (0.8)
- follow https://zhougy0717.github.io/2017/07/31 ... on%20Echo/
- change the plugin.py and plugin_send.py with the Paint version
- restart domoticz service

I can continue to resolve the other problems (web server,...)
Do you know if RF codes are functionnal with broadlink plugin ? (to pilot 433MHz devices )

Thanks for the BIG work and see you later :)
parrotface
Posts: 36
Joined: Monday 02 February 2015 15:50
Target OS: Linux
Domoticz version:
Location: Cheshire England
Contact:

Re: Python Plugin: Broadlink RM2

Post by parrotface »

Tried all sort of things found in this forum and just cant get broadlink to work.
Using a Raspberry Pi
Domoticz Version: 3.8153
plugin.py V3
sudo pip3 install broadlink
this also installed -- Successfully installed broadlink pyaes
All pugins copied to domoticz/plugins/BroadLinkRM2
All plugins are executable


Should all the plugins scripts be executable or not?
when I have plugin.py executable (chmod +x) some times I can't connect with web browser even after restart domoticz.
Reboot Pi I can connect but can't get any broadlink devices. Command, - Remote - Import etc
Also it stops producing graphs until I remove the plugin.py and the graphs start working again.
At a loss as what to do
Many Thanks
jdecelis
Posts: 2
Joined: Tuesday 17 January 2017 11:40
Target OS: Linux
Domoticz version: 3.5877
Location: Malta
Contact:

Re: Python Plugin: Broadlink RM2

Post by jdecelis »

Dear all i'm having problem with the plugin i tried all the above but i;m still getting the following once i add the RM PRO

2018-05-30 20:13:56.643 Error: (BroadlinkRM2) failed to load 'plugin.py', Python Path used was ':/usr/lib/python35.zip:/usr/lib/python3.5:/usr/lib/python3.5/plat-arm-linux-gnueabihf:/usr/lib/python3.5/lib-dynload'.
2018-05-30 20:13:56.643 Error: (RM PRO+) Module Import failed, exception: 'ImportError'
2018-05-30 20:13:56.644 Error: (RM PRO+) Module Import failed: ' Name: plugin'
2018-05-30 20:13:56.644 Error: (RM PRO+) Error Line details not available.

thanks
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin: Broadlink RM2

Post by zak45 »

jdecelis wrote: Wednesday 30 May 2018 20:17 Dear all i'm having problem with the plugin i tried all the above but i;m still getting the following once i add the RM PRO

2018-05-30 20:13:56.643 Error: (BroadlinkRM2) failed to load 'plugin.py', Python Path used was ':/usr/lib/python35.zip:/usr/lib/python3.5:/usr/lib/python3.5/plat-arm-linux-gnueabihf:/usr/lib/python3.5/lib-dynload'.
2018-05-30 20:13:56.643 Error: (RM PRO+) Module Import failed, exception: 'ImportError'
2018-05-30 20:13:56.644 Error: (RM PRO+) Module Import failed: ' Name: plugin'
2018-05-30 20:13:56.644 Error: (RM PRO+) Error Line details not available.

thanks
Python version 3.x required & Domoticz version 3.90xx or greater.
jdecelis
Posts: 2
Joined: Tuesday 17 January 2017 11:40
Target OS: Linux
Domoticz version: 3.5877
Location: Malta
Contact:

Re: Python Plugin: Broadlink RM2

Post by jdecelis »

Thanks for your reply. I have python 3.5 installed and domoticz 3.9540


Sent from my MI 5s Plus using Tapatalk

Creaky
Posts: 20
Joined: Monday 12 December 2016 15:45
Target OS: NAS (Synology & others)
Domoticz version: 2020.2
Location: NL
Contact:

Re: Python Plugin: Broadlink RM2

Post by Creaky »

I'm getting the distinct feeling that this plugin just doesn't work anymore on recent versions of Domoticz.
I've tried getting it to work on my Synology Domoticz installation and on a Pi domoticz installation. In both cases it is impossible to get the plugin to work.

So.

Either the plugin is broken and we've all wasted hours of our lives getting it to work, or truly detailed instructions on how to get it to work are missing.
Maybe someone can shed some real light on this issue and not just reply with 'You need to install Python 3.x.x.x.x', which, as you can see in all former post, is of no help.
Greetz,

·´¯`·.¸¸.·´¯`·. ( Creaky ) .·´¯`·.¸¸.·´¯ `·
Hypermobile
Posts: 6
Joined: Wednesday 17 January 2018 17:51
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by Hypermobile »

Creaky wrote: Wednesday 26 June 2019 15:37 I'm getting the distinct feeling that this plugin just doesn't work anymore on recent versions of Domoticz.
I've tried getting it to work on my Synology Domoticz installation and on a Pi domoticz installation. In both cases it is impossible to get the plugin to work.

So.

Either the plugin is broken and we've all wasted hours of our lives getting it to work, or truly detailed instructions on how to get it to work are missing.
Maybe someone can shed some real light on this issue and not just reply with 'You need to install Python 3.x.x.x.x', which, as you can see in all former post, is of no help.
Same Problem here, on a Synology:

2019-09-26 19:11:45.918 Error: (BroadlinkRM2) failed to load 'plugin.py', Python Path used was '/usr/local/domoticz/var/plugins/BroadlinkRM2/:/volume1/@appstore/py3k/usr/local/lib/python35.zip:/volume1/@appstore/py3k/usr/local/lib/python3.5/:/volume1/@appstore/py3k/usr/local/lib/python3.5/plat-linux:/volume1/@appstore/py3k/usr/local/lib/python3.5/lib-dynload:/volume1/@appstore/py3k/usr/local/lib/python3.5/site-packages'.
2019-09-26 19:11:46.161 Error: (Broadlink IR) Module Import failed, exception: 'ImportError'
2019-09-26 19:11:46.161 Error: (Broadlink IR) Module Import failed: ' Name: broadlink'
2019-09-26 19:11:46.162 Error: (Broadlink IR) Error Line details not available.
spider2
Posts: 13
Joined: Wednesday 21 November 2018 19:57
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by spider2 »

I have the same problem on synology nas:

Error: (BroadlinkRM) failed to load 'plugin.py', Python Path used was '/usr/local/domoticz/var/plugins/BroadlinkIR/:/volume1/@appstore/py3k/usr/local/lib/python35.zip:/volume1/@appstore/py3k/usr/local/lib/python3.5/:/volume1/@appstore/py3k/usr/local/lib/python3.5/plat-linux:/volume1/@appstore/py3k/usr/local/lib/python3.5/lib-dynload:/volume1/@appstore/py3k/usr/local/lib/python3.5/site-packages'.
2019-11-12 20:08:23.881 Error: (Broadlink) Module Import failed, exception: 'ImportError'
2019-11-12 20:08:23.881 Error: (Broadlink) Module Import failed: ' Name: broadlink'
2019-11-12 20:08:23.881 Error: (Broadlink) Error Line details not available.

What can I do with this?
markjgabb
Posts: 142
Joined: Tuesday 24 January 2017 23:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Australia
Contact:

Re: Python Plugin: Broadlink RM2

Post by markjgabb »

exact same issue here, i just had to do the buster upgrade on RPI and now no longer works

(BroadlinkRM) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/BroadlinkIR/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.7/dist-packages'.
V 2020.2 RPI 3
RFlink 334 mhz
mysensors
broadlink
Mirabella Genio Globes
dheuts
Posts: 65
Joined: Monday 25 March 2019 15:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Brunssum, Netherlands
Contact:

Re: Python Plugin: Broadlink RM2

Post by dheuts »

Please check the solution in this thread: viewtopic.php?f=65&t=21645&p=245214&hil ... nk#p243975
Raspberry Pi 4 With Domoticz - RFXCom - Tuya Wifi LED lights - Chuango Alarm - Zwave+ - Zigbee2MQTT - Anna Thermostat - Broadlink IR, P1 - Eufy Robo Vacuum - Worx Robo Mower
tarrybrad
Posts: 1
Joined: Wednesday 18 October 2023 12:32
Target OS: Windows
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by tarrybrad »

Dominick98 wrote: Tuesday 19 December 2017 8:58 Your devices whether smartphones or pc and also laptop computers. Instagram Apk you regulate hen's motion through your voice and this application.
yeah, but executing python will be better option by commands.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests