Created
January 31, 2024 14:12
-
-
Save letsautomatenet/21d47ec560214b210a6eee8d9d1ceaab to your computer and use it in GitHub Desktop.
Car Seat Sensor - EST-PoE-32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### START - Update this section with relevant details ### | |
substitutions: | |
device_name: "device-name-here" | |
friendly_name: Device Name Here | |
board_type: esp32dev | |
framework: esp-idf # arduino or esp-idf (recommended for ESP32) | |
# ESPHome API used by Home Assistant, etc | |
# If you go to this page it generates one for you automatically! | |
# https://esphome.io/components/api.html#configuration-variables | |
api_key: "Generate a key and put it here" | |
ap_password: "randomsecurepassword" # Fallback WiFi Access Point password | |
ota_password: "differentrandomsecurepassword" # Password used to remotely flash firmware | |
### END ### | |
esphome: | |
name: ${device_name} | |
friendly_name: ${friendly_name} | |
esp32: | |
board: ${board_type} | |
framework: | |
type: ${framework} | |
# Enable logging | |
logger: | |
# Enable Home Assistant API | |
api: | |
encryption: | |
key: ${api_key} | |
ota: | |
password: ${ota_password} | |
# Ethernet for EST-PoE-32 | |
ethernet: | |
type: LAN8720 | |
mdc_pin: GPIO23 | |
mdio_pin: GPIO18 | |
clk_mode: GPIO17_OUT | |
phy_addr: 0 | |
power_pin: GPIO12 | |
# WiFi cannot be active at the same time as Ethernet, but useful to keep as a fallback | |
# wifi: | |
# ssid: !secret wifi_ssid | |
# password: !secret wifi_password | |
# Enable fallback hotspot (captive portal) in case wifi connection fails | |
# ap: | |
# ssid: ${device_name} | |
# password: ${ap_password} | |
captive_portal: | |
# Restart & Safe Mode Buttons | |
button: | |
- platform: restart | |
name: "Restart Device" | |
- platform: safe_mode | |
name: "Restart in Safe Mode" | |
binary_sensor: | |
# Pressure Sensors - Digital Input - 2 second updates | |
- platform: gpio | |
pin: | |
number: 36 | |
mode: | |
input: true | |
id: sofaseat2s | |
name: "Marc Seat 2s" | |
filters: | |
- delayed_off: 2000ms | |
- platform: gpio | |
pin: | |
number: 39 | |
mode: | |
input: true | |
id: loveseat2s | |
name: "Christine Seat 2s" | |
filters: | |
- delayed_off: 2000ms | |
# Pressure Sensors - 5 second updates | |
- platform: template | |
name: "Christine Seat 5s" | |
id: loveseat5s | |
lambda: |- | |
return id(loveseat2s).state; | |
filters: | |
- delayed_off: 5000ms | |
- platform: template | |
name: "Marc Seat 5s" | |
id: sofaseat5s | |
lambda: |- | |
return id(sofaseat2s).state; | |
filters: | |
- delayed_off: 5000ms |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment