Using BROADLINK RM2 on DOMOTICZ

Others (MiLight, Hue, Toon etc...)

Moderator: leecollings

rjay
Posts: 37
Joined: Tuesday 06 September 2016 3:10
Target OS: Windows
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by rjay »

Help - Broken Domoticz after attempted plugin install. :oops:

Apologies for the long post but just need to list all the steps I took that have resulted in my Domoticz install dying.

New Broadlink RM Device arrives
Setup on Wifi, set static IP within DHCP for device
Checked Pre-reqs and had Python 3.6.1 and Domoticz latest Beta so no issues there I thought
Downloaded the Setup.exe from the Dropbox link listed on the Wiki and installed, got the red screen (heres where all the trouble started :o )
Downloaded latest Python just to make sure, upgraded to 3.6.2, re ran the Setup.exe - same issue red screen
Downloaded latest Beta of Domoticz just to make sure, upgraded, re ran the Setup.exe - same issue red screen

At this point I researched the forums and attempted some of the suggestions other users had been provided with

Tried extracting the .exe manually running the pycrypto-2.6.1.win32-py3.4.exe, gave an error saying couldn't find Python 3.4.0
More research suggested the for Win x64 versions remove all python versions, install 3.4.0 and then manually run pycrypto-2.6.1.win32-py3.4.exe and setup.exe as admin. Tried this and yep all worked, no red screen!

buttttt now if I went to my Domoticz webconsole I could not get in "wrong password" even though I 100% know it was the right password. Restarted the Domoticz service, still same issue.

Freaking out I then reinstalled the latest Python. Bam I could get in to the webconsole again (briefly), I could log in and setup the Broadlink but Windows/interface was acting very laggy and weird with focus being lost as you clicked on things or tried to type in fields.

