Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ESPHome yaml demo file for AG8 IR controller
#1
Code:
esphome:
  name: ag8
  friendly_name: ag8
  platformio_options:
    board_build.flash_mode: dio

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: esp-idf
    sdkconfig_options:
      SOC_RMT_SUPPORT_RX_PINGPONG: "n"
# Enable logging
logger:
  hardware_uart: USB_SERIAL_JTAG
# Enable Home Assistant API
api:
  encryption:
    key: "dolIFOGZiGF8GT9wSJVBuoNzVQSHanaieBBbRcj1t48="

ethernet:
  type: W5500
  clk_pin: GPIO42
  mosi_pin: GPIO43
  miso_pin: GPIO44
  cs_pin: GPIO41
  interrupt_pin: GPIO2
  reset_pin: GPIO1

remote_receiver:
  pin: 48
  rmt_channel: 4 
  dump: all

remote_transmitter:
  - id: ir1
    pin: 9
    carrier_duty_percent: 50%
  - id: ir2
    pin: 10
    carrier_duty_percent: 50%
  - id: ir3
    pin: 11
    carrier_duty_percent: 50%
  - id: ir4
    pin: 12
    carrier_duty_percent: 50%
  # - id: ir5
  #   pin: 13
  #   carrier_duty_percent: 50%
  # - id: ir6
  #   pin: 14
  #   carrier_duty_percent: 50%
  # - id: ir7
  #   pin: 21
  #   carrier_duty_percent: 50%
  # - id: ir8
  #   pin: 47
  #   carrier_duty_percent: 50%

switch:
  - platform: template
    name: IR-Send1
    turn_on_action:
      - remote_transmitter.transmit_panasonic:
          transmitter_id: ir1
          address: 0x4004
          command: 0x8140DFA2

  - platform: template
    name: IR-Send2
    turn_on_action:
      - remote_transmitter.transmit_panasonic:
          transmitter_id: ir2
          address: 0x4004
          command: 0x8140DFA2

  - platform: template
    name: IR-Send3
    turn_on_action:
      - remote_transmitter.transmit_panasonic:
          transmitter_id: ir3
          address: 0x4004
          command: 0x8140DFA2

  - platform: template
    name: IR-Send4
    turn_on_action:
      - remote_transmitter.transmit_panasonic:
          transmitter_id: ir4
          address: 0x4004
          command: 0x8140DFA2

  # - platform: template
  #   name: IR-Send5
  #   turn_on_action:
  #     - remote_transmitter.transmit_panasonic:
  #         transmitter_id: ir5
  #         address: 0x4004
  #         command: 0x8140DFA2

  # - platform: template
  #   name: IR-Send6
  #   turn_on_action:
  #     - remote_transmitter.transmit_panasonic:
  #         transmitter_id: ir6
  #         address: 0x4004
  #         command: 0x8140DFA2

  # - platform: template
  #   name: IR-Send7
  #   turn_on_action:
  #     - remote_transmitter.transmit_panasonic:
  #         transmitter_id: ir7
  #         address: 0x4004
  #         command: 0x8140DFA2

  # - platform: template
  #   name: IR-Send8
  #   turn_on_action:
  #     - remote_transmitter.transmit_panasonic:
  #         transmitter_id: ir8
  #         address: 0x4004
  #         command: 0x8140DFA2


  - platform: uart
    uart_id: uart_485
    name: "RS485 Button"
    data: [0x11, 0x22, 0x33, 0x44, 0x55]

  - platform: uart
    uart_id: uart_232
    name: "RS232 Button"
    data: "RS232-test"

uart:
  - id: uart_485
    baud_rate: 9600
    debug:
      direction: BOTH
      dummy_receiver: true
      after:
        timeout: 10ms
    tx_pin: 18
    rx_pin: 8

  - id: uart_232
    baud_rate: 9600
    debug:
      direction: BOTH
      dummy_receiver: true
      after:
        timeout: 10ms
      sequence:
        - lambda: UARTDebug::log_string(direction, bytes);
    tx_pin: 17
    rx_pin: 16

binary_sensor:
  - platform: gpio
    name: "IO15"
    pin:
      number: 15
      inverted: true
      mode:
        input: true
        pullup: true
  - platform: gpio
    name: "IO38"
    pin:
      number: 38
      inverted: true
      mode:
        input: true
        pullup: true
  - platform: gpio
    name: "IO39"
    pin:
      number: 39
      inverted: true
      mode:
        input: true
        pullup: true
  - platform: gpio
    name: "IO40"
    pin:
      number: 40
      inverted: true
      mode:
        input: true
        pullup: true

web_server:
  port: 80

demo yaml for control Apple TV:
Code:
esphome:
  name: ag8
  friendly_name: ag8
  platformio_options:
    board_build.flash_mode: dio

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: esp-idf
    sdkconfig_options:
      SOC_RMT_SUPPORT_RX_PINGPONG: "n"
# Enable logging
logger:
  hardware_uart: USB_SERIAL_JTAG
# Enable Home Assistant API
api:
  encryption:
    key: "dolIFOGZiGF8GT9wSJVBuoNzVQSHanaieBBbRcj1t48="

ethernet:
  type: W5500
  clk_pin: GPIO42
  mosi_pin: GPIO43
  miso_pin: GPIO44
  cs_pin: GPIO41
  interrupt_pin: GPIO2
  reset_pin: GPIO1

remote_receiver:
  pin: 48
  rmt_channel: 4 
  dump: all

remote_transmitter:
  - id: ir1
    pin: 9
    carrier_duty_percent: 50%
  - id: ir2
    pin: 10
    carrier_duty_percent: 50%
  - id: ir3
    pin: 11
    carrier_duty_percent: 50%
  - id: ir4
    pin: 12
    carrier_duty_percent: 50%
  # - id: ir5
  #   pin: 13
  #   carrier_duty_percent: 50%
  # - id: ir6
  #   pin: 14
  #   carrier_duty_percent: 50%
  # - id: ir7
  #   pin: 21
  #   carrier_duty_percent: 50%
  # - id: ir8
  #   pin: 47
  #   carrier_duty_percent: 50%

switch:
  - platform: template
    name: IR-Send1
    turn_on_action:
      - remote_transmitter.transmit_pronto:
          transmitter_id: ir1
          data: "0000 006C 0022 0002 015B 00AD 0016 0041 0016 0016 0016 0041 0016 0016 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0575 015B 0057 0016 0E6C"

  - platform: template
    name: IR-Send2
    turn_on_action:
      - remote_transmitter.transmit_pronto:
          transmitter_id: ir2
          data: "0000 006C 0022 0002 015B 00AD 0016 0041 0016 0016 0016 0041 0016 0016 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 05CB 015B 0057 0016 0E6C"


  - platform: template
    name: IR-Send3
    turn_on_action:
      - remote_transmitter.transmit_pronto:
          transmitter_id: ir3
          data: "0000 006C 0022 0002 015B 00AD 0016 0041 0016 0016 0016 0041 0016 0016 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0016 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 05CB 015B 0057 0016 0E6C"

  - platform: template
    name: IR-Send4
    turn_on_action:
      - remote_transmitter.transmit_pronto:
          transmitter_id: ir4
          data: "0000 006C 0022 0002 015B 00AD 0016 0041 0016 0016 0016 0041 0016 0016 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 05CB 015B 0057 0016 0E6C"


  # - platform: template
  #   name: IR-Send5
  #   turn_on_action:
  #     - remote_transmitter.transmit_panasonic:
  #         transmitter_id: ir5
  #         address: 0x4004
  #         command: 0x8140DFA2

  # - platform: template
  #   name: IR-Send6
  #   turn_on_action:
  #     - remote_transmitter.transmit_panasonic:
  #         transmitter_id: ir6
  #         address: 0x4004
  #         command: 0x8140DFA2

  # - platform: template
  #   name: IR-Send7
  #   turn_on_action:
  #     - remote_transmitter.transmit_panasonic:
  #         transmitter_id: ir7
  #         address: 0x4004
  #         command: 0x8140DFA2

  # - platform: template
  #   name: IR-Send8
  #   turn_on_action:
  #     - remote_transmitter.transmit_panasonic:
  #         transmitter_id: ir8
  #         address: 0x4004
  #         command: 0x8140DFA2


  - platform: uart
    uart_id: uart_485
    name: "RS485 Button"
    data: [0x11, 0x22, 0x33, 0x44, 0x55]

  - platform: uart
    uart_id: uart_232
    name: "RS232 Button"
    data: "RS232-test"

uart:
  - id: uart_485
    baud_rate: 9600
    debug:
      direction: BOTH
      dummy_receiver: true
      after:
        timeout: 10ms
    tx_pin: 18
    rx_pin: 8

  - id: uart_232
    baud_rate: 9600
    debug:
      direction: BOTH
      dummy_receiver: true
      after:
        timeout: 10ms
      sequence:
        - lambda: UARTDebug::log_string(direction, bytes);
    tx_pin: 17
    rx_pin: 16

binary_sensor:
  - platform: gpio
    name: "IO15"
    pin:
      number: 15
      inverted: true
      mode:
        input: true
        pullup: true
  - platform: gpio
    name: "IO38"
    pin:
      number: 38
      inverted: true
      mode:
        input: true
        pullup: true
  - platform: gpio
    name: "IO39"
    pin:
      number: 39
      inverted: true
      mode:
        input: true
        pullup: true
  - platform: gpio
    name: "IO40"
    pin:
      number: 40
      inverted: true
      mode:
        input: true
        pullup: true

web_server:
  port: 80

Node: ESP32-S3 chip support 4 channel IR sender work at the same time. here is details by ESPHome webpage:
https://esphome.io/components/remote_transmitter.html


Attached Files
.txt   AG8_HA.txt (Size: 3.98 KB / Downloads: 63)
.txt   AG8_HA-AppleTV.txt (Size: 5.31 KB / Downloads: 72)
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)