Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Red RM Mini 3 does not work #30215

Closed
tota-5 opened this issue Dec 25, 2019 · 454 comments · Fixed by #32523
Closed

Red RM Mini 3 does not work #30215

tota-5 opened this issue Dec 25, 2019 · 454 comments · Fixed by #32523

Comments

@tota-5
Copy link

tota-5 commented Dec 25, 2019

The different (I don't know if it's new or not) RM Mini colored red does not work with broadlink component.

I used broadlink_cli to try to get it into learning mode and got the following:

AttributeError: device instance has no attribute 'enter_learning'

In home assistant, the commands just don't execute in the device, altho the buttons goes from on to off normally.

The firmware on this is 44057
Model: RM mini 3
FCC ID: 2ACDZ-RMMINI3-RM

On intelligent home center app from broadlink, the devices work as intended.
It has no firmware upgrades available for it.
On e-control app, it shows as unrecognized device, but shows.

Using broadlink manager gives the following:
image

It seems that even tho it's looks like exactly the same model, it operates differently and has a different model number and api to authenticate and recieve learn and send signals.

@probot-home-assistant
Copy link

Hey there @Danielhiversen, @felipediel, mind taking a look at this issue as its been labeled with a integration (broadlink) you are listed as a codeowner for? Thanks!

@tota-5
Copy link
Author

tota-5 commented Dec 26, 2019

i have the devices, I can cooperate as much as needed to help integrate this aparentelly new device. I can get online to help figure out what's going on.

@dennisadvani
Copy link

Have a similar issue, I have more than one of the RM Mini 3's, the one running firmware v55 works fine with HA but the others running 44057 aren't responding to HA but work with the Broadlink app. HA doesn't error out with send commands but the 44057 units don't seem to be receiving them or responding to them.

@felipediel
Copy link
Contributor

felipediel commented Jan 24, 2020

This issue should be addressed to https://github.com/mjg59/python-broadlink, since all the communication with the device is being handled there.

@tota-5
Copy link
Author

tota-5 commented Jan 30, 2020

Dennis, my red rm mini runs this exact same firmware, so I'm guessing it has nothing to do with the model, but the firmware.

Felipe, how do we proceed in moving the issue?

@tota-5
Copy link
Author

tota-5 commented Jan 30, 2020

Felipe, I would be happy to lend my time and try to get this older firmware responding to ha broadlink component

@felipediel
Copy link
Contributor

I don't have this device, so it is difficult for me to contribute to this topic, but I encountered some open issues involving the Broadlink RM 3 Mini and the Broadlink API. Perhaps you can help them find a solution, which will be reflected here.

mjg59/python-broadlink#274
mjg59/python-broadlink#307
mjg59/python-broadlink#308

@dennisadvani
Copy link

dennisadvani commented Jan 30, 2020

Hey @ariel-madril as @felipediel mentioned earlier, this is not an issue for home assistant to fix. Home assistant uses the python-broadlink module to interact with the devices. I'm watching the three issue threads mentioned above hoping for someone to solve this.

From what I understand, there are a number of variations of RM Mini 3's, the international versions run the v55 firmware and work with python-broadlink out of the box. The Chinese variants can still be discovered but they come up with different types (0x5f36) and run the 44057 firmware however, they cannot send or receive codes successfully, even after adding the 0x5f36 type to the module. Below is an extract of the two discovered types, top one being the working international version that I have.

###########################################
RM2
# broadlink_cli --type 0x2737 --host 192.168.xxx.xxx --mac 164248xxxxxx
Device file data (to be used with --device @filename in broadlink_cli) : 
0x2737 192.168.xxx.xxx 164248xxxxxx
temperature = 0.0

###########################################
RM2
# broadlink_cli --type 0x5f36 --host 192.168.xxx.xxx  --mac 7d4f7axxxxxx
Device file data (to be used with --device @filename in broadlink_cli) : 
0x5f36 192.168.xxx.xxx 7d4f7axxxxxx
temperature = False

@felipediel
Copy link
Contributor

felipediel commented Jan 30, 2020

Here are some steps that may be helpful for someone who has this device and is willing to solve the problem:

  1. Create a venv and install https://github.com/mjg59/python-broadlink.
  2. Find a way to control the device through your computer. Try using Broadlink Manager. If it doesn't work, you will need to install an Android emulator on your computer and run e-Control (the next step probably won't work with IHC because it is cloud based).
  3. Install Wireshark and analyze the communication between the application and the device. Check the packages that authenticate, send and receive commands. Are they different from the packages collected from a supported device?
  4. Try to understand communication patterns and replicate them. If you understand what is being done different, you can extend the 'rm' class at https://github.com/mjg59/python-broadlink/blob/master/broadlink/__init__.py to support the device.
  5. PR the solution, many people are waiting for it.

@felipediel
Copy link
Contributor

Here you can find some clues to identify where the problem is: #23566.

@wchkcn
Copy link

wchkcn commented Feb 2, 2020

Seems Broadlink and ihc apps config devices differently. Couldn't get HA / Broadlink Manager work with my RM3 mini set up using BL but ihc is ok. Hope it helps.

@QuadrifoglioVerde
Copy link

Hi, same problem, but found solution, RM3 Mini 44xxx FW, reset device by long press until led rapidly flash, use BroadLink app to connect to WiFi (keep phone close to RM). AND STOP!! Do nothing more, dont't add anything more, quit app and now everything in HA works! ha... funny right?

@dennisadvani
Copy link

Hey @QuadrifoglioVerde and @wai00cheung, I've tried the long reset and configured wifi using the Broadlink e-control app, the new Broadlink app as well as the IHC app. I've also tried re-configuring the wifi using python-broadlink and in all cases, I can't send or receive from the python-broadlink CLI or from HA.

@QuadrifoglioVerde
Copy link

@dennisadvani I use ?newer? Broadlink app (not e-control) for configure WiFi , HA and Broadlink manager works, when i configure some device in Broadlink app then nothing works (HA can't connect, Broadlink Manager not responding to learn).

@dennisadvani
Copy link

Thanks for confirming @QuadrifoglioVerde are you able to share your firmware number and Device type? I'll try a few more times with the Broadlink app.

@goose2600
Copy link

goose2600 commented Feb 3, 2020

@QuadrifoglioVerde did you mean the Broadlink app (blue icon and white dots) or Ihc for EU?
Do you use in in HA as remote or as switch?
Is the FCC ID 2ACDZ-RMMINI3-RM?
Can you share your device type?

I tried a couple of times, also creating a new broadlink account, but still not working for me.

@QuadrifoglioVerde
Copy link

@dennisadvani and @goose2600 I used this app:
https://play.google.com/store/apps/details?id=cn.com.broadlink.econtrol.international
and my device is RM mini 3, 2ACDZ-RMMINI3-RM, FW 44057
(my exact steps is remove all configured devices in this app > reset RM, configure WIFi > remove app, and now everything works), there is 2 methods of reset, first long press (rapid flash, ?configure over bluetooth?), and second long press (slow flash, AP mode))
HA code:

switch:
  - platform: broadlink
    host: IP
    mac: 'mac'
    type: rm_mini
    timeout: 15
    friendly_name: Broadlink

@wchkcn
Copy link

wchkcn commented Feb 3, 2020

-mine fw 44059
-cleared everything from the Broadlink mobile app then set up using ihc non-eu and both HA and Broadlink Manager works
-suggest to use BL Manager to test the connection first
-not sure it might be a region/country specific solution

@goose2600
Copy link

goose2600 commented Feb 3, 2020

@QuadrifoglioVerde @wai00cheung

Mine (copied from "device info" menu in the android app):
Firmware: v44057
Iot Cloud: World
Data Cloud: Europe

Python-broadlink discovery cli cannot find any device.
BL Manager for Windows find an unknown device and cannot connect to it.

My exact steps are:

  • Remove any devices from any Broadlink app;
  • Clear data and cache in the Broadlink app (https://play.google.com/store/apps/details?id=cn.com.broadlink.econtrol.international);
  • Login in the Broadlink app with my account;
  • Set Italy as zone;
  • Tap on plus to ad a new device;
  • Tap on the discovered device and setup wifi credentials;
  • Finalize setup tapping on "Join Room" (should I have to finalize the setup or to stop just when Mini led stops blinking?);
  • Exit from the app without adding any appliance.

I added a switch like @QuadrifoglioVerde but learnig is not working from HA (led is not blinking) and I guess also sending commands is not working.

@Siytek
Copy link

Siytek commented Feb 3, 2020

Here are some steps that may be helpful for someone who has this device and is willing to solve the problem:

  1. Create a venv and install https://github.com/mjg59/python-broadlink.
  2. Find a way to control the device through your computer. Try using Broadlink Manager. If it doesn't work, you will need to install an Android emulator on your computer and run e-Control (the next step probably won't work with IHC because it is cloud based).
  3. Install Wireshark and analyze the communication between the application and the device. Check the packages that authenticate, send and receive commands. Are they different from the packages collected from a supported device?
  4. Try to understand communication patterns and replicate them. If you understand what is being done different, you can extend the 'rm' class at https://github.com/mjg59/python-broadlink/blob/master/broadlink/__init__.py to support the device.
  5. PR the solution, many people are waiting for it.

