I tried controlling my Sony STR-DB930 receiver using an ESP-01M (ESP8285) IR transmitter + receiver board. I found some documentation about the necessary codes in the Slimdevices forum, but their configuration uses 11 bits and the minimum I can set in the “remote_transmitter.transmit_sony” is 12.
I got the “Power Off”, “Vol+”, “Vol-” and “Mute” comands working, but not the “Power On”.
- platform: template
name: "Sony Amplifyer OFF"
on_press:
- logger.log: Sending OFF Code
- remote_transmitter.transmit_sony:
data: 0x00000F41
nbits: 12
repeat:
times: 4
wait_time: 50ms
- platform: template
name: "Sony Amplifier Vol+"
on_press:
- logger.log: Increasing Volume...
- remote_transmitter.transmit_pronto:
data: "0000 006D 000D 0000 0060 0018 0018 0017 002E 0018 0018 0017 0018 0017 002E 0018 0018 0017 0017 0018 0017 0018 0017 0018 0018 0017 0017 0018 002E 0181"
repeat:
times: 2
wait_time: 0s
- platform: template
name: "Sony Amplifier Vol-"
on_press:
- logger.log: Decreasing Volume...
- remote_transmitter.transmit_pronto:
data: "0000 006D 000D 0000 0061 0017 002F 0018 002E 0018 0018 0017 0018 0017 002E 0018 0018 0017 0018 0017 0018 0017 0018 0017 0017 0017 0018 0018 002D 0181"
repeat:
times: 2
wait_time: 0s
- platform: template
name: "Sony Amplifier Mute"
on_press:
- logger.log: Muting...
- remote_transmitter.transmit_pronto:
data: "0000 006D 000D 0000 0061 0017 0018 0017 0018 0017 002E 0018 0018 0017 002E 0018 0018 0017 0018 0017 0018 0017 0018 0017 0018 0017 0018 0017 002E 0181"
repeat:
times: 2
wait_time: 0s
I captured all these codes using the default IR remote app on my Xiaomi phone and the IR receiver on the ESP-01M. But I cannot turn on the Sony receiver with my phone, that’s why I tried the code I found in the forum post. Unfortunately, it does not work at all…
Any ideas what I’m doing wrong?
Code from the Slimdevices forum:
begin remote
name sony_rec_2
bits 11
flags SPACE_ENC|CONST_LENGTH
eps 30
aeps 100
header 2468 537
one 1269 537
zero 669 537
ptrail 1268
gap 44943
min_repeat 2
toggle_bit 0
begin codes
power 0x0000000000000540
Radio 0x0000000000000420
Tape 0x0000000000000620
MD 0x0000000000000310
Video_1 0x0000000000000220
TV 0x00000000000002B0
DVD 0x00000000000005F0
5.1_CH 0x0000000000000270
CD 0x0000000000000520
volup 0x0000000000000240
voldown 0x0000000000000640
mute 0x0000000000000140
end codes
end remote
EDIT: I finally got it working!
I found different config files of “Learning Remotes”, something like a Logitech Harmony Universal Remote I guess, on RemoteCentral (Sony Category). These come in the .ccf
file format, that I decoded thanks to the awesome https://github.com/gsauthof/pronto-ccf project. Make sure you run this on Linux, I got a bunch of errors on Windows because of the mmap
dependency.
I dumped the command output to a file and searched for the “Power On” command:
Button: ON
Carrier: 40.64 kHz (0x66)
Header: 0000 0066 0000 000d
once (0 on/off pairs):
repeat (13 on/off pairs):
005f 0018 0018 0018 0030 0018
0030 0018 0030 0018 0018 0018
0030 0018 0018 0018 0018 0017
0018 0018 0018 0017 0018 0018
002f 0429
Then I used ChatGPT to transfer the “on/off” pairs onto a valid pronto command for the Esphome IR transmitter:
This is the base structure of the pronto command:
remote_transmitter.transmit_pronto:
data: "0000 0066 0000 000d <Insert command-specific data here>"
Working Power ON
command:
remote_transmitter.transmit_pronto:
data: "0000 0066 0000 000d 005f 0018 0018 0018 0030 0018 0030 0018 0030 0018 0018 0018 0030 0018 0018 0018 0018 0017 0018 0018 0018 0017 0018 0018 002f 0429"