As an update: using @eliz config (THANK YOU!!) – confirming I got this working! This essentially provides full and complete local control of virtually anything in Home Assistant with the switchbot remote. Here’s some more deetz –
1: Hardware:
I used the same Anthom IR Receiver linked earlier. Set it up, killed Tasmota, flashed ESPHome with the config. I have the Switchbot Hub 2 (required to learn new IR codes and sync to the Switchbot Remote), and of course, the Switchbot Universal Remote.
2: Finding IR Codes in HA
Once the IR Receiver is in HA, there’s some additional stuff required that involves listening to IR codes in the developer tools, and playing around with HA Events. I went into the Events tab in the devtools tab of HA, told it to listen to “esphome.ir_nec_code_received” – and used an old remote to test some different buttons which I will use as “dummy IR codes” to trigger whatever I want. (Note: I’m unclear what the other event listeners here are, as some didn’t spit out unique codes on press. The NEC one worked for me, but some physical buttons didn’t work. I have a vague understanding that the other listeners relate to different IR standards? Practically speaking: the old “dummy IR trainer” remote will likely dictate which event listener you should test & use here. Observe the espconfig + raw logs on which event listener to use.)
3: Creating HA Automation on IR Trigger
I created an automation, told it to listen to the event “esphome.ir_nec_code_received” – and used the data previously observed on the desired remote press, IE:
device_id: eb04d2cce8cfe1b2481e1691ac4cce33
address: "21891"
command: "35955"
4: Configuring Switchbot
In the Switchbot App, I first navigated to the Hub 2 setup, and proceeded to configure an “IR Appliance,” using the same respective IR Codes used in the initial test. In this instance, it’s just a On/Off toggle intended for a light group based on two arbitrary old-remote IR buttons.
Then, I navigate to the Switchbot Remote in the app, “add existing device” (from the Hub2), and sync it to the remote. Success!! In my testing, it’s been exceptionally reliable and responsive.
Other Thoughts:
I’ve now got light groups setup for two rooms, a fireplace, and some various peripherals. Im interested in playing around more with sequenced & actions conditional actions. (turn on TV, sound system, lights).
There’s plenty of room to experiment and explore using the switchbot “Appliance” templates to have some pretty robust controls. In my setup, I have multiple light controls integrated into one “appliance.” Toggle-all, or individual lights is what I was really looking for: (button D with the ellipses on remote is a submenu. I park my individual room lights there). I definitely didn’t want the individual devices to be verbosely listed on the remote, so I’m going to continue to explore playing around with using “appliances” as “thematically grouped devices” – a hacky room card basically.
Hope this more detailed writeup helps others – I’m super happy to have unlocked the potential of this remote to do anything in HA, fully local and super fast & reliable. No Switchbot HA integration was needed for this setup!
Hopefully in the future, there’s some way to get the SB Hub2 to work as the IR Receiver so additional hardware isn’t required.