Smart Home Automation Forum
KC868-A8S hotel room demo configure for ESPhome - Printable Version

+- Smart Home Automation Forum (https://www.kincony.com/forum)
+-- Forum: Technical Support (https://www.kincony.com/forum/forumdisplay.php?fid=20)
+--- Forum: KC868-A8S (https://www.kincony.com/forum/forumdisplay.php?fid=24)
+--- Thread: KC868-A8S hotel room demo configure for ESPhome (/showthread.php?tid=1946)

Pages: 1 2


KC868-A8S hotel room demo configure for ESPhome - admin - 05-31-2022

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:


RE: KC868-A8S hotel room demo configure for ESPhome - nextclick - 09-30-2022

Thanks for example. Is working. 
Is possible add example for AD inputs? I need to show the state of AD inputs (0-5V) in Home Assistant.
And if possible also the procedure for controlling RGBW LEDs from HA
Thanks.


RE: KC868-A8S hotel room demo configure for ESPhome - admin - 10-01-2022

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

- platform: adc
pin: 39
name: "analog-2"
update_interval: 10s
attenuation: 11db

- platform: adc
pin: 34
name: "analog-3"
update_interval: 10s
attenuation: 11db

- platform: adc
pin: 35
name: "analog-4"
update_interval: 10s
attenuation: 11db


RE: KC868-A8S hotel room demo configure for ESPhome - JCh - 12-12-2022

Is it possible to add an example for measuring 4-20mA on AI 3-4? Is it possible to connect a 24V sensor to this input? Thanks


RE: KC868-A8S hotel room demo configure for ESPhome - admin - 12-13-2022

esphome config line as same as measuring dc 0-5v sensor. if you connect with 4-20mA signal to board, also will convert "current" to "voltage" value.
now board input level MAX is dc12v , if you want to use 24v sensor, you can convert to dc12v then connect to digital input port.


RE: KC868-A8S hotel room demo configure for ESPhome - benlouisv@gmail.com - 03-07-2023

Can you maby assist me how to connect a 4-20ma pressure sensor to the unit?
Sensor info
Supply 9-36vdc
Output 4-20ma
Range 0-5bar


RE: KC868-A8S hotel room demo configure for ESPhome - admin - 03-07-2023

the default circuit is use for analog input 0-5v. if you want to test with 4-20mA, need replace two resistance value. such as here is sample of ADC1, replace R70=0 ohm R72=150 ohm
   


RE: KC868-A8S hotel room demo configure for ESPhome - benlouisv@gmail.com - 03-08-2023

Sso for the A6 model all Analogue inputs are 0-5v defaut. can I replace all 4 inputs reaiators to use 4 x 4-20ma sensors?


RE: KC868-A8S hotel room demo configure for ESPhome - admin - 03-08-2023

yes, you are right.


RE: KC868-A8S hotel room demo configure for ESPhome - benlouisv@gmail.com - 03-08-2023

Do you have models that can use 4-20ma sensors without modifications