-
Notifications
You must be signed in to change notification settings - Fork 10
/
example_fake_arc_device.yaml
68 lines (64 loc) · 2.2 KB
/
example_fake_arc_device.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Creates a fake Audio Return Channel (ARC) device. This convinces some TVs (e.g. TCL)
# to send volume commands over HDMI-CEC.
esphome:
name: cec
platform: ESP8266
board: d1_mini
# Maybe necessary depending on what else you're running on the ESP chip.
# The execution loop for hdmi_cec is somewhat timing sensitive.
# platformio_options:
# board_build.f_cpu: 160000000L
logger:
external_components:
- source: ./components
hdmi_cec:
# The initial logical address -- corresponds to device type. This may be
# reassigned if there are other devices of the same type on the CEC bus.
address: 0x05 # Audio system
# Promiscuous mode can be enabled to allow receiving messages not intended for us
promiscuous_mode: false
# Typically the physical address is discovered based on the point-to-point
# topology of the HDMI connections using the DDC line. We don't have access
# to that so we just hardcode a physical address.
physical_address: 0x4000
pin: 4 # GPIO4
on_message:
- opcode: 0xC3 # Request ARC start
then:
- hdmi_cec.send: # Report ARC started
destination: 0x0
data: [ 0xC1 ]
- opcode: 0x70 # System audio mode request
then:
- hdmi_cec.send:
destination: 0xF
data: [ 0x72, 0x01 ]
- opcode: 0x71 # Give audio status
then:
- hdmi_cec.send:
destination: 0x0
data: [ 0x7A, 0x7F ]
- opcode: 0x7D # Give audio system mode status
then:
- hdmi_cec.send:
destination: 0x0
data: [ 0x7E, 0x01 ]
- opcode: 0x46 # Give OSD name
then:
- hdmi_cec.send:
destination: 0x0
data: [0x47, 0x65, 0x73, 0x70, 0x68, 0x6F, 0x6D, 0x65] # esphome
- opcode: 0x8C # Give device Vendor ID
then:
- hdmi_cec.send:
destination: 0x0
data: [0x87, 0x00, 0x13, 0x37]
- data: [0x44, 0x41] # User control pressed: volume up
then:
- logger.log: "Volume up"
- data: [0x44, 0x42] # User control pressed: volume down
then:
- logger.log: "Volume down"
- data: [0x44, 0x43] # User control pressed: volume mute
then:
- logger.log: "Volume mute"