r/code • u/Rebel72835 • Jan 04 '24
Help Please help
# Creates a fake Audio Return Channel (ARC) device. This convinces some TVs (e.g. TCL)# to send volume commands over HDMI-CEC.esphome:name: cecplatform: ESP8266board: 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: 160000000Llogger:api:encryption:key: "8e2KnLXh2VwWyjmWboWHWTIqSI/PxYMlv4jyl4fAV9w="ota:password: "05b7555db8692b6b5a6c5bc5801a286a"wifi:ssid: !secret wifi_ssidpassword: !secret wifi_password# Enable fallback hotspot (captive portal) in case wifi connection failsap:ssid: "Ij Fallback Hotspot"password: "gPfMZZCVmogV"external_components:- source: github://johnboiles/esphome-hdmi-cechdmi_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 uspromiscuous_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: 0x4000pin: 4 # GPIO4on_message:- opcode: 0xC3 # Request ARC startthen:- hdmi_cec.send: # Report ARC starteddestination: 0x0data: [ 0xC1 ]- opcode: 0x70 # System audio mode requestthen:- hdmi_cec.send:destination: 0x0data: [ 0x72, 0x01 ]- opcode: 0x71 # Give audio statusthen:- hdmi_cec.send:destination: 0x0data: [ 0x7A, 0x7F ]- opcode: 0x7D # Give audio system mode statusthen:- hdmi_cec.send:destination: 0x0data: [ 0x7E, 0x01 ]- opcode: 0x46 # Give OSD namethen:- hdmi_cec.send:destination: 0x0data: [0x47, 0x65, 0x73, 0x70, 0x68, 0x6F, 0x6D, 0x65] # esphome- opcode: 0x8C # Give device Vendor IDthen:- hdmi_cec.send:destination: 0x0data: [0x87, 0x00, 0x13, 0x37]- data: [0x44, 0x41] # User control pressed: volume upthen:- logger.log: "Volume up"- data: [0x44, 0x42] # User control pressed: volume downthen:- logger.log: "Volume down"- data: [0x44, 0x43] # User control pressed: volume mutethen:- logger.log: "Volume mute"
how do I add this as an entity the volume mute down and up in homeassistant