Skip to content

Instantly share code, notes, and snippets.

@igresc
Created January 6, 2024 23:52
Show Gist options
  • Save igresc/c3130371b7124ca7850b43bf3ac204c4 to your computer and use it in GitHub Desktop.
Save igresc/c3130371b7124ca7850b43bf3ac204c4 to your computer and use it in GitHub Desktop.
esphome:
name: action-button
friendly_name: action-button
esp32:
board: wemos_d1_mini32
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "[REDACTED]"
ota:
password: "[REDACTED]"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Action-Button Fallback Hotspot"
password: "[REDACTED]"
captive_portal:
http_request:
useragent: esphome/device
timeout: 10s
binary_sensor:
- platform: gpio
pin:
number: 5
mode:
input: true
pulldown: true
name: "Action Button"
id: action_button
on_press:
then:
- http_request.post:
url: [REDACTED]
headers:
Content-Type: application/json
json:
text: "Hi from ESPhome"
verify_ssl: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment