Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
KC868-AP ESPHome demo config for home assistant by ethernet
#1
esphome:
  name: ap

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "hx8eSqbwjWs9/2bK0qK55QfTIOpI4gCfzLOeaOXZMaU="

# Example configuration entry
ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO17_OUT
  phy_addr: 0

 

# Example configuration entry for ESP32
i2c:
  sda: 4
  scl: 16
  scan: true
  id: bus_a

pcf8574:
  - id: 'pcf8574_hub_in_1'  # for input channel 1-8    maybe 0x22  /  0x3A
    address: 0x3A

  - id: 'pcf8574_hub_in_2'  # for input channel 9-16
    address: 0x21

binary_sensor:
  - platform: gpio
    name: "ap-input1"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 0
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "ap-input2"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "ap-input3"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "ap-input4"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 3
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "ap-input5"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "ap-input6"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "ap-input7"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "ap-input8"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 7
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "ap-input9"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 0
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "ap-input10"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "ap-input11"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "ap-input12"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 3
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "ap-input13"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "ap-input14"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "ap-input15"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "ap-input16"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 7
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "ap-input17"
    pin:
      number: 34
      inverted: true

  - platform: gpio
    name: "ap-input18"
    pin:
      number: 35
      inverted: true

pca9685:
    id: 'pca9685_hub'
    frequency: 500

output:
  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM0"
    channel: 0

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM1"
    channel: 1

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM2"
    channel: 2

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM3"
    channel: 3

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM4"
    channel: 4

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM5"
    channel: 5

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM6"
    channel: 6

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM7"
    channel: 7

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM8"
    channel: 8

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM9"
    channel: 9

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM10"
    channel: 10

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM11"
    channel: 11

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM12"
    channel: 12

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM13"
    channel: 13

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM14"
    channel: 14

  - platform: pca9685
    pca9685_id: 'pca9685_hub'
    id: "PWM15"
    channel: 15


light:
  - platform: monochromatic
    name: "Color-LED-1"
    output: PWM0
  - platform: monochromatic
    name: "Color-LED-2"
    output: PWM1
  - platform: monochromatic
    name: "Color-LED-3"
    output: PWM2
  - platform: monochromatic
    name: "Color-LED-4"
    output: PWM3
  - platform: monochromatic
    name: "Color-LED-5"
    output: PWM4
  - platform: monochromatic
    name: "Color-LED-6"
    output: PWM5
  - platform: monochromatic
    name: "Color-LED-7"
    output: PWM6
  - platform: monochromatic
    name: "Color-LED-8"
    output: PWM7
  - platform: monochromatic
    name: "Color-LED-9"
    output: PWM8
  - platform: monochromatic
    name: "Color-LED-10"
    output: PWM9
  - platform: monochromatic
    name: "Color-LED-11"
    output: PWM10
  - platform: monochromatic
    name: "Color-LED-12"
    output: PWM11
  - platform: monochromatic
    name: "Color-LED-13"
    output: PWM12
  - platform: monochromatic
    name: "Color-LED-14"
    output: PWM13
  - platform: monochromatic
    name: "Color-LED-15"
    output: PWM14
  - platform: monochromatic
    name: "Color-LED-16"
    output: PWM15

  - platform: rgbw
    name: "ap-rgbw"
    red: PWM1
    green: PWM2
    blue: PWM3
    white: PWM4


switch:
  - platform: gpio
    name: "ap-light1"
    pin: 13
    inverted: false

  - platform: gpio
    name: "ap-light2"
    pin: 2
    inverted: false
Reply
#2
Hello,

I have bought this board and am using esphome with this yaml configuration file.

My led strips are flickering when I change the brightness level. Is there a setting to minimize this?

Thank you.
Reply
#3
can you take a video? or can you test with another LED strip, different load.
Reply
#4
same thing at my side....


its flickering on startup the LED. i remember with other esphome pwm controllers it was possible to fix that with frequency. do we have this option?
Reply
#5
# Example configuration entry with external clock enable and clock source from ESP32
pca9685:
- id: pca9685_hub1
external_clock_input: true

# Individual outputs
output:
# generate PWM from ESP32 ledc
- platform: ledc
pin: 25
id: extclk
min_power: 1
frequency: 40MHz

- platform: pca9685
pca9685_id: 'pca9685_hub1'
channel: 0

this is demo code from ESPHome, you can try to change the "frequency" to another value for a test.
details: https://esphome.io/components/output/pca9685.html
Reply
#6
It does not work with external clock config, led doesn't turn on...
Reply
#7
what's your means?
Reply
#8
I have the same problem? its flickering on startup the LED
Reply
#9
OK. Problem solved. The default frequency for the I2C bus was too low
Reply
#10
you have set higher i2c bus speed for pca9685?
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)