I got as far as capturing some traffic in Wireshark, dumps available to download here if anyone wants to take a look.

@goose2600
Copy link

goose2600 commented Feb 4, 2020

@Siytek I have a couple of questions:
Is your mini discoverable via Python-broadlink cli (broadlink_discover)?
And what about Broadlink Manger for Windows?
The mine is not discoverable via cli (finding no devices). And regarding broadlink manager, looks exactly like the picture in the first post (unknown device).

I am still looking for a way to find the device type for my Mini!
I think it is 0x5f36 because the old broadlink plugin for tasker find a 0x5f36 device, anyway I am not sure.

@tota-5
Copy link
Author

tota-5 commented Feb 4, 2020

@goose2600 I managed to get broadlink manager to pick up my device, but it just shows errors when it does...usually it picks up the other ones I have that works properly. I wanted to post a pic of the error, but I'm trying to get it to connect to the red one, and it doesnt...

I hate how it doesnt let me pick up from a known device list instead of having to rely on the "scan" button...

I would turn the others off, but they are mounted on the ceilling and opening the sockets would mean breaking some of the holder and redoing it latter...

@QuadrifoglioVerde
Copy link

QuadrifoglioVerde commented Feb 4, 2020

@goose2600 do not add device to room, stop at this step, when led stops blinking then quit. btw i choose Czech Republic if that helps.
Screenshot_20200203-174551

@Siytek
Copy link

Siytek commented Feb 4, 2020

@Siytek I have a couple of questions:
Is your mini discoverable via Python-broadlink cli (broadlink_discover)?
And what about Broadlink Manger for Windows?
The mine is not discoverable via cli (finding no devices). And regarding broadlink manager, looks exactly like the picture in the first post (unknown device).

I am still looking for a way to find the device type for my Mini!
I think it is 0x5f36 because the old broadlink plugin for tasker find a 0x5f36 device, anyway I am not sure.

@goose2600 yes I can set up my device in Broadlink Manager using my Windows laptop. Once it is on the network I am able to discover it with Python-broadlink cli via my Ubuntu server...

$ sudo ./broadlink_discovery 
Discovering...
###########################################
Unknown
# broadlink_cli --type 0x5f36 --host 192.168.1.121 --mac xxxxxxxxxxxx
Device file data (to be used with --device @filename in broadlink_cli) : 
0x5f36 192.168.1.121 xxxxxxxxxxxx

I have added device ID 0x5f36 to _ init _.py prior to running Broadlink_discovery, not sure if it makes a difference here as I did not try it without the edit. However I am unable to learn commands from any platform other than the Broadlink app.

@goose2600
Copy link

goose2600 commented Feb 4, 2020

Thanks to everybody.

@QuadrifoglioVerde
Now my Mini is configured like yours.
Is your device discoverable via Python-broadlink cli?
Here is still undiscoverable.

Broadlink manager for Windows keeps discovering an unknown device.
In the program log the discovered device type is 24374 (converted to hex is 5f36).

@Siytek
Copy link

Siytek commented Feb 4, 2020

Thanks to everybody.

@QuadrifoglioVerde
Now my Mini is configured like yours.
Is your device discoverable via Python-broadlink cli?

Did you try adding 5f36 to __init__.py?

Also when you reset it to discovery mode, is the LED flashing intermittently or quickly/consistently?

@QuadrifoglioVerde
Copy link

@goose2600 my device (?PID?) is 3727, and works in all apps, include python-broadlink.
If i configure something more in android app then python-broadlink return auth error, HA says connection error, and manager see device but can't establish connection (hangs on connecting... message).

@goose2600
Copy link

Before to test I modified the init.py and while in discovery mode the led is blinking quickly/consistently (I am not in AP mode).
Could you please check the python broadlink lib version (mine is 0.12)?

@felipediel
Copy link
Contributor

@chemelli74 Do you remember what caused the storage error? And how did you solve it? There is another user reporting this error, but I don't have the device to reproduce it.

@chemelli74
Copy link
Contributor

@chemelli74 Do you remember what caused the storage error? And how did you solve it? There is another user reporting this error, but I don't have the device to reproduce it.

I have only a wild guess about it: I learned a lot of codes to understand the on/off thing when I saw it, so I bet it's related to the time last code stays in device cache.
A reboot of the device seems to have cleaned it for me.

Simone

@felipediel
Copy link
Contributor

I think there are some things we still don't know about those special headers. Perhaps they contain flags like "store this code" or "clear the cache". I will investigate further when I have the device.

@maorbenamer
Copy link

maorbenamer commented May 20, 2020

I think there are some things we still don't know about those special headers. Perhaps they contain flags like "store this code" or "clear the cache". I will investigate further when I have the device.

Same issue here, RM4 Pro, i am also get the error "Failed to enter learning mode: The device storage is full".
I've tried restart the device and also reset to factory and the error still display every time i call the learning or sending service.
any idea?

@felipediel
Copy link
Contributor

I found a few different headers in my files and created a possible solution. Can anyone help me test it?

@chemelli74
Copy link
Contributor

I found a few different headers in my files and created a possible solution. Can anyone help me test it?

Library updated. What should I test ?

Simone

@felipediel
Copy link
Contributor

@chemelli74 Try to reproduce the error with this new version.

@chemelli74
Copy link
Contributor

@chemelli74 Try to reproduce the error with this new version.

ahahahah, first code learned and:

2020-05-21 00:34:47 ERROR (MainThread) [homeassistant.components.broadlink] Failed to learn: The device storage is full

Simone

@felipediel
Copy link
Contributor

Let's try with another header that I found here, just a sec.

@felipediel
Copy link
Contributor

