-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmcu-cec-bedroom.yaml
167 lines (156 loc) · 4.05 KB
/
mcu-cec-bedroom.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
substitutions:
device: cec-bedroom
name: Bedroom TV
comment: "DEV"
esphome:
name: mcu-${device}
comment: ${comment}
esp32:
board: m5stack-atom
framework:
# type: arduino
type: esp-idf
external_components:
# - source: github://pr#3017
# components: [hdmi_cec]
# refresh: 1h
- source: github://Palakis/esphome-hdmi-cec
refresh: 1h
packages:
common: !include common/common.yaml
debug:
time:
- platform: homeassistant
id: ha_time
timezone: Europe/Bratislava
i2c:
# - id: i2c0
sda: 32
scl: 33
scan: true #false
frequency: 100kHz
# - id: i2c1
# sda: 25
# scl: 22
# scan: true #false
uart:
- id: uart_distance
tx_pin: 25
rx_pin: 22
baud_rate: 9600
sensor:
- platform: a02yyuw
uart_id: uart_distance
name: 'Distance'
accuracy_decimals: 2
unit_of_measurement: cm
binary_sensor:
- platform: gpio
name: ${name} Button
pin:
number: 39
inverted: true
light:
- platform: esp32_rmt_led_strip
name: "${name} LED"
id: led
rgb_order: GRB
pin: 27
num_leds: 1
chipset: ws2812
restore_mode: ALWAYS_OFF
effects:
# Use default parameters:
- random:
# Customize parameters
- random:
name: "My Slow Random Effect"
transition_length: 30s
update_interval: 30s
- random:
name: "My Fast Random Effect"
transition_length: 4s
update_interval: 5s
- strobe:
- strobe:
name: Strobe Effect With Custom Values
colors:
- state: True
brightness: 100%
red: 100%
green: 90%
blue: 0%
duration: 500ms
- state: False
duration: 250ms
- state: True
brightness: 100%
red: 0%
green: 100%
blue: 0%
duration: 500ms
- flicker:
- flicker:
name: Flicker Effect With Custom Values
alpha: 95%
intensity: 1.5%
- addressable_rainbow:
- addressable_rainbow:
name: Rainbow Effect With Custom Values
speed: 10
width: 50
- addressable_scan:
- addressable_scan:
name: Scan Effect With Custom Values
move_interval: 100ms
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: 26
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: 0x0
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"