Could use some guidance

I am trying to retrofit a Automatic Pet door (PX-1 MEDIUM STANDARD POWER PET DOOR), that I found at a second hand store. The door usually is controlled by a collar, however the collar is 50$ and I would rather make this work for all 3 of our dogs.

So, I have placed a Wemos D1 inside of it, and using 2N2222 transistor bridging the manual open button on the device control board can make the door open and close from HomeAssistant. It also will open when pressure is applied to either of the pads I have placed on either side. (Security Pressure Floor Mat)

Now, the challenges that are beyond my skill level yet.

  1. Currently if one pad is touched the door is opened, but if the other pad is then touched it will cause the door to close before the dog is through it.
  2. If the dog door is powered on, and the Wemos has the 2N2222 connected, ESPHome fails to boot with no log output. So I currently have a switch wired to between the Wemos and the 2N2222 so I can separate them, to allow the Wemos to boot properly.
  3. Additionally like #2 if the Wemos tries to boot with the 2N2222 connected at boot it will trigger the door to open and it will stay open until power is removed from the Wemos. (This is bad as a power outage will cause the door to open and stay open)

Currrent ESPHome Config

esphome:
name: dog-door
friendly_name: Dog Door

esp8266:
board: esp01_1m

# Enable logging
logger:

# Enable Home Assistant API
api:
encryption:
key: ---- REDACTED -----

ota:
- platform: esphome
password: ---- REDACTED -----

wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password

# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Dog-Door Fallback Hotspot"
password: ---- REDACTED -----

binary_sensor:
- platform: gpio
id: inside_pressure_mat
pin:
number: GPIO05
mode: INPUT_PULLUP
inverted: True
name: Inside Pressure Mat
filters:
- delayed_on: 1s
on_state:
then:
- switch.toggle: dog_door_switch

- platform: gpio
id: outside_pressure_mat
pin:
number: GPIO04
mode: INPUT_PULLUP
inverted: True
name: Outside Pressure Mat
filters:
- delayed_on: 1s
on_state:
then:
- switch.toggle: dog_door_switch

switch:
- platform: gpio
id: dog_door_switch
pin:
number: GPIO02
name: Door Switch

captive_portal:


Current layout

Might be better not to use D4/GPIO2. ESP8266 Pinout Reference: Which GPIO pins should you use? | Random Nerd Tutorials

Also you have specified board wrong. It is not a esp01_1m. Try d1_mini.

1 Like

Good call on the D4 port, I had not seen that. That would explain issues #2 and #3.

|D4|GPIO2|pulled up|OK|HIGH at boot
connected to on-board LED, boot fails if pulled LOW

You could use wait until the binary sensors are off and close the door

  - wait_until:
      condition:
      - binary_sensor.is_off: outside_pressure_mat
      - binary_sensor.is_off: inside_pressure_mat
  - switch.turn_off: dog_door_switch


1 Like

Could you please post photo(s) of the existing board modifications/connections to the D1 mini, please? I’ve wanted to do this myself, but don’t have the electronics experience to figure that out on my own.

Thanks!

1 Like

Ya, later today or tomorrow I am going to open it up, and make some changes, will take pictures then.

That worked!! Thanks.

Hi, any chance you’ve been able to take those pics of your build yet? With triple-digit heat everywhere, making a dumb cat door smart in the A/C sounds like a good diversion this weekend.