mirror of
https://github.com/randybb/esphome-configs.git
synced 2026-01-02 11:37:28 +01:00
172 lines
4.1 KiB
YAML
172 lines
4.1 KiB
YAML
substitutions:
|
|
device: cec-bedroom
|
|
name: Bedroom TV
|
|
area: Bedroom
|
|
comment: "${area} | CEC"
|
|
|
|
esphome:
|
|
name: mcu-${device}
|
|
area: ${area}
|
|
comment: ${comment}
|
|
|
|
esp32:
|
|
board: m5stack-atom
|
|
framework:
|
|
# type: arduino
|
|
type: esp-idf
|
|
version: 5.3.2
|
|
platform_version: 53.03.11
|
|
|
|
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"
|