Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
KC868-A32 configure for ESPhome
#1
esphome:
  name: a32
  platform: ESP32
  board: esp32dev


# Enable logging
logger:

# Enable Home Assistant API
api:


# Example configuration entry
i2c:
  - id: bus_a
    sda: 15
    scl: 13
    scan: true
  - id: bus_b
    sda: 4
    scl: 5
    scan: true
   

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

# Example configuration entry
pcf8574:
  - id: 'pcf8574_hub_out_1'  # for output channel 1-8
    i2c_id: bus_a
    address: 0x24

  - id: 'pcf8574_hub_out_2'  # for output channel 9-16
    i2c_id: bus_a
    address: 0x25

  - id: 'pcf8574_hub_out_3'  # for output channel 17-24
    i2c_id: bus_a
    address: 0x21

  - id: 'pcf8574_hub_out_4'  # for output channel 25-32
    i2c_id: bus_a
    address: 0x22
   
  - id: 'pcf8574_hub_in_1'  # for input channel 1-8
    i2c_id: bus_b
    address: 0x24

  - id: 'pcf8574_hub_in_2'  # for input channel 9-16
    i2c_id: bus_b
    address: 0x25

  - id: 'pcf8574_hub_in_3'  # for input channel 17-24
    i2c_id: bus_b
    address: 0x21

  - id: 'pcf8574_hub_in_4'  # for input channel 25-32
    i2c_id: bus_b
    address: 0x22   
   
# Individual outputs
switch:
  - platform: gpio
    name: "light1"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light2"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light3"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 2
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light4"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 3
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "light5"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 4
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light6"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light7"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 6
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light8"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 7
      mode: OUTPUT
      inverted: true


  - platform: gpio
    name: "light9"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light10"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light11"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 2
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light12"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 3
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "light13"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 4
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light14"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light15"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 6
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light16"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 7
      mode: OUTPUT
      inverted: true
     
     
  - platform: gpio
    name: "light17"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light18"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light19"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 2
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light20"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 3
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "light21"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 4
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light22"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light23"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 6
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light24"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 7
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "light25"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light26"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light27"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 2
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light28"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 3
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "light29"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 4
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light30"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light31"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 6
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light32"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 7
      mode: OUTPUT
      inverted: true
     
     
     
# Individual outputs
binary_sensor:
  - platform: gpio
    name: "input1"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 0
      mode: INPUT
      inverted: true

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

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

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

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

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

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


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

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

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

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

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

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

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

  - platform: gpio
    name: "input18"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input19"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input20"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 3
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "input21"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input22"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input23"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input24"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 7
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "input25"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 0
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input26"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input27"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input28"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 3
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "input29"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input30"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input31"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input32"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 7
      mode: INPUT
      inverted: true

# Example configuration entry
sensor:
  - platform: adc
    pin: 39
    name: "analog-1"
    update_interval: 10s
    attenuation: 11db

  - platform: adc
    pin: 34
    name: "analog-2"
    update_interval: 10s
    attenuation: 11db
   
  - platform: adc
    pin: 36
    name: "analog-3"
    update_interval: 10s
    attenuation: 11db
   
  - platform: adc
    pin: 35
    name: "analog-4"
    update_interval: 10s
    attenuation: 11db
Reply
#2
I'm having trouble connecting up remote transmitters as they won't accept the pcf8574 settings:
Code:
remote_transmitter:
  - id: master
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 5
      mode: INPUT
      inverted: true
    carrier_duty_percent: 50%

climate:
  - platform: fujitsu_general
    transmitter_id: master
    name: "Master Bedroom - Air Conditioner"
    visual:
      min_temperature: 18

Also, I have multiple binary gpio setup but none of them are triggering. I can confirm they all work as I've setup them up previously on a smaller ESP32 supported board and I'm in the process of upgrading to the large A32 relay board.

Code:
binary_sensor:
  - platform: gpio
    name: "PIR - Front Door"
    device_class: motion
    filters:
      - delayed_off: 30s
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 7
      mode: INPUT
      inverted: true
Reply
#3
check your A32 board PCF8574 IIC address value whether correct. after download firmware by ESPHome, see the LOG output, it will show the IIC scan address result.
Reply
#4
(03-03-2023, 02:36 AM)admin Wrote: check your A32 board PCF8574 IIC address value whether correct. after download firmware by ESPHome, see the LOG output, it will show the IIC scan address result.

What about the remote transmitters? This is the compile error I get:
Code:
rc/main.cpp: In function 'void setup()':
src/main.cpp:377:85: error: no matching function for call to 'esphome::remote_transmitter::RemoteTransmitterComponent::RemoteTransmitterComponent(esphome::pcf8574::PCF8574GPIOPin*&)'
   master = new remote_transmitter::RemoteTransmitterComponent(pcf8574_pcf8574gpiopin);

The compile message appears as soon as I add pcf8574: pcf8574_hub_in_3
Reply
#5
I've updated the firmware but still no progress.

I used the settings above:
Code:
i2c:
  - id: bus_a
    sda: 15
    scl: 13
    scan: true
  - id: bus_b
    sda: 4
    scl: 5
    scan: true

pcf8574:
  - id: 'pcf8574_hub_out_1'  # for output channel 1-8
    i2c_id: bus_a
    address: 0x24

  - id: 'pcf8574_hub_out_2'  # for output channel 9-16
    i2c_id: bus_a
    address: 0x25

  - id: 'pcf8574_hub_out_3'  # for output channel 17-24
    i2c_id: bus_a
    address: 0x21

  - id: 'pcf8574_hub_out_4'  # for output channel 25-32
    i2c_id: bus_a
    address: 0x22

  - id: 'pcf8574_hub_in_1'  # for input channel 1-8
    i2c_id: bus_b
    address: 0x24

  - id: 'pcf8574_hub_in_2'  # for input channel 9-16
    i2c_id: bus_b
    address: 0x25

  - id: 'pcf8574_hub_in_3'  # for input channel 17-24
    i2c_id: bus_b
    address: 0x21

  - id: 'pcf8574_hub_in_4'  # for input channel 25-32
    i2c_id: bus_b
    address: 0x22

The logs report:
Code:
[19:09:08][C][i2c.arduino:052]: I2C Bus:
[19:09:08][C][i2c.arduino:053]:   SDA Pin: GPIO15
[19:09:08][C][i2c.arduino:054]:   SCL Pin: GPIO13
[19:09:08][C][i2c.arduino:055]:   Frequency: 50000 Hz
[19:09:08][C][i2c.arduino:058]:   Recovery: bus successfully recovered
[19:09:08][I][i2c.arduino:068]: Results from i2c bus scan:
[19:09:08][I][i2c.arduino:074]: Found i2c device at address 0x21
[19:09:08][I][i2c.arduino:074]: Found i2c device at address 0x22
[19:09:08][I][i2c.arduino:074]: Found i2c device at address 0x24
[19:09:08][I][i2c.arduino:074]: Found i2c device at address 0x25
[19:09:08][C][i2c.arduino:052]: I2C Bus:
[19:09:08][C][i2c.arduino:053]:   SDA Pin: GPIO4
[19:09:08][C][i2c.arduino:054]:   SCL Pin: GPIO5
[19:09:08][C][i2c.arduino:055]:   Frequency: 50000 Hz
[19:09:08][C][i2c.arduino:058]:   Recovery: bus successfully recovered
[19:09:08][I][i2c.arduino:068]: Results from i2c bus scan:
[19:09:08][I][i2c.arduino:074]: Found i2c device at address 0x21
[19:09:08][I][i2c.arduino:074]: Found i2c device at address 0x22
[19:09:08][I][i2c.arduino:074]: Found i2c device at address 0x24
[19:09:08][I][i2c.arduino:074]: Found i2c device at address 0x25
[19:09:08][C][pcf8574:021]: PCF8574:
[19:09:08][C][pcf8574:022]:   Address: 0x24
[19:09:08][C][pcf8574:023]:   Is PCF8575: NO
[19:09:08][C][pcf8574:021]: PCF8574:
[19:09:08][C][pcf8574:022]:   Address: 0x25
[19:09:08][C][pcf8574:023]:   Is PCF8575: NO
[19:09:08][C][pcf8574:021]: PCF8574:
[19:09:08][C][pcf8574:022]:   Address: 0x21
[19:09:08][C][pcf8574:023]:   Is PCF8575: NO
[19:09:08][C][pcf8574:021]: PCF8574:
[19:09:08][C][pcf8574:022]:   Address: 0x22
[19:09:08][C][pcf8574:023]:   Is PCF8575: NO
[19:09:08][C][pcf8574:021]: PCF8574:
[19:09:08][C][pcf8574:022]:   Address: 0x24
[19:09:08][C][pcf8574:023]:   Is PCF8575: NO
[19:09:08][C][pcf8574:021]: PCF8574:
[19:09:08][C][pcf8574:022]:   Address: 0x25
[19:09:08][C][pcf8574:023]:   Is PCF8575: NO
[19:09:09][C][pcf8574:021]: PCF8574:
[19:09:09][C][pcf8574:022]:   Address: 0x21
[19:09:09][C][pcf8574:023]:   Is PCF8575: NO
[19:09:09][C][pcf8574:021]: PCF8574:
[19:09:09][C][pcf8574:022]:   Address: 0x22
[19:09:09][C][pcf8574:023]:   Is PCF8575: NO

Any ideas?
Reply
#6
KC868-A32 no interface for RF receiver module, how do you use remote transmitters ?
Reply
#7
(03-03-2023, 09:02 AM)admin Wrote: KC868-A32 no interface for RF receiver module, how do you use remote transmitters ?

I don't need a receiver. The transmitter is defined in my first post above. It worked fine when I had this on a different board - it just needs to send an output signal which is generated by the climate platform.

Could the GPIO issue be pullup related?
Reply
#8
you are using PCF8574 IIC for GPIO work as transmitter. maybe PCF8574 speed not fast enough. you can try to set the PCF8574 frequency high, if also can't work , i think transmitter need use ESP32's GPIO, not PCF8574's.
Reply
#9
How do I set the frequency to high?
Reply
#10
about I2C bus setting in ESPHome, there ia a "frequency" setting.
details see here: https://esphome.io/components/i2c.html
Reply


Forum Jump:


Users browsing this thread: