What you’ll build
- IR codes saved as plain files:
/config/irlib/<device>/<button>.raw - Auto-generated index for dropdowns:
/config/irlib_index.json - Any blaster can learn (if it has a receiver) and all blasters can send
- Rename / move / delete in the UI; daily backups and restore
Prerequisites
- Home Assistant OS / Supervised
- ESPHome add-on (for your IR blasters)
- Studio Code Server (or File Editor) to edit YAML
- Basic YAML editing skills
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 Assistant — Settings → 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/.
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
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
- ESPHome receiver fires
esphome.ir_code_learnedwith the RAW timings string. - Automation writes
/config/irlib/<device>/<button>.rawand rebuildsirlib_index.json. - UI scripts read the index (no polling) to populate dropdowns.
- Sending calls the node’s
transmit_rawservice with the RAW string and repeat count. - Backups tarball the library; restore replaces it and reindexes.
Troubleshooting
Before restart
- Always run Developer Tools → YAML → Check configuration.
Learned code not in dropdown
- Click IR UI: Reload device/button lists.
- Verify file exists under
/config/irlib/…. - Run
shell_command.irlib_reindex, then reload UI.
Sending does nothing
- Pick a valid Node/Device/Button; set Repeat to 2–5.
- Confirm TX LED flashes; check IR via phone camera.
- Move blaster close to device’s IR window; some brands may need repeats.
Receiver sees nothing
- VS1838B wiring: 3.3V/GND/OUT;
inverted: true,INPUT_PULLUP, 100nF decoupling. - Look at ESPHome logs (dump: all) while pressing a remote.
High CPU
- In this design, command_line sensors have
scan_interval: 0(no polling). - Heavy add-ons (e.g. VS Code server) can spike CPU; disable when not in use.
Ghost automations
- Add automations via the UI (not as package content) to avoid orphaned entries.
- As a last resort, a full host reboot clears retained state.