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

Broadlink RM4 PRO is not able to learn or to send RF Signal #358

Closed Virtual-Nomad closed 3 years ago

Virtual-Nomad commented 4 years ago

Unsure if this is the right place to raise this issue, however, I cam across https://github.com/mjg59/python-broadlink/issues/355 which relates to a similar issue except with IR. Currently, I am trying to get my RM4 Pro to work with the HA and having issues bring able to learn RF (IR learns and sends no problem at all) with both python-broadlink and Home assistant. (I also have an issue with it as a sensor (temperature and humidity) - although not that concerned/interested in this side at the moment)

Current Setup Home Assistant 0.109.3 Broadlink RM4 Pro Added to network using python-broadlink - PASS when I attempt devices[0].host[0] > ‘192.168.1.172’ - PASS devices[0].get_type() > ‘Unknown’ - Cant get the type (so this may be a concern or compatibility issue) devices[0].enter_learning() > AttributeError: device instance has no attribute ‘enter_learning’ _FAIL

Under Home assistant Added to HA as switch - configuration.yaml switch: platform: broadlink host: 192.168.1.172 mac: 24:df:a7:b9:c0:5a type: rm4_pro timeout: 15 retry: 5 switches: tv_samsung_power: friendly_name: "Samsung TV Power" command_on: IRSTRING command_off: IRSTRING When I run broadlink.learn

As far as the sensor is concerned sensor: platform: broadlink host: 192.168.1.172 mac: 24:df:a7:b9:c0:5a type: rm4_pro monitored_conditions: temperature humidity Both Temperature and Humidity just show a value of 0

Do you know if anyone has been successful with the RM4 Pro and RF?

Another point is that I cant get the RM4 Pro to work with e-control (or broadlink manager) so have not been able to get any RF packets to test it broadlink.send command to see if that works.

joramos21 commented 3 years ago

I'm new to HA so won't be the best to test but I don't understand how to learn the RF signal. Isn't it possible to learn from Developer Tools > Services? I have RF plugs but these don't exist within HA as devices, and no entity_id. I tried your example but in my scripts.yaml file removing "script:" and moving code two spaces to the left to respect indentation.

felipediel commented 3 years ago

It will be possible after the release with the option command_type: rf.

joramos21 commented 3 years ago

Hi Felipe, Any news regarding RF implementation ? I didn't see anything new. Thank you very much. Jo

felipediel commented 3 years ago

Hi. It is supported now. You need to specify command_type: rf when learning.

script:
  learn_car_lock:
    sequence:
      - service: remote.learn_command
        data:
          entity_id: remote.garage
          device: car
          command: lock
          command_type: rf

You need to press the button two times. Follow the notifications to stay on track.

joramos21 commented 3 years ago

So great, I have been waiting for this youuuu :-)

I tried like to learn an ir code which is the easiest method for me, under development tools.

I chose remote.learn_command as Service.

Then remote.broadlink_remote as Entity

Then added under Services data :

entity_id: remote.broadlink_remote device: kitchen_lamp command: powerON command_type: rf

It didn't work. I clicked on Call Service button. The red light on the device turned on, I pressed twice on my rf remote that turned the light/lamp on as expected but the red light stayed on around 15-20 seconds. 

I then tried to call the service with remote.send_command but nothing happened.

I don't know how to find the broadlink integration version that is installed. It doesn't display that an update is needed. 

Thank you. 

Jo

felipediel commented 3 years ago

You need to press the button at the right time. Check the notifications during the process, they will guide you.

joramos21 commented 3 years ago

I tried again and no luck, even pressing many times, once the red led turn on, an another test waiting longer, and others tests pressing twice the button like you suggested, and more. I got the notification saying to press the button and nothing happens. With IR, when I press on the remote, then the red led turns off. Here, with RF, the led stays turned on 15-20 seconds and the code is not learned. I don't know where I could have a look at logs or a config file. Remote frequency is 433.92 Mhz. I thought maybe it is not compatible even it would suprise me. I read on amazon website, someone who bought a RM Pro+ saying it works with Intertechno Brand, which is what I have. No error messages notifications are displayed. It's like the Broadlink was not catching the signal.

joramos21 commented 3 years ago

One more thing. I jus tried with "command_type: rf" but pressed a button on an ir remote and it worked. I don't know if this is normal, it shouldn't. Maybe latest integration is not installed.

felipediel commented 3 years ago

Hi @joramos21. I just checked the master branch and realized that the update hasn't reached you yet. Sorry, we still need to wait a little, now it won't be long.

joramos21 commented 3 years ago

No problem. Better it is that.

joramos21 commented 3 years ago

Hi,

I've been waiting a while and have seen that someone was able to learn RF codes within HA like below but prior pressing the CALL SERVICE button the guy was using at the same time the Broadlink app to tell the Broadlink pro to set as RF.

So I did this under development tools.

I chose remote.learn_command as Service. Then remote.broadlink_remote as Entity Then added under Services data :

entity_id: remote.broadlink_remote device: kitchen_lamp command: powerON command_type: rf

It didn't work. I clicked on Call Service button. The red light on the device turned on, I pressed on the rf remote that turned the light/lamp on (and it turned on as expected) but the red light stayed on around 15-20 seconds and the command wasn't learned.

Is it ready now ?

Thank you.

Good day.

Jo

joramos21 commented 3 years ago

I answer to myself. I found a solution that works for me using the Android Broadlink app (that I wanted avoid using). You can see explanations here https://community.home-assistant.io/t/guide-how-to-learn-broadlink-rf-codes/62119/152, post 150. As a summary :

  1. go to Developpers to learn the RF code
  2. go to the application and be prepared to learn an RF code
  3. Press on the "CALL SERVICE" button then press the button on the Broadlink app to learn the code and finally, press on the remote Cheers :-)
felipediel commented 3 years ago

RF features are now supported in Home Assistant. Closing.

Kavish85 commented 3 years ago

Hi @felipediel. I have tried all whichever way and the RF simply does not work.

I open the Broadlink App on my phone, then initiate remote.learn on HA and call service. I get as far as “press & hold the button X” which I keep pressed even after the notification disappears. I don’t ever see the second “press the button X".

Is something perhaps broken or am I doing something wrong?

felipediel commented 3 years ago

You don't need the Broadlink app. Use remote.learn_command in Home Asssistant with the 'command_type: rf' attribute. Don't hold the button for too long. You need to follow the notifications to know when to stop and press the button again in the end.

Kavish85 commented 3 years ago

I've got it setup as follows and then click "Call Service" and immediately follow the notification on HA by pressing the button on the Broadlink light switch and still nothing. Any other suggestions?

service: remote.learn_command target: entity_id: remote.wi_fi_universal_remote_remote device_id: 1815da26aedbcb5d65a2e7984621c35c data: device: kitchen lights command_type: rf command: 'on'

felipediel commented 3 years ago

Don't use 'on' for the command, this is a reserved word in YAML.

Kavish85 commented 3 years ago

Should I leave out the quotation marks from 'on'?

felipediel commented 3 years ago

Don't use this word. Change it to 'turn on'.

Kavish85 commented 3 years ago

Sadly that doesn't seem to work. Also tried 'power on', and tried turn on and power on without the inverted commas.

Kavish85 commented 3 years ago

Silly question. Should I copy and paste this into the configuration.yaml file prior to learning the command?

service: remote.learn_command target: entity_id: remote.wi_fi_universal_remote_remote device_id: 1815da26aedbcb5d65a2e7984621c35c data: device: kitchen lights command_type: rf command: 'turn on'

Kavish85 commented 3 years ago

After 3 weeks of Broadlink's crappy process that just doesn't work, it made sense to move to Eachen smart switches. Discovered within HA and setup in 6 minutes.

felipediel commented 3 years ago

Awesome, another happy customer. Have a good one.