Brain storming on a ESPHOME IR/RF blaster use

Hi there

I successfully converted a tuya IR/RF smart remote to esphome, meaning that now I can use esphome to program it :slight_smile:

I’m a newbie with esphome, this is my first experience.

Before conversion, I managed to use the remote to manage a RF ceiling fan with its lamp and an IR AirCon.

Now I see I can learn the commands, both IR and RF, but sincerely I don’t know how to start.

for the IR part, I’d like to use it with SmartIR (which I’m already using for an identical aircon), just not to re-learn all the commands.
I see that SmartIR can be used with esphome, but I don’t understand how

for the RF one, which is the easiest way? a fan and lamp object on esphome? and if so, how do I send commands? I totally missed it.

Finally, I’d like (but it’s not a priority) con use the receiving capacity of my blaster to keep in sync HA if I use the lamp/aircon remote. is it feasible?

TIA for any kind of help

I don’t know SmartIR and how to use it on esphome. There are other options for IR though…

For the fan you could use template fan, something like this:

fan:
  - platform: template
    name: "Virtual Fan"
    id: fan1
    speed_count: 3
    on_speed_set:
      then:
        - if:
            condition:
              lambda: |-
                return x == 1; #fan speed 1
            then:
              - remote_transmitter.transmit_raw:
                  code: [729, -247, 242, -732, 745, -228, 736, -233, 241, -765, 225, -765, 719, -261, 704, -247, 218]
                  repeat:
                    times: 3

(just a random code for illustration)

HI, thank you for your hint…
will try and will let you know :slight_smile:

I mean, the remote signal is random, not the yaml. Just replace the code: with yours.

1 Like

With IR and low-tech RF (which is the majority of devices and which is probably yours since you already managed to easily interface with it), you have no way to know the actual state of the device. Meaning you can’t keep in sync if you use HA + another controller like a remote. Even with just HA it’s not a reliable state : your blaster could have sent the command, but the device could have missed it.

For RF, I think the easiest is to flash a Sonoff RF bridge with ESPHome, but I know no more about it. I started with OpenMqttGateway, built their ESP-based device (I used SRX882 & STX882), then I moved to ESPHome. Here’s an extract of the YAML if it can help you:

remote_transmitter:
  pin: GPIO2
  carrier_duty_percent: 100%

# remote_receiver:
#   pin: GPIO5
#   dump: pronto

output:
  - platform: template
    id: pool_light
    type: binary
    write_action:
      - delay: 0s
          
light:
  - platform: binary
    name: "Pool Light"
    output: pool_light
    on_turn_on:
      - remote_transmitter.transmit_rc_switch_raw:
          code: '101100001101001010000000'
          protocol:
            pulse_length: 900
          repeat:
            times: 10
            wait_time: 0ms
    on_turn_off:
      - remote_transmitter.transmit_rc_switch_raw:
          code: '101100001101001010001111'
          protocol:
            pulse_length: 900
          repeat:
            times: 10
            wait_time: 0ms
1 Like