I just updated the file. You need to get rid of the error before trying again (don't ask me how).

@felipediel
Copy link
Contributor

If you open a terminal and try device.check_data(), does the problem persist?

@chemelli74
Copy link
Contributor

If you open a terminal and try device.check_data(), does the problem persist?

bash-5.0# python
Python 3.7.7 (default, Apr 28 2020, 13:57:57)
[GCC 9.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import broadlink
>>> devices = broadlink.discover(timeout=5)
>>> devices[0].check_data()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/site-packages/broadlink/__init__.py", line 600, in check_data
    check_error(response[0x22:0x24])
  File "/usr/local/lib/python3.7/site-packages/broadlink/exceptions.py", line 97, in check_error
    raise exception(error_code)
broadlink.exceptions.AuthorizationError: Control key is expired
>>>

Simone

@felipediel
Copy link
Contributor

You need to authenticate first: devices[0].auth()

@chemelli74
Copy link
Contributor

You need to authenticate first: devices[0].auth()

Sorry, a bit tired ;-)

>>> devices[0].auth()
True
>>> devices[0].check_data()
b'&\x00\xe6\x00i:\x0e+\x0e+\r\x0f\x0f\x0f\x0e\x0f\x0e+\x0e\x0f\x0e\x10\r+\x0e+\x0e\x0f\x0e+\x0e\x0f\x0e\x10\r+\x0e+\r\x10\x0e+\x0e+\x0e\x0f\x0e\x10\x0c,\x0e\x10\r\x10\x0e+\x0e\x0f\x0e\x0f\r\x10\x0e\x10\r\x10\x0e\x0f\x0e\x0f\x0e\x10\r\x10\x0f\x0e\x0e\x10\r\x10\x0e\x0f\r\x10\r\x11\x0c\x11\r\x10\r,\x0e\x0f\r\x10\x0e+\r\x10\r\x11\r\x10\x0e\x0f\x0e\x0f\x0e+\x0e\x0f\x0e\x10\r\x10\x0e\x0f\r,\r,\x0e*\r\x11\r\x10\x0e\x0f\x0e\x10\x0e*\x0e\x10\r+\x0e\x10\r+\x0e+\x0e+\x0e\x0f\r\x10\x0e\x10\x0e\x0f\r\x10\r\x11\r\x10\x0e\x0f\x0e\x0f\r\x11\x0e\x0f\x0e\x0f\x0e\x0f\x0e\x10\r\x10\x0e\x0f\r\x10\r\x11\x0e\x0f\x0e\x0f\r\x10\x0e\x10\x0e\x0f\r\x10\x0e\x10\x0c\x11\r\x10\x0e\x0f\x0e\x10\r\x10\x0e\x0f\r\x10\r\x11\r\x10\r\x10\x0e+\x0e\x0f\x0e\x10\r\x10\r\x10\x0e\x0f\r\x11\r\x00\r\x05\x00\x00'
>>>

Simone

@felipediel
Copy link
Contributor

The error persists. The truth is that we always had this error, but it was going unnoticed. If we can’t solve it, I think it’s okay to ignore it.

@chemelli74
Copy link
Contributor

chemelli74 commented May 20, 2020

The error persists. The truth is that we always had this error, but it was going unnoticed. If we can’t solve it, I think it’s okay to ignore it.

If you mean that it was always logged, I'm sure it was not the case. But maybe it was the time that my device was not authenticated.

Simone

@felipediel
Copy link
Contributor

I recently changed the library to raise firmware errors. This error can only be identified after the update. I will keep trying to handle it correctly, I would not like to ignore this exception. But if we do not succeed, I do not discard this option.

@felipediel
Copy link
Contributor

felipediel commented May 21, 2020

I made a script to learn 10,000 codes combining my remotes (one receives and the other sends) and I still didn't get any storage error. So I think this problem is only related to RM4 series.

@felipediel
Copy link
Contributor

felipediel commented May 21, 2020

I just realized that the problem has nothing to do with those special headers because 0x2737 has the same problem and does not use them.

@felipediel
Copy link
Contributor

@chemelli74 I solved the problem. Here is the solution, in case you need it before the release.

@chemelli74
Copy link
Contributor

@chemelli74 I solved the problem. Here is the solution, in case you need it before the release.

@felipediel, finally tested:

2020-05-28 19:26:26 ERROR (MainThread) [homeassistant.components.remote] Error while setting up broadlink platform for remote
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/src/homeassistant/homeassistant/components/broadlink/remote.py", line 133, in async_setup_platform
    devices = await hass.async_add_executor_job(discover)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/broadlink/__init__.py", line 79, in discover
    local_ip_address = socket.gethostbyname(socket.gethostname())
socket.gaierror: [Errno -2] Name does not resolve

Issue is related to /etc/host missing entry:

bash-5.0# cat /etc/hosts
# Any manual change will be lost if the host name is changed or system upgrades.
127.0.0.1       localhost
::1             localhost
127.0.0.1       HomeNAS
::1             HomeNAS

if I add "127.0.0.1 <container name>" then it start working again.
so "homeassistant" for my production and "homeassistant-test" for my test environment.

But now I get this issue:

2020-05-28 19:38:14 ERROR (MainThread) [homeassistant.components.broadlink.remote] The correct class and type for 192.168.xxx.yy are <class 'broadlink.rm'> and 0x2737. The selected class is <class 'broadlink.rm'>
Simone

@felipediel
Copy link
Contributor

@chemelli74 Sorry, the instructions are out of date. The solution is already part of the Home Assistant (0.110.2). I just changed the instructions in case you need to revert.

@chemelli74
Copy link
Contributor

chemelli74 commented May 28, 2020

Tested with fresh 0.110.3 docker container and get the same error message:

2020-05-29 00:46:43 ERROR (MainThread) [homeassistant.components.broadlink.remote] The correct class and type for 192.168.xxx.yy are <class 'broadlink.rm'> and 0x2737. The selected class is <class 'broadlink.rm'>

Simone

@felipediel
Copy link
Contributor

This is the remote.py you took earlier. The clean installation does not have these error messages.

@felipediel
Copy link
Contributor

Hi guys. Please do not update before this PR is merged. 0x5f36 is unstable at 0.115.

@fedebruni84
Copy link

Hi guys. Please do not update before this PR is merged. 0x5f36 is unstable at 0.115.

Hi Felipe,
thank you. I was on the 115 beta but the integration gave me "storage error" so I turned back di 0.114. Now I know why.

@vmlf-domotica
Copy link

INTEGRACION RM MINI 3 FIRMWARE: 44057 EN HOME ASSSITANT
La solucion que me funciona para leer codigos con rm mini 3 y luego poder emitirlos desde home assistant:
• Pulsamos Configuracion --> Integraciones y buscamos broadlink
• Nos pide la Ip del dispositivo, pero si hemos añadido nuestro rm mini 3 a la nube nos sale el siguiente mensaje:
o Su dispositivo está bloqueado para la autenticación. Siga las instrucciones para desbloquearlo:

  1. Reinicie el dispositivo de fábrica.
  2. Use la aplicación oficial para agregar el dispositivo a su red local.
  3. Pare. No termine la configuración. Cierre la aplicación.
  4. Haga clic en Enviar.
    Ejecutamos los puntos anteriores y nos vamos a servicios:

1
2

El codigo aprendido se introduce en el archivo:
\hassio\homeassistant.storage\broadlink_remote_a043b076ce9c_codes

Copiamos el codigo en un switch:

22-02-2021 20-32-50

@daarek2
Copy link

daarek2 commented Apr 13, 2021

Works with : ihc ver. 1.9.50

@felipediel
Copy link
Contributor

All issues reported here have been resolved. If anyone has an issue, please open a new case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.