Skip to content

Instantly share code, notes, and snippets.

@keyboardcrunch
Last active April 30, 2024 01:05
Show Gist options
  • Save keyboardcrunch/39704ce50143ec20a933964113e8a5a6 to your computer and use it in GitHub Desktop.
Save keyboardcrunch/39704ce50143ec20a933964113e8a5a6 to your computer and use it in GitHub Desktop.
esphome - esp32s3 - 3 button wifi remote
# Device configuration
esphome:
name: "remoteOne"
friendly_name: RemoteOne
esp32:
board: esp32-s3-devkitc-1
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "no-hax-plz"
ota:
password: "no-hax-plz"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
power_save_mode: HIGH # problematic over distances/through walls, LIGHT is default
http_request:
useragent: esphome/device
timeout: 10s
# Button configurations
# Button 1
binary_sensor:
- platform: gpio
pin:
number: GPIO5
mode: INPUT_PULLUP
name: 'Button 1'
filters:
- invert:
on_multi_click:
- timing:
- ON for at most 1s
- OFF for at most 1s
- ON for at most 1s
- OFF for at least 0.2s
then:
- logger.log: "Double Clicked"
- http_request.send:
method: GET
url: http://192.168.1.74:5678/webhook/3937cde2-95e3-4152-87ca-5c4f7a917a6f
verify_ssl: false
- timing:
- ON for 1s to 2s
- OFF for at least 0.5s
then:
- logger.log: "Single Long Clicked"
- timing:
- ON for at most 1s
- OFF for at least 0.5s
then:
- logger.log: "Single Short Clicked"
- http_request.send:
method: GET
url: http://192.168.1.74:5678/webhook/398fbf99-8f97-438d-ab47-ee41032af73b
verify_ssl: false
# Button 2
- platform: gpio
pin:
number: GPIO6
mode: INPUT_PULLUP
name: 'Button 2'
filters:
- invert:
on_multi_click:
- timing:
- ON for at most 1s
- OFF for at most 1s
- ON for at most 1s
- OFF for at least 0.2s
then:
- homeassistant.service:
service: light.toggle
data:
entity_id: light.bedroom_lights
- logger.log: "Double Clicked"
#- http_request.get: http://192.168.1.74:5678/webhook/bf3af71e-d18d-4787-bebb-3a87a8da4086
- timing:
- ON for 1s to 2s
- OFF for at least 0.5s
then:
- homeassistant.service:
service: light.toggle
data:
entity_id: light.1klr_light # livingroom server corner
- logger.log: "Single Long Clicked"
- timing:
- ON for at most 1s
- OFF for at least 0.5s
then:
- homeassistant.service:
service: light.toggle
data:
entity_id: light.livingroom_lights
- logger.log: "Single Short Clicked"
#- http_request.get: http://192.168.1.74:5678/webhook/0d22c604-f38b-4ff6-8ddc-402b639a1d47
# Button 3
- platform: gpio
pin:
number: GPIO43
mode: INPUT_PULLUP
name: 'Button 3'
filters:
- invert:
on_multi_click:
- timing:
- ON for at most 1s
- OFF for at most 1s
- ON for at most 1s
- OFF for at least 0.2s
then:
- logger.log: "Double Clicked"
#- http_request.get: http://192.168.1.74:5678/webhook/917482fe-da4a-473a-9822-2cf89d50a556
- timing:
- ON for 1s to 2s
- OFF for at least 0.5s
then:
- logger.log: "Single Long Clicked"
- timing:
- ON for at most 1s
- OFF for at least 0.5s
then:
- logger.log: "Single Short Clicked"
- http_request.send:
method: GET
url: http://192.168.1.74:5678/webhook/798583dc-87fe-4ad6-9616-f2be6d6c0af9
verify_ssl: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment