I agree, I already sent a question. We will see.
Iāve integrated my brotherās old home wiring into esphome with a MCP23017 IO extender. It gives you 16 contacts from which you can build binary sensors in Home Assistant with. Itās pretty simple stuff.
@pashdown Iām working on the same setup; any suggestions on how to manage a sensor like that one?
Essential the contact change the status and return to the original on extension of the cord (or in the other way round) , so the binary sensor change many time in a short timeframe
That looks interesting. Any chance you can provide a little documentation on the ESP you used, how you wired it and then the code youāre running?
It was a simple 8266. Not a lot of processing going on, so it works fine. Here is my esphome setup:
substitutions:
device_name: "doors"
friendly_name: "Doors"
esphome:
name: ${device_name}
esp8266:
board: d1_mini
wifi:
networks:
- ssid: !secret wifi_ssid
password: !secret wifi_password
# Optional manual IP
manual_ip:
static_ip: 192.168.0.7
gateway: 192.168.0.1
subnet: 255.255.255.0
# use_address: 192.168.1.190
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap: {}
# Enable logging
logger:
# Enable Home Assistant API
ota:
password: !secret ota_password
api:
encryption:
key: "ENCRYPTIONKEYHERE="
captive_portal:
status_led:
pin: GPIO2
i2c:
sda: D6
scl: D5
scan: True
# Example configuration entry
mcp23017:
- id: 'mcp23017_hub'
address: 0x20
# Individual inputs
binary_sensor:
- platform: gpio
device_class: door
name: "Guest Exit"
pin:
mcp23xxx: mcp23017_hub
# Use pin B7
number: 15
# One of INPUT or INPUT_PULLUP
mode:
input: true
pullup: true
inverted: false
- platform: gpio
device_class: door
name: "Lower Rear Middle Door"
pin:
mcp23xxx: mcp23017_hub
# Use pin B6
number: 14
# One of INPUT or INPUT_PULLUP
mode:
input: true
pullup: true
inverted: false
- platform: gpio
device_class: door
name: "Kitchen Door"
pin:
mcp23xxx: mcp23017_hub
# Use pin B5
number: 13
# One of INPUT or INPUT_PULLUP
mode:
input: true
pullup: true
inverted: false
- platform: gpio
device_class: door
name: "Bunker Exterior"
pin:
mcp23xxx: mcp23017_hub
# Use pin B4
number: 12
# One of INPUT or INPUT_PULLUP
mode:
input: true
pullup: true
inverted: false
- platform: gpio
device_class: door
name: "Bunker Interior"
pin:
mcp23xxx: mcp23017_hub
# Use pin B3
number: 11
# One of INPUT or INPUT_PULLUP
mode:
input: true
pullup: true
inverted: false
- platform: gpio
device_class: door
name: "Guest Interior"
pin:
mcp23xxx: mcp23017_hub
# Use pin B2
number: 10
# One of INPUT or INPUT_PULLUP
mode:
input: true
pullup: true
inverted: false
- platform: gpio
device_class: door
name: "Deck Door"
pin:
mcp23xxx: mcp23017_hub
# Use pin B1
number: 9
# One of INPUT or INPUT_PULLUP
mode:
input: true
pullup: true
inverted: false
- platform: gpio
device_class: door
name: "Garage Man Door"
pin:
mcp23xxx: mcp23017_hub
# Use pin B8
number: 8
# One of INPUT or INPUT_PULLUP
mode:
input: true
pullup: true
inverted: false
- platform: gpio
device_class: door
name: "Front Door"
pin:
mcp23xxx: mcp23017_hub
# Use pin A1
number: 1
# One of INPUT or INPUT_PULLUP
mode:
input: true
pullup: true
inverted: false
Iām guessing if it is two wire, one wire to the ground of the ESP and the other wire to a GPIO pin.
Thanks for adding the update.
yes, correct. any ideas regarding how to count the events?