TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    ESP32 infrared receiver for Home Assistant to run 21 commands

    Home Assistant
    1
    1
    182
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • RussR
      Russ
      last edited by Russ

      I published this Home Assistant blueprint to trigger 21 different commands, one for each button on this 21 button infrared remote control.
      https://github.com/rvmey/TRIGGERcmd-Agent/blob/master/ha_blueprints/ir_remote.yaml

      iresp32.jpg

      Install the "Mosquitto broker" Home Assistant add-on if you don't already have it.

      Create a Home Assistant user for Tasmota to log into MQTT using this web page:
      http://homeassistant.local:8123/config/users

      Connect your ESP32 device to your PC via USB and install Tasmota firmware using this web page:
      https://tasmota.github.io/install

      Connect it to your wifi, open the Tasmota web interface, and enable MQTT. Point it to your Home Assistant IP address, and input the username and password for the user you just created for it.

      In the Tasmota Module configuration, enable IRrecv on GPIO 15:
      138e7976-e53f-48a9-9d8e-def514e3f04c-image.png

      Add this to your Home Assistant configuration.yaml. This will make the IR receiver(s) available as entities you can select on your automation.

      mqtt: 
        sensor:
        - name: "IR Receiver Blue"
          state_topic: "tele/tasmota_778254/RESULT"
          value_template: "{{ value_json.IrReceived.Data }}"
        - name: "IR Receiver White"
          state_topic: "tele/tasmota_47F4CC/RESULT"
          value_template: "{{ value_json.IrReceived.Data }}"
      

      Modify it for your specific tasmota name(s) instead of tasmota_778254 or tasmota_47F4CC. You'll find yours on the MQTT configuration page.

      Go to this page and install the blueprint with the IMPORT BLUEPRINT button.
      http://homeassistant.local:8123/config/blueprint/dashboard
      4717fc04-65af-44a3-8d86-3154900b16a4-image.png

      Click the blueprint and configure your automation with an action for each of the 21 buttons on the IR remote. Notice the automation can use multiple IR receivers if you want.

      b0a8fb92-b0e5-4e44-81bb-921af67b0bab-image.png

      The IR remotes are cheap enough you can buy a bunch and have them all over:
      46c1ebbb-cf03-432f-8b4f-1a3694c415fe-image.png
      https://www.amazon.com/HiLetgo-HX1838-Infrared-Wireless-Control/dp/B01HTC5JX4

      23cd24c9-2fd9-4341-b66a-f47807c73178-image.png
      https://www.amazon.com/Teyleten-Robot-ESP-WROOM-32-Development-Microcontroller/dp/B08246MCL5

      Optionally, you might also want to run this command in the console to prevent it from losing its config when the power going out and back on too many times:

      SetOption65 1
      

      If you prefer a Raspberry Pi solution that uses the same IR remote, check out this post.

      EDIT 4/12/25: I've learned that these basic IR receivers work more consistently:
      https://www.amazon.com/Vishay-TSOP4838-Infrared-Receiver-Pack/dp/B00UO9VO8O

      ead08945-26b3-49f2-81c2-4adf3dc695e5-image.png

      These work well too:
      ed3111b9-6376-4ab8-acb9-8eaf88c7beb5-image.png

      Russell VanderMey

      1 Reply Last reply Reply Quote 0
      • First post
        Last post