ESP32 - Project Design Guidance - help needed

Hi All,
Working on my 1st ESP32 mini project. I would like to build an IR receiver that would capture commands from my home cinema remote. Based on the codes received the ESP32 would “tell” HA to turn on/off various lights, close/open the shades. I have this currently working as a stand alone unit with a Arduino and some relays that “fake” button pushing on remotes.

My thinking is that with the ESP32, I could use it as a trigger to directly “talk” to the lutron or zwave wall switches without the need to use relays and dismantled remote control units.

What I am uncertain about is how I have the ESP32 tell Switch-A to turn ON. All I can think of is to create a sensor for each device I want to control and use that device in HA automation triggers (based on IR code received,sensor value is ON or OFF, HA automation set the correspomding Zwave light)

I am not sure if this is a correct design / best practice, so suggestions welcomed, if someone can point me in the right direction.

Thanks.

ESPHome can directly call HA Actions (formerly Services). Thus you can just call the light.turn_on: action from an ESPHome node if you want to.

So if a device already works from HA, it will work controlled indirectly by ESPHome without additional hardware.

Sorry for the delayed response.

So basicaly I could use an IF statement…
—If IR code = 1234, then turn on TV Room Lights.

Thanks.

Yes - something like:

remote_receiver:
  pin: GPIOXX
  dump: all

binary_sensor:
  - platform: remote_receiver
    name: "Panasonic Remote Input"
    panasonic:
      address: 0x4004
      command: 0x100BCBD
    on_state:
        - homeassistant.action:
            action: light.toggle
            data:
              entity_id: light.kitchen

There are other ways to do this as well - you could set up a single sensor and test for the received code there.

Remember you need to enable actions for the ESPHome device in HA, in the ESPHome integration.