Hi
I am using esp32-c3 super mini
Is this board name right ? (esp32-c3-devkitm-1)
Want to open parking door , parking door board have 4 pin (com,up,down,stop)(if you short connect com to up = door go up)
This code not working at all… , can someone help pls? ty…
GPIO21 => connected to Up
Gnd => connected to Com
esphome:
name: esphome-web-66cc9c
friendly_name: esphome-web-66cc9c
esp32:
board: esp32-c3-devkitm-1
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "UfQ+xxxxxxxxxxxxxxxxxxxxxxx="
ota:
- platform: esphome
password: "xxxxxxxxxxxxxxxxx"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esphome-Web-66Cc9C"
password: "xxxxxxxx"
captive_portal:
switch:
- platform: gpio
pin:
number: GPIO21
inverted: true
mode:
output: True
open_drain: True
name: "Parking Door Open Switch"
id: open_switch
icon: "mdi:gate"
on_turn_on:
- delay: 300ms
- switch.turn_off: open_switch
- platform: gpio
pin:
number: GPIO20
inverted: true
mode:
output: True
open_drain: True
name: "Parking Door Close Switch"
id: close_switch
icon: "mdi:gate"
on_turn_on:
- delay: 300ms
- switch.turn_off: close_switch
- platform: gpio
pin:
number: GPIO10
inverted: true
mode:
output: True
open_drain: True
name: "Parking Door stop Switch"
id: stop_switch
icon: "mdi:gate"
on_turn_on:
- delay: 300ms
- switch.turn_off: stop_switch
cover:
- platform: template
name: "Parking Door"
open_action:
# Cancel any previous action
- switch.turn_off: close_switch
# Turn the OPEN switch on briefly
- switch.turn_on: open_switch
- delay: 0.1s
- switch.turn_off: open_switch
close_action:
- switch.turn_off: open_switch
- switch.turn_on: close_switch
- delay: 0.1s
- switch.turn_off: close_switch
stop_action:
- switch.turn_off: close_switch
- switch.turn_on: stop_switch
- delay: 0.1s
- switch.turn_off: stop_switch
optimistic: true
assumed_state: true
Also tested this simple aurdino code (before started working on esphome)(its working)
#define DOOR_PIN 21
#define CABLE_UP_PIN 2
#define CABLE_DOWN_PIN 3
int state1 = 1;
void setup() {
pinMode(DOOR_PIN, OUTPUT);
//pinMode(CABLE_UP_PIN, INPUT);
//pinMode(CABLE_DOWN_PIN, INPUT);
digitalWrite(DOOR_PIN, LOW);
Serial.begin(9600);
}
void loop() {
Serial.write("up-high\n");
digitalWrite(DOOR_PIN, HIGH);
delay(100);
digitalWrite(DOOR_PIN, LOW);
delay(5000);
}