Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
KC868-A8-E
#6
this is demo config code for KC868-A8S, you can update the RF receiver GPIO pin define use for your A8 board.
the function is RF decode and use RF remote toggle relay output.
Code:
esphome:
  name: a8s
  platform: ESP32
  board: esp32dev
 
 
remote_receiver:
  pin: 16
  dump:
    - rc_switch
  tolerance: 50%
  filter: 250us
  idle: 2ms
  buffer_size: 2kb



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


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

  # Optional manual IP
  manual_ip:
    static_ip: 192.168.1.199
    gateway: 192.168.1.1
    subnet: 255.255.255.0 


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

  - id: 'pcf8574_hub_in_1'  # for input channel 1-8
    address: 0x22

# Individual outputs
switch:
  - platform: gpio
    name: "light1"
    id: light1
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light2"
    id: light2
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 1
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "light3"
    id: light3
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 2
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "light4"
    id: light4
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 3
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "curtain1-up"
    id: relay5
    interlock: [relay6]
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 4
      mode: OUTPUT
      inverted: true
     
     
     
  - platform: gpio
    name: "curtain1-down"
    id: relay6
    interlock: [relay5]
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 5
      mode: OUTPUT
      inverted: true
     

  - platform: gpio
    name: "curtain2-up"
    id: relay7
    interlock: [relay8]
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 6
      mode: OUTPUT
      inverted: true

     
  - platform: gpio
    name: "curtain2-down"
    id: relay8
    interlock: [relay7]
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 7
      mode: OUTPUT
      inverted: true

     
binary_sensor:
  - platform: gpio
    name: "input1"
    on_press:
      then:
        - switch.toggle: light1
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 0
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input2"
    on_press:
      then:
        - switch.toggle: light2
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input3"
    on_press:
      then:
        - switch.toggle: light3
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input4"
    on_press:
      then:
        - switch.toggle: light4
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 3
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input5"
    on_press:
      then:
        - switch.toggle: relay5
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input6"
    on_press:
      then:
        - switch.toggle: relay6
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input7"
    on_press:
      then:
        - switch.toggle: relay7
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input8"
    on_press:
      then:
        - switch.toggle: relay8
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 7
      mode: INPUT
      inverted: true

  - platform: remote_receiver
    name: "remoter1"
    rc_switch_raw:
      code: '001111010111001010111000'
      protocol: 1
    on_press:
      then:
        - switch.toggle: light1
    filters:
      - delayed_off: 200ms

  - platform: remote_receiver
    name: "remoter2"
    rc_switch_raw:
      code: '001111010111001010111100'
      protocol: 1
    on_press:
      then:
        - switch.toggle: light2
    filters:
      - delayed_off: 200ms
     
  - platform: remote_receiver
    name: "remoter3"
    rc_switch_raw:
      code: '001111010111001010110100'
      protocol: 1
    on_press:
      then:
        - switch.toggle: light3
    filters:
      - delayed_off: 200ms
     
  - platform: remote_receiver
    name: "remoter4"
    rc_switch_raw:
      code: '001111010111001010111001'
      protocol: 1
    on_press:
      then:
        - switch.toggle: light4
    filters:
      - delayed_off: 200ms 
   
  - platform: remote_receiver
    name: "remoter5"
    rc_switch_raw:
      code: '001111010111001010110010'
      protocol: 1
    on_press:
      then:
        - switch.toggle: relay5
    filters:
      - delayed_off: 200ms

  - platform: remote_receiver
    name: "remoter6"
    rc_switch_raw:
      code: '001111010111001010110101'
      protocol: 1
    on_press:
      then:
        - switch.toggle: relay6
    filters:
      - delayed_off: 200ms
     
  - platform: remote_receiver
    name: "remoter7"
    rc_switch_raw:
      code: '001111010111001010110001'
      protocol: 1
    on_press:
      then:
        - switch.toggle: relay7
    filters:
      - delayed_off: 200ms
     
  - platform: remote_receiver
    name: "remoter8"
    rc_switch_raw:
      code: '001111010111001010110011'
      protocol: 1
    on_press:
      then:
        - switch.toggle: relay8
    filters:
      - delayed_off: 200ms
     
  - platform: gpio
    name: "PIR1"
    pin: 14
    device_class: motion
    on_release:
       - script.execute: motion_timer

script:
  - id: motion_timer
    mode: restart
    then:
      - delay: 10s
      - switch.turn_off: light1
      - switch.turn_off: light2
      - switch.turn_off: light3
      - switch.turn_off: light4


# Enable logging
logger:

# Enable Home Assistant API
api:
Reply


Messages In This Thread
KC868-A8-E - by avihay - 07-19-2023, 12:55 PM
RE: KC868-A8-E - by admin - 07-20-2023, 12:09 AM
RE: KC868-A8-E - by avihay - 07-20-2023, 07:11 AM
RE: KC868-A8-E - by avihay - 07-20-2023, 08:49 AM
RE: KC868-A8-E - by avihay - 07-20-2023, 05:23 PM
RE: KC868-A8-E - by admin - 07-20-2023, 10:23 PM
RE: KC868-A8-E - by avihay - 07-20-2023, 11:51 PM
RE: KC868-A8-E - by admin - 07-21-2023, 12:29 AM
RE: KC868-A8-E - by avihay - 07-21-2023, 01:14 AM
RE: KC868-A8-E - by admin - 07-21-2023, 02:17 AM
RE: KC868-A8-E - by avihay - 07-21-2023, 02:36 AM
RE: KC868-A8-E - by admin - 07-22-2023, 03:42 AM
RE: KC868-A8-E - by avihay - 07-22-2023, 05:50 PM
RE: KC868-A8-E - by avihay - 07-22-2023, 09:46 PM
RE: KC868-A8-E - by avihay - 07-22-2023, 10:47 PM
RE: KC868-A8-E - by admin - 07-22-2023, 11:45 PM
RE: KC868-A8-E - by avihay - 07-23-2023, 01:30 AM
RE: KC868-A8-E - by avihay - 07-30-2023, 01:24 AM
RE: KC868-A8-E - by admin - 07-30-2023, 03:09 AM
RE: KC868-A8-E - by avihay - 07-30-2023, 11:28 AM

Forum Jump:


Users browsing this thread:
1 Guest(s)