Broadlink RM-PRO and A1 sensor

I found your problem
In the previous post i see your are using python 2.7

So you need to do
apt-get install python3 python3-pip
Then
pip3 search crypto
Then check if the pycrypto is listed
Then
Install it using pip3 install pycrypto

To start the script use python3 nameofthescript.py

1 Like

Pycrypto is listed and is already installed:

pi@pi:~ $ pip3 install pycrypto
Requirement already satisfied: pycrypto in /usr/local/lib/python3.4/dist-packages
pi@pi:~ $

but did not work yet out of the virtual environment!

But I got it working partially into the Hass virtual environment. I think something is wrong because I am getting the packet without pressing nothing on the remotes…

Learning mode… Please press the key on the remote controls.

Your packet is:

JgDuAAgAAwIIAALuBwADWwgABeoJAALZCwADLAoAAtoIAANqBwAGCgYAAwUHAAYdCAgIAAMhBwAC8wcABdwHAAZkCAAGPggAAuIIAAMtCAAC7AkAAuoJAAMBCAAC3gkAAtkIAAL9DQAC/QgAAvwIAAL9CAAC+ggAA2YIAAlSCQADBQcAAygIAAYXCQAC2QgABjAIAALYCAADCAkHCQADEwkAAwsIAALzBwAC1wgAA5cHAAL9CgAC5AwAAusHEQgAAr0IAAMPCAAEQAcAAuUJAALcCQAC/goAAucIAAL5CAADRQgAAv4IAAw+CAAEewkADQUAAAAAAAAAAAAA

(hass_venv) hass@pi:/home/pi$

and sometimes the packet is short like this:

JgAkAA4AAsQOAAwqBwAGNwcAAtkMAAYABgAF8A0ABhANAAMIDAANBQAAAAA=

for the pycrypto problem
send the error mesage, you start the script using ‘pi@pi:~ $ python3 nameofscript.py’ ?

for the packet i can not help, i have not already try.
But i think the second one is base64 encoded.

Send the link to your script i will check the code, and i can try this week-end with the broadlink pro.

if you use this script => http://pastebin.com/gFB66sVM
the packet is encoded in base64
and folowing runtime you can use the packet in your configuration file.

to use the global python
you can replace the shebang (first line in the script “#!/usr/bin/python”)with the python3 location

do
pi@pi:~ $ which python3
/usr/bin/python3

then replace in the file “#!/usr/bin/python” by “#!/usr/bin/python3”

then
pi@pi:~ $chmod +x nameofscript.py
then start tge script like this:

pi@pi:~ $./nameofscript.py

my last try was doing in the global python.
I have changed the location on the file to
/usr/local/bin/python3

Installed the pycrypto using
pip3 install pycrypto

chmod done
and tried starting the script like this:

pi@pi:~ $ ./packet.py

and got:

Traceback (most recent call last):
File “./packet.py”, line 186, in
main()
File “./packet.py”, line 174, in main
device.auth()
File “./packet.py”, line 39, in auth
from Crypto.Cipher import AES
ImportError: No module named ‘Crypto’

Under the HASS virtual environment I got it working with

(hass_venv) hass@pi:/home/pi$ python3 packet.py

but the script stops on the
Learning mode… Please press the key on the remote control.

and nothing happens when I press remote buttons…
sometimes it gives me that long code after nothing pressed…

when I press Ctrl+C I get

Learning mode… Please press the key on the remote control.
^CTraceback (most recent call last):
File “packet.py”, line 186, in
main()
File “packet.py”, line 180, in main
packet=device.check_data()
File “packet.py”, line 163, in check_data
err = response[0x22] | (response[0x23] << 8)
KeyboardInterrupt
(hass_venv) hass@pi:/home/pi$

I also tried the script using
hass --script broadlink --ip --mac
and got error as well

Can I use data from RM Bridge?

260054005210281229112911291216112911151228121512151216101600030c50132810291229112b1015112911161229111512141216111500030d50112812291129132811151228121512281215131412151215000d0500000000

and copy it as a packet?

For the python i don’t know where is the problem. I Will give later the step to install python3 globaly and to réinstaller pip

There are multiple way to do that, ex:using the distri packet, using python3 getpip.py, using python3 ensurepip.

For the other problem i don’t know, i need to check myself. In the mean time you Can try to use the packet After encoding in base64.

To do that you Can use python.
pyhon3

import base64
base64.b64encode(b’260054005210281229112911291216112911151228121512151216101600030c50132810291229112b1015112911161229111512141216111500030d50112812291129132811151228121512281215131412151215000d0500000000’)
b’MjYwMDU0MDA1MjEwMjgxMjI5MTEyOTExMjkxMjE2MTEyOTExMTUxMjI4MTIxNTEyMTUxMjE2MTAxNjAwMDMwYzUwMTMyODEwMjkxMjI5MTEyYjEwMTUxMTI5MTExNjEyMjkxMTE1MTIxNDEyMTYxMTE1MDAwMzBkNTAxMTI4MTIyOTExMjkxMzI4MTExNTEyMjgxMjE1MTIyODEyMTUxMzE0MTIxNTEyMTUwMDBkMDUwMDAwMDAwMA==

thanks for the hint about encoding in base64, but did not work.
Now we know the codes generated with the Android RM-Bridge can’t be used here, even if encoded…

I also tried on my Mac, but got the same error messages.
I am doing something wrong for sure, because I get the same error messages on all three ways…

Doing from my Mac now, sometimes I get this error:

 Learning mode... Please press the key on the remote control.
Traceback (most recent call last):
  File "packet.py", line 139, in send_packet
    response = self.sock.recvfrom(1024)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "packet.py", line 186, in <module>
    main()
  File "packet.py", line 180, in main
    packet=device.check_data()
  File "packet.py", line 162, in check_data
    response = self.send_packet(0x6a, packet)
  File "packet.py", line 141, in send_packet
    _LOGGER.error("Socket timeout...")
NameError: name '_LOGGER' is not defined

Update.
I have another RMPro and it worked with it.
So I got the packets from the working one and set up the other with the packets and it worked as well.

Another info is the portability of the packets…

We do could create an online database which could be feeded by everyone, couldn’t we?

if your are talking about rfcode i think it’s unique by device.
For ir code there are already some database but i don’t know if we can reuse.

example:
http://lirc.sourceforge.net/remotes/
http://irdb.tk/db/

if somebody smart or having lirc experiance read this post please let us know

some doc:


FYI for anyone else overly excited, the mini 3 is IR/WIFI only, no sensors and no RF… Some of the online descriptions for it appear to be cut and past from the RM pro devices.

Well it will still do what I need if the IR part works out.

1 Like

Yes, my idea is for IR only, once RF is unique.

I thing the Broadlink devices use a different codification for talking between hardware and E-control APP / Hass plugin, which, therefore, prevents us from using that database, at least the way it is there.

We could use phone’s IR blaster and Remote APP to create every code for most common devices through the script and RM-PRO or Mini3 and share them online.

And remembering that our purpose should be just simple actions that would link IR devices in automation sequences, for example turning off a TV when everyone leaves.

Sony TVs Power on and off codes (got them from Android Remote APP, once the original remote button is toggle)

  command_on: 'JgBUAFATExQnEyYUJxMUEyYUFBMnExQTExQTExQAAx5NFBIVJhQmFCcTFBMnExMUJxMTFBMTExQUAAMeTRQSFCcTJxQnExMUJhQSFSYUExMTFBQTFAANBQAAAAA='
  command_off: 'JgBUAFATJxMmFCcTJxQSFCgTEhQnExMUFBMTFBMAAw5OEycUJhMnFCcTExQnExMTJxQUExIUExQUAAMNTRQnEycTJxQmFBMUJhQTFCcTExQTExQTFAANBQAAAAA='

That is a fantastic US$ 13.00 solution for automating IR on every room.

Yes it is, however I do regret not paying a little more for the RM PRO 2… I should note as well that my mini 3s did not come with power supplies just USB cables.

i am unable to upgrade the broadlink rm-pro
actual firmware version V20022
to firmware version v20025
can somebody help?

When i try an upgrade i get a message “do firmware upgrade in your wifi”

does it have a temperature sensor?

please help.
can somebody explain the peering process for the broadlink rm pro
using broadlink e contorol android app
i do

  1. connect to my home wifi
  2. launch brodlink e-control
  3. click on add a new peripheral
  4. push on the reset buton of the rm pro until blink very fast
  5. add my wifi password

the rm pro connect to the router,
but i dont do not appear on the brodlink e-contol