So I am now looking at some suggestions to get everything back working again without losing my setup/config. I can reset the service and very briefly I can get into the console but it shows my Aeotech Stick offline and then after it lags and cannot be accessed. Refreshing or opening the a new browser window and can no longer get to web interface again until I reset the service again, obviously something is wigging out :(

HELP! :? :?
rjay
Posts: 37
Joined: Tuesday 06 September 2016 3:10
Target OS: Windows
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by rjay »

Well looks like I have managed to fix my own problem after some messing around. Figuring I had completely screwed my Domoticz install I thought I will just start again. I uninstalled Domoticz, then uninstalled all Python elements, reboot. Install the 32bit latest version of Python (found the 32bit version mentioned in one of the threads) then installed latest Beta of Domoticz. To my amazement my whole Domoticz setup came back, assuming that uninstall from the Control Panel in Windows doesn't actually full remove the app. Anyhow all my ZWave gear is working again, the Broadlink devices are there, all I have to do is test and see if I can get it to function now!
hypernative
Posts: 1
Joined: Tuesday 15 August 2017 13:55
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by hypernative »

Hi, I have a Raspberry PI with Rasbian and Domoticz. How do I install the Broalink plugin? I have spend hours on this. Can someone please tell?
woody4165
Posts: 476
Joined: Monday 14 March 2016 13:55
Target OS: Linux
Domoticz version: beta
Location: Rome, Italy
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by woody4165 »

claudioita wrote: Wednesday 19 April 2017 12:07 Hi,

is there a guide to use (the best way) broadlink products in domoticz?

I have RMPRO, TC2 switches, and SP3 power plugs
Ciao Clauio

Have you got SP3 power plugs to work with Domoticz?
You have the the plug with or without Power Monitor?
Thanks
Cubietruck - Linux cubietruck 4.13.16 (Debian GNU/Linux 8 (jessie)) + Domoticz + RFLink, Xiaomi Gateway, Owl USB, Yeelight Color and B/W, ESP8266, Broadlink RM2, Netatmo Thermostat
Justintime
Posts: 228
Joined: Thursday 21 May 2015 9:08
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by Justintime »

Okay... Still using mysensors to control domoticz devices by my Harmony remote.

This was in the time broadlink and domoticz was in Beta. 

At that time it wasn't possible to assign a button on the Harmony to control a domoticz device. I believe it was only activities then. 

Is that possible now?
So for instance learn a code on the Harmony and assign it to any domoticz device.?

Or does the Harmony remote see the broadlink hub with wifi and all buttons?
OttoBismark
Posts: 6
Joined: Monday 20 November 2017 15:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by OttoBismark »

woody4165 wrote: Friday 20 October 2017 12:37
claudioita wrote: Wednesday 19 April 2017 12:07 Hi,

is there a guide to use (the best way) broadlink products in domoticz?

I have RMPRO, TC2 switches, and SP3 power plugs
Ciao Clauio

Have you got SP3 power plugs to work with Domoticz?
You have the the plug with or without Power Monitor?
Thanks
Ciao Claudio, Woody, i've send you a PM please redi it. Thank you.
sion
Posts: 113
Joined: Friday 08 January 2016 12:32
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by sion »

hi all,
im trying to get broadlink working with domoticz on my synology.
i have installed python, and the domoticz-synology build with python.
i have out the files in the plugins folder,
but when i add it, im getting this:
2018-01-02 00:30:15.040 Domoticz V3.8770 (c)2012-2017 GizMoCuz
2018-01-02 00:30:15.040 Build Hash: 1046d7f-modified, Date: 2017-12-02 08:10:29
2018-01-02 00:30:15.041 Startup Path: /usr/local/domoticz/
2018-01-02 00:30:15.469 PluginSystem: Started, Python version '3.5.1'.
2018-01-02 00:30:15.486 Active notification Subsystems: gcm, http (2/14)
2018-01-02 00:30:15.488 WebServer(HTTP) started on address: :: with port 8643
2018-01-02 00:30:15.495 WebServer(SSL) started on address: :: with port 8695
2018-01-02 00:30:15.505 Proxymanager started.
2018-01-02 00:30:15.506 Starting shared server on: :::6144
2018-01-02 00:30:15.508 RxQueue: queue worker started...
2018-01-02 00:30:15.508 TCPServer: shared server started...
2018-01-02 00:30:17.335 Incoming connection from: 192.168.0.19
2018-01-02 00:30:17.516 EventSystem: reset all events...
2018-01-02 00:30:17.517 EventSystem: reset all device statuses...
2018-01-02 00:30:17.647 PluginSystem: Entering work loop.
2018-01-02 00:30:17.855 Python EventSystem: Initalizing event module.
2018-01-02 00:30:17.864 EventSystem: Queue thread started...
2018-01-02 00:30:17.867 EventSystem: Started
2018-01-02 00:31:34.441 (broadlink loounge) Started.
2018-01-02 00:31:34.684 Error: (BroadlinkRM2) failed to load 'plugin.py', Python Path used was '/usr/local/domoticz/var/plugins/broadlink/:/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'.
2018-01-02 00:31:34.684 Error: (broadlink loounge) Module Import failed, exception: 'ImportError'
2018-01-02 00:31:34.684 Error: (broadlink loounge) Module Import failed: ' Name: broadlink'
2018-01-02 00:31:34.684 Error: (broadlink loounge) Error Line details not available.
Has anyone got any ideas?

Cheers,
Sion.
running domoticz 3.4834 on rpi2, with
Hue bridge / bulbs.
lightwave rf sockets, mood controlers, sensors & contacts.
Home bridge / Siri.
Ha bridge / echo Alexa.
Hard wired alarm system - setting home / away status.

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

Re: Using BROADLINK RM2 on DOMOTICZ

Post by zak45 »

@sion
I think that you need to copy broadlink module to one of these paths:
'/usr/local/domoticz/var/plugins/broadlink/:/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'.
so the python framework will find it.
sion
Posts: 113
Joined: Friday 08 January 2016 12:32
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by sion »

thanks zak.
got this going in the end.
I uninstalled everything, and then when through it all again step by step, so i must have missed something first time around.
I have been pleasantly surprised as to how well it works :)
running domoticz 3.4834 on rpi2, with
Hue bridge / bulbs.
lightwave rf sockets, mood controlers, sensors & contacts.
Home bridge / Siri.
Ha bridge / echo Alexa.
Hard wired alarm system - setting home / away status.

Next: harmony hub.
Carther332
Posts: 1
Joined: Wednesday 17 January 2018 7:05
Target OS: Windows
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by Carther332 »

To Hands-on setup mode for the Kodi Apk data, Every Android users know Kodi various other things Kodi for Android does not stem as a new special.
lindehome
Posts: 1
Joined: Friday 07 September 2018 17:29
Target OS: -
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by lindehome »

hi guys,
i have an issue with the installation of the Broadlink code.
Traceback (most recent call last):
File "learn.py", line 7, in <module>
device = broadlink.rm(host=("my ip",80), mac=bytearray.fromhex("mac"))
TypeError: __init__() takes exactly 4 arguments (3 given)
the ip and mac is correct, from python locatrm.py, but dont work,
some help?
henrytom36
Posts: 1
Joined: Wednesday 13 February 2019 11:17
Target OS: Windows
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by henrytom36 »

Carther332 wrote: Wednesday 17 January 2018 7:06 To Hands-on setup mode for the Kodi Apk data, Every Android users know Exodus Kodi various other things Kodi for Android does not stem as a new special.
Thanks for the updates.
H0ppie
Posts: 5
Joined: Wednesday 07 June 2017 17:06
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by H0ppie »

lindehome wrote: Saturday 08 September 2018 3:59 hi guys,
i have an issue with the installation of the Broadlink code.
Traceback (most recent call last):
File "learn.py", line 7, in <module>
device = broadlink.rm(host=("my ip",80), mac=bytearray.fromhex("mac"))
TypeError: __init__() takes exactly 4 arguments (3 given)
the ip and mac is correct, from python locatrm.py, but dont work,
some help?
Uhm... For what it is worth, I finally found it out myself. All you need to do is add an extra parameter in the device variable with the device type you have. This device type is a hexadecimal value and can be found in the next folder of the plugin or on the github (as of now at least):

Code: Select all

python-broadlink/broadlink/__init__.py
and look for the gendevice function. The author commented the name of the device behind the codes.

So for example:

Code: Select all

device = broadlink.rm(host=("10.0.0.2", 80), mac=bytearray.fromhex(AABBCCDDEEFFGG), devtype=0x27c2)
The last parameter is the one code for your device, in my case the RM3 Mini. As far as I understood as a Python noob, you shouldn't put quotes around the code since it would make it text and not hexadecimal.
moacir
Posts: 12
Joined: Monday 23 January 2017 20:21
Target OS: NAS (Synology & others)
Domoticz version: V4.10717
Location: Curitiba - PR - BR
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by moacir »

Hi again! I used my interaction with Broadlink until version 0.9 of the Python plugin. I needed to upgrade my server and had to recompile the plugin, which this time was version 0.12. But in this 0.12 release, i am no longer able to use my interactions with Broadlink. The following error is returning:

PS: XXX.XXX.XX.XX and AABBCCDDEEFF match my equipment and script described below is located at /domoticz/broadlink/py-scripts

Code: Select all

Traceback (most recent call last):
  File "/domoticz/broadlink/py-scripts/playrmquarto.py", line 17, in <module>
    device = broadlink.rm(host=("XXX.XXX.XX.XX",80), mac=bytearray.fromhex("AABBCCDDEEFF"), devtype=0x279d)
  File "/usr/lib/python2.7/site-packages/broadlink-0.12.0-py2.7.egg/broadlink/__init__.py", line 511, in __init__
    device.__init__(self, host, mac, devtype)
  File "/usr/lib/python2.7/site-packages/broadlink-0.12.0-py2.7.egg/broadlink/__init__.py", line 162, in __init__
    self.update_aes(key)
  File "/usr/lib/python2.7/site-packages/broadlink-0.12.0-py2.7.egg/broadlink/__init__.py", line 166, in update_aes
    backend=default_backend())
  File "/usr/lib/python2.7/site-packages/cryptography-2.8-py2.7-linux-armv7l.egg/cryptography/hazmat/backends/__init__.py", line 15, in default_backend
    from cryptography.hazmat.backends.openssl.backend import backend
  File "/usr/lib/python2.7/site-packages/cryptography-2.8-py2.7-linux-armv7l.egg/cryptography/hazmat/backends/openssl/__init__.py", line 7, in <module>
    from cryptography.hazmat.backends.openssl.backend import backend
  File "/usr/lib/python2.7/site-packages/cryptography-2.8-py2.7-linux-armv7l.egg/cryptography/hazmat/backends/openssl/backend.py", line 75, in <module>
    from cryptography.hazmat.bindings.openssl import binding
  File "/usr/lib/python2.7/site-packages/cryptography-2.8-py2.7-linux-armv7l.egg/cryptography/hazmat/bindings/openssl/binding.py", line 15, in <module>
    from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: Error relocating /usr/lib/python2.7/site-packages/cryptography-2.8-py2.7-linux-armv7l.egg/cryptography/hazmat/bindings/_openssl.so: EC_POINT_set_affine_coordinates_GF2m: symbol not found
