Draft
Event code 114 (KEY_VOLUMEDOWN)
Event code 115 (KEY_VOLUMEUP)
Event code 113 (KEY_MUTE)
The problem
I can’t control volume via Apple TV remote
The setup
I use Apple TV connected to standard PC monitor via HDMI.
Monitor is without speakers have any speakers, nor minijack output.
I’m using HDMI extractor between Apple TV and display to get minijack output.
Minijack output is connected to Sonos Five.
Due to lack of HDMI-CEC in this scenario, I cannot control volume in other way than clicking on touch buttons on speaker itself or via HomeAssistant widget using Sonos Home Assistant integration
Solution
I noticed that Apple TV in settings have feature to control other devices via IR.
Basically Apple TV itself can learn IR codes, remote or box have IR blaster that can repeat that code later.
That would solve half of my problem, volume control buttons on remote would send some signals. No more using other device than Apple TV remote itself to change volume!
As my speaker doesn’t have “native” IR codes, I can use any generic IR remote laying in drawer to generate some codes and teach them to remote.
Second half of problem is receiving IR signals and control speaker via HomeAssistant.
Fortunately there are few ways to receive IR.
Bonus feature
Clever commenter on YT vid I linked above, noticed that mute button can be used to some other action than muting. This gives me idea to control light or other stuff via Apple TV remote via just single button press, neat!
Devices
List of devices
https://community.home-assistant.io/t/which-hardware-to-buy-ir-blaster/627106
https://community.home-assistant.io/t/ir-receivers-in-multiple-rooms-ir-triggers/614477
Flirc USB
Docker compose snippet which works for me
services:
home-assistant:
container_name: home-assistant
image: ghcr.io/home-assistant/home-assistant:latest
restart: always
network_mode: host
volumes:
- /dev/input:/dev/input/
devices:
- /dev/ttyACM0:/dev/ttyACM0
- "/dev/input/"
device_cgroup_rules:
- 'c 13:* rmw'
Small USB device which you program (on Windows?) to emulate keyboard presses on specified IR codes.
Configuration
https://thehelpfulidiot.com/controlling-home-assistant-with-an-old-remote
https://community.home-assistant.io/t/keyboard-remote/43101/15
https://stackoverflow.com/questions/24225647/docker-a-way-to-give-access-to-a-host-usb-or-serial-device
https://community.home-assistant.io/t/physical-keyboard-not-working-on-docker-installation-keyboard-remote/774417
https://www.home-assistant.io/integrations/keyboard_remote/#containers
?evtest needs to be installed in container?
https://community.home-assistant.io/t/physical-keyboard-not-working-on-docker-installation-keyboard-remote/774417
Misc
https://flirc.tv/products/flirc-usb-receiver?variant=43513067569384
Used 85,27 PLN with shipping
https://www.olx.pl/d/oferta/flirc-usb-v2-kontroler-usb-do-sterowania-pilotem-CID99-ID13HB3y.html
New 146 PLN with shipping
https://allegro.pl/oferta/flirc-usb-v2-kontroler-usb-do-sterowania-pilotem-8463870157
Tuya ZS06
Zigbee device
https://www.zigbee2mqtt.io/devices/ZS06.html
Lirc
https://www.home-assistant.io/integrations/lirc/
https://community.home-assistant.io/t/keyboard-remote/43101
Lirc + HomeAssistant + Docker