Broadlink RM4 PRO in home assistant

hey all

just got a new broadlink rm4 pro.
first thing i did was to let it find the right configuration for my AC unit - which it did successfully!

I didnt need to teach it anything, it offered me a configuration based on my ac manufacture, and a min l8r i could control the ac from my phone. so far - great.

adding it to HA was just as simple with the broadlink integration. or so i thought…
so…

how do i extract the different commands that the “app” on my phone already news, to use in HA?

i thought it will be as easy as with the logitech “harmoney” hub, but so far i couldnt figure out what the best way (or anyways for that matter…) to do it for myself :slight_smile:

i’d love some help with this

cheers

2 Likes

Here is what I use with similar case.

thanks for the pointer :slight_smile:

i take it there is no “easy way” of maybe creating scripts with specific commands?

is adding the “smart ir” component is the best way to go about this?

Sadly, also to my disappointment, there is no Broadlink integration yet, which just takes over everything from your app. I wish, it would happen soon, but that’s not in line of sight.
You will have to DIY…

1 Like

understood. sadly…

so…
by now i have already figured this out. with @taikapanu aikapanu pointer, and a video from Hive Mind Automation

wasn’t that bad, just took a little time to find the right codes for my AC.

thanks all :slight_smile:

2 Likes

SmartIR is brilliant. I’ve been using it for years. It will let you create a Climate entity for your AC unit and have all the required functions. It really is easy. There is no need to create scripts or anything. The hardest part will be accessing the codes if that model of AC isn’t already in the database.

I fully agree with @sparkydave.

Using 5 Broadlink RM4 minis for 5 split AC’s here, put them inside the cover of the indoor units and control them through SmartIR. As for Lovelace I am using nervetattoo / simple-thermostat.

The setup is not that hard and it is working reliably without hiccups. Basically just set and forget.

1 Like

That card looks cool! Have to give it a run as well!

hey guys

i have a follow-up question about the “power_sensor” part.

my ac unit is monitored by a power sensor, that reports power consumption on its own, i just dont understand where it shows in the thermostat card.

anyone knows?

It doesn’t ‘show’ it in the card as such. The idea is that you use the power value to create a binary_sensor which is either on/off based on the status of the A/C unit. That binary_sensor then reports the A/C on/off state in the card by showing the unit as on/off (or changing the icon colour).

here is an example from one of my devices:

binary_sensor:
  - platform: template
    sensors:
      lounge_gas_heater_power:
        friendly_name: "Lounge Gas Heater Power"
        device_class: "power"
        value_template: "{{ states('sensor.gas_heater_plug_power')  | float > 20 }}"
climate:
  - platform: smartir
    name: Lounge Gas Heater
    unique_id: lounge_gas
    device_code: 99999
    controller_data: remote.lounge_ir_remote
    temperature_sensor: sensor.lounge_multisensor_temperature
    humidity_sensor: sensor.lounge_multisensor_relative_humidity
    power_sensor: binary_sensor.lounge_gas_heater_power

ohhhhh… now i understand the “on-off” reference for the “power_sensor” on the smartir web page.

so if i understand correctly:

the first part is to make a “true/false”, “yes/no” sensor that is based on “power consumption” from another sensor, with a “templates”.
in your case - if power consumption is under 20, the “new” sensor will repot as “false”, and if your “gas heater plug power” consumption is over 20, it will report as “true”.

after “planting” that new sensor in the “climate” integration, the climate card will also report “on/off” based on the new sensor.

make perfect sense (if i’m right… :))
thanks!

Exactly.

You got it!

cool!
thanks man

i have 2 more folow-up Q based on that, since i can imaging you have encountered them by yourself already :

  1. where did you get the info on how to make that template with the “float > 20” algorithm (it makes me wanna explore what other stuff im missing out on…)

  2. what “better” animations or color differentiation can i force on the climate card to make a better visualization on its “on/off” state (and how do i enforce them)?

cheers

You could probably use this:

I think i might missed a step

i made a sensor like you suggested, that report back “true\false”, and put it as the power_sensor, in the configuration.
however, although the sensor its reporting “true”, the climate card reports the AC unit as “off”
(after using the AC remote unit, and not HA, for turning it on)

i believe its cause my sensor reports back “true” and not “on” (when i changed the sensor manually from true to “on” - it works)

how to i use the template you showed (or other) to get the sensor to report “on/off” instead of “true/false” ?
(i could create an automation for that “true/false” sensor to toggle an input boolean switch on/off, and use that, but i rather think there is a “better” way…)
isn’t there…?!
any thought?
:slight_smile:

P.s
my programing skills are poor, but i think i figured it out. i will leave it here for anyone else that might need it, and for you all to correct my mistakes:

“{% if states(‘THE.NAME.OF.THE.SENSOR’) | float > 30 %} on {% elif states(‘THE.NAME.OF.THE.SENSOR’) | float < 30%} off {% endif %}”

this will bring back “ON” result when the measuring units that THE.NAME.OF.THE.SENSOR are monitoring will be above 30, and “off” when they r under.

Did you include the device_class: power bit of code in the template sensor?

Using the code I posted above I get:

i did!
and i still do.
im using a sonoff pow2 for measuring the power draw from “mains”.
but using your code, the new sensor reported back - “true/false”.
with the code i posted its now reporting “yes/no”. and the card works great with a “good enough” distinction between how it looks when the ac i on or off (it didnt do that b4, cause the sensor was not reporting correctly).
now all is fine, and thank you so much for all your help.
i appreciate it
cheers

No worries, happy to help.

I have a learning remote which I want to assign a button to launch a HA script.
The button has no function assigned so I thought I could send a code from HA.

Is there a way to create a dummy code using a base64 string?

I can’t why not.