Broadlink RM-PRO and A1 sensor

but how to get status?

Impossible!
Unfortunately I think use switch is not a good idea. Better would be if there was a button.
All remote controls have buttons not switches :slight_smile:

In fact, there is no way to get status back from any IR device, unless you look at it, or check a sensor status changing, such as, turn on AC and check for the temperature variation…

On the other hand, we have RF devices as well, which can inform status or not. Most of them do not inform their status, therefore we need to use different RF signals for turning ON and OFF, what allows sending two or three times the same ON or OFF signal to make sure it had worked.
A RF device with toggle commands is useless for automation rules.

But that is a Whole RF/IR World problem!!!

For RF devices we have better alternatives, such as RFXTRX and RFLINK (which is already being added on HASS).

But for IR devices, Broadlink seems to be the best cost-benefit.

I think the problem about push, switch or assumed_state buttons should be solved later by creating a push button on HASS.

The best step forward will be let us free from android bridge.

The best way to control a IR device is and will allways be using the original remote control.
If we could just send a broadlink IR command throught as an automation action, would already be awesome!!! Even without a push button on the user interface.

I have a plenty of Livolo Switches (RF controlled with Toggle Button and OFF button - there is no ON Button), which I have controlled using switches.
I need two virtual switches for each lamp. One is toggle and the other is OFF.
The frontend interface is far from ideal, but it works… when everybody is out of home, I can turn all lights off (for sure) sending a toggle command twice for the OFF switches (I send twice to be sure it will work), and when Kodi pauses, I send a toggle command for the switch I want just once (sometimes it does not work).

OK, I start developing switch.

Example configuration will be:

switch:
  platform: broadlink
  host:
  mac: 
  switches:
     platter11_light:
       - command_on: 'packet'
       - command_off: 'packet'

At this stage unfortunately we will not have button.
For devices which some function are controlled with a single button (turn TV on/off) we can
set variables command_on and command_off with the same IR/RF packet.

3 Likes

Is it compatible with Broadlink Black Bean?

Great!

with command_line works perfectly for both IR and RF

1 Like

There is currently no established support for infrared universal devices…

There are few people trying to create that compatibility for Broadlink devices on this forum…

Certanly this would be the cheapest way to control unsmart IR devices:

I think in a few weeks we will see all Broadlink products full compatible with HASS…

2 Likes

with or without the Android Bridge running???

with, so far I don-t mind, because I do use an android phone as remote/HA client

Ok, I think is done:

Please test switch: http://pastebin.com/GuEtnUMM

Example configuration.yaml

switch:
  platform: broadlink
  host: 10.0.0.10
  mac: "B4:43:0D:C3:F8:42"
  switches:
    reciever:
      friendly_name: "Reciever"
      command_on: 'JgBYAAABJpMTEhM2ExISOBM3EzYTNxMSEjgTEhM2ExITEhMSEhMTNxISEzcTEhM3EzcTEhMSExISNxITEjgTEhMSEzYTNxM3EwAFFAABJUoSAAxNAAEmSRMADQU='
      command_off: 'JgBYAAABJpMTEhM2ExISOBM3EzYTNxMSEjgTEhM2ExITEhMSEhMTNxISEzcTEhM3EzcTEhMSExISNxITEjgTEhMSEzYTNxM3EwAFFAABJUoSAAxNAAEmSRMADQU='

command_on and command_off is a base64 encoded packet from broadlink (to be user friendly string :slight_smile: ). To sniff packets please use this tool: http://pastebin.com/gFB66sVM

Only change ip_addr and mac_addr with your in this tool and in configuration.

If everything is ok I upload to github.

And again: Sorry for my bad English. I start learning in next month :wink:

2 Likes

Newb here.

How to sniff packets. Can you give me some instructions? I am using windows

how to name the file, and where to put it?

Great!!
It works fine here with the broadlink rm mini.
I would suggest adding assumed_state = True. Ex https://github.com/home-assistant/home-assistant/blob/f006b00dc1a308b850e4e2a75583201ce50e3207/homeassistant/components/switch/command_line.py#L125

Would it be possible to continuous listen for received rf signal. So if someone press the remote control the rm device will capture the signal and change the status in HA ?

Add the file here:
.homeassistant/custom_components/switch/broadlink.py

I think it’s possible, thank you for this idea. Tomorrow will fix it. In my country it is too late and I go to bed now.

Edit: Actually, probably not possible because RM devices recieve commands only in learning mode. Then passes to the transmit mode, but I’m sure tomorrow will test

How to sniff packets. Can you give me some instructions? I am using windows

Save source in file packet.py.
Change IP address and MAC address with your broadlink device addresses in file.

ip_addr= your broadlink IP address
mac_addr= your broadlink MAC address

Change this line: os.system(‘clear’) with os.system(‘cls’)

Run file from console: python3.5 packet.py

Press any key from remote control. Copy packet string and paste in configuration.yaml
If remote device use same key for Turn ON/OFF - paste same packet for command_on and command_off

( If I wrong somewhere excuse me but I’m penguin fan :slight_smile: )

5 Likes
3 Likes

So far I use the command_line and RM bridge.

This is better? No need for RM Bridge program?

Yes, no need for RM bridge program

How does this work? (sorry newb here).

I mean how to sniff the IR or RF command and get the string to use in command_on and off?

also the android program “RM Tasker plugin” will be obsolete, right?