And here the script (playrmquarto.py) that worked normally to interact with Broadlink:

Code: Select all

#!/usr/bin/python

import broadlink
import time
import sys

try:
    fileName = sys.argv[1]
except IndexError:
    fileName = 'null'

if fileName == 'null':
#   print "Error - no file name parameter suffixed"
   sys.exit()
else:

   device = broadlink.rm(host=("XXX.XXX.XX.XX",80), mac=bytearray.fromhex("AABBCCDDEEFF"), devtype=0x279d)

#print "Connecting to Broadlink device...."
device.auth()
#time.sleep(1)
print "Connected...."
#time.sleep(1)
device.host

file = open(fileName, 'r')

myhex = file.read()

device.send_data(myhex.decode('hex'))
#print "Code Sent...."
I do not understand anything about Python. Could Dear forum members give me a light if there was a change in the script to communicate with Broadlink? On the official page there is nothing (https://github.com/mjg59/python-broadlink).

Thank you all for your attention!


EDIT ON 03/12/19: I resolved my issue as follows:

Code: Select all

pip unisntal broadlink      # Remove version 0.12 that was installed
pip install broadlink==0.9  # Force install of version 0.9
Thats all!!!
User avatar
Sjonnie2017
Posts: 361
Joined: Wednesday 02 August 2017 19:43
Target OS: Linux
Domoticz version: Latest ß
Location: The Netherlands
Contact:

Re: Using BROADLINK RM2 on DOMOTICZ

Post by Sjonnie2017 »

I am having a hard time to get my Black Bean (RM Mini 3) reconnected to Domoticz. I had it working for three years but had to reset the devices. Now I can not import the configuration in Domoticz.

As said: I had the Black Bean working perfectly but I had to delete it from Domoticz. I had the e-Control app installed on one of my old tablets and lost track of it. I had not re-installed it on my latest tablet plus I forgot my account settings :-( I could not re-read the settings from the Black Bean into the old app :-S So I thought I'd start over. Big mistake!

I first tried to configure my devices in the new IHC app from broadlink and tried to read the configuration in Domoticz. No joy. So I decided to re-install the e-Control app, create an account and configure the devices. This worked flawlessly for both Beans (I have two now, one of the reasons to make some changes...).

In the hardware section of Domoticz I added the first Black Bean with the proper settings (IP address, MAC address, folder to store the ini files). There were three devices made: Black Bean Command, Black Bean Remote and Black Bean Import.

I followed the steps in the Wiki (https://www.domoticz.com/wiki/Plugins/BroadlinkRM2.html) to import the devices. Checked if the files jsonSubIr, jsonButton, jsonIrCode are present on the tablet (they are). Started the web server, opened a browser on my Android device containing the app but the web server won't open. So I cannot copy the files.

EDIT: Forgot to mention that I have version 3.0.0 of the plugin by @zak45 and (AFAIK) version 0.9 of the python broadlink plugin

EDIT2: tried to copy the files jsonSubIr, jsonButton, jsonIrCode (changed permissions to 777 just to be sure) to the import folder under the folder to store the ini files and hit the import button on the switch. No joy :?

EDIT3: Got it!! :mrgreen: :mrgreen: After copying the files to the import folder I had to click on the Generate button on the switch. After that I clicked the Import button on the switch and now all devices are present! Happy camper!! :lol:

I must be missing something simple here but I can't figure out what that would be. <-- Nope! Not anymore :mrgreen:

Any help appreciated!

TIA

Greetz,

Sjonnie
ConBee II - TRÅDFRI lights + switches, loads of ChingLing dimmers and switches, Heiman and Xiaomi sensors
SolarEdge SE4000H (with active modbus_tcp)
YouLess Energy meter
Shelly 2.5 in roller shutter mode
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests