Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
KC868-A8 ESP32 I/O pin define in Arduino IDE
#1
#define ANALOG_A1  32
#define ANALOG_A2  33

IIC SDA:4
IIC SCL:5

Relay_IIC_address 0x24

Relay1 = pcf8574.pinMode(P0, OUTPUT);
Relay2 = pcf8574.pinMode(P1, OUTPUT);
Relay3 = pcf8574.pinMode(P2, OUTPUT);
Relay4 = pcf8574.pinMode(P3, OUTPUT);
Relay5 = pcf8574.pinMode(P4, OUTPUT);
Relay6 = pcf8574.pinMode(P5, OUTPUT);
Relay7 = pcf8574.pinMode(P6, OUTPUT);
Relay8 = pcf8574.pinMode(P7, OUTPUT);

Input_IIC_address 0x22

Input1 = pcf8574.pinMode(P0, INPUT);
Input2 = pcf8574.pinMode(P1, INPUT);
Input3 = pcf8574.pinMode(P2, INPUT);
Input4 = pcf8574.pinMode(P3, INPUT);
Input5 = pcf8574.pinMode(P4, INPUT);
Input6 = pcf8574.pinMode(P5, INPUT);
Input7 = pcf8574.pinMode(P6, INPUT);
Input8 = pcf8574.pinMode(P7, INPUT);

-------------------------------
(for KC868-A8 PCB v1.6)

S1: GPIO14
S2: GPIO13
S3: GPIO32
S4: GPIO33
-------------------------------

const int DI9 = 36
const int DI10 =39

RF433MHz wireless receiver: 15
RF433MHz wireless transmitter: 2

Ethernet (LAN8720) I/O define:

#define ETH_ADDR        0
#define ETH_POWER_PIN  -1
#define ETH_MDC_PIN    23
#define ETH_MDIO_PIN  18
#define ETH_TYPE      ETH_PHY_LAN8720
#define ETH_CLK_MODE  ETH_CLOCK_GPIO17_OUT
Reply
#2
Hello, I have a KC868-A8, i configured it by YAML CONFIG, to control the 4 shutters work with physical switches. 
When I operate the shutter from the Home Assistant dashboard, I get the percentage information for the opening level, but when I operate it with a physical switch, I don't get that information.

Configuration
switch:
  - platform: gpio
    name: "light5"
    id: relay05
    interlock: [relay06]
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 4
      mode: OUTPUT
      inverted: true
  - platform: gpio
    name: "light6"
    id: relay06
    interlock: [relay05]
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 5
      mode: OUTPUT
      inverted: true
  - platform: gpio
    name: "light7"
    id: relay07
    interlock: [relay08]
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 6
      mode: OUTPUT
      inverted: true
  - platform: gpio
    name: "light8"
    id: relay08
    interlock: [relay07]
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 7
      mode: OUTPUT
      inverted: true
#################################################################################
binary_sensor:
  - platform: gpio
    name: "input1"
    on_press:
      then:
        - switch.toggle: relay01
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 0
      mode: INPUT
      inverted: true
  - platform: gpio
    name: "input2"
    on_press:
      then:
        - switch.toggle: relay02
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 1
      mode: INPUT
      inverted: true
  - platform: gpio
    name: "input3"
    on_press:
      then:
        - switch.toggle: relay03
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 2
      mode: INPUT
      inverted: true
  - platform: gpio
    name: "input4"
    on_press:
      then:
        - switch.toggle: relay04
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 3
      mode: INPUT
      inverted: true
  - platform: gpio
    name: "input5"
    on_press:
      then:
        - switch.toggle: relay05
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 4
      mode: INPUT
      inverted: true
  - platform: gpio
    name: "input6"
    on_press:
      then:
        - switch.toggle: relay06
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 5
      mode: INPUT
      inverted: true
  - platform: gpio
    name: "input7"
    on_press:
      then:
        - switch.toggle: relay07
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 6
      mode: INPUT
      inverted: true
  - platform: gpio
    name: "input8"
    on_press:
      then:
        - switch.toggle: relay08
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 7
      mode: INPUT
      inverted: true
#################################################################################
cover:
  - platform: time_based
    name: "VOLET 1"
    open_action:
      - switch.turn_on: 'relay05'
    open_duration: 30sec
    close_action:
      - switch.turn_on: 'relay06'
    close_duration: 30sec
    stop_action:
      - switch.turn_off: 'relay05'
      - switch.turn_off: 'relay06'
  - platform: time_based
    name: "VOLET2"
    open_action:
      - switch.turn_on: 'relay07'
    open_duration: 20sec
    close_action:
      - switch.turn_on: 'relay08'
    close_duration: 20sec
    stop_action:
      - switch.turn_off: 'relay07'
      - switch.turn_off: 'relay08'
     
Reply


Forum Jump:


Users browsing this thread: