ESPHome + Home Assistant IR Library (Shell-Only) — Complete HOW-TO & Troubleshooting

Low-CPU, file-based IR library shared by multiple ESPHome IR blasters. No MQTT, no python_script, no extra add-ons.

What you’ll build

Why shell-only? Super low overhead, no polling loops, no third-party add-ons. Everything happens only when you click a button or capture a new code.

Prerequisites

Install — Step by Step

1Create the package file /config/packages/ir_library_shell.yaml with the contents in the next section.

2Check config — in HA: Settings → Developer Tools → YAML → Check configuration. Fix any YAML errors.

3Restart Home AssistantSettings → System → Restart.

4Add automations — 4 small ones are in the “Automations” section. Add each via UI (Add automation → Start empty → Edit in YAML).

5Flash your ESPHome IR Blaster with the YAML in the “ESPHome” section (adjust pins/SSID).

6Add the Lovelace cards — paste the card YAML from the “Cards” section.

7Initialize UI — in the “IR Nodes” card, set your nodes CSV (e.g. ir_blaster_living_room, ir_blaster_bedroom) and click Set Nodes from CSV. Then press IR UI: Reload device/button lists.

Package file — /config/packages/ir_library_shell.yaml

Paste the entire block below.

Copy esphome/packages/ir_library_shell.yaml file from the ZIP archive to /config/packages/.
				    
Important: After pasting this package, go to Developer Tools → YAML → Check configuration before restarting.

Automations (add via UI → Edit in YAML)

A) IR Blaster: Capture Learned Code

Copy cotents of automations/automation_capture.yaml
				    

B) IR Nodes: apply CSV on change

Copy contents of autoations/automation_apply_CSV_change.yaml 
				      

C) IR Nodes: apply CSV on startup

Copy contents of automations/automation_apply_CSV_startup.yaml
					

D) IR: Daily backup at 03:17

Copy contents of automations/automation_IR_Daily_Backup.yaml
					  

ESPHome — IR Blaster YAML (learn + send)

Adjust pins/SSID. VS1838B needs 3.3V, GND, OUT→GPIO with inverted: true and INPUT_PULLUP. TX is 38 kHz.

Copy contents of esphome/irblaster1.yaml
				    
Send from HA: service is esphome.<node_name>_transmit_raw with raw, repeat, device.

Lovelace cards (Dashboard → Edit → Add card → Manual)

A) Send + Refresh

Copy contents of lovelace/lovelace_send.yaml
				    

B) Manage devices & buttons

Copy contents of lovelace/lovelace_manage_devices_and_buttons.yaml
				      

C) Nodes (CSV)

Copy contents of lovelace/lovelace_manage_nodes.yaml
					

D) Backups

Copy contents of lovelace/lovelace_manage_backups.yaml
					  

How it works

  1. ESPHome receiver fires esphome.ir_code_learned with the RAW timings string.
  2. Automation writes /config/irlib/<device>/<button>.raw and rebuilds irlib_index.json.
  3. UI scripts read the index (no polling) to populate dropdowns.
  4. Sending calls the node’s transmit_raw service with the RAW string and repeat count.
  5. Backups tarball the library; restore replaces it and reindexes.

Troubleshooting

Before restart

Learned code not in dropdown

  1. Click IR UI: Reload device/button lists.
  2. Verify file exists under /config/irlib/….
  3. Run shell_command.irlib_reindex, then reload UI.

Sending does nothing

Receiver sees nothing

High CPU

Ghost automations