Created
January 7, 2022 04:27
-
-
Save zeroping/c17a8d4856b42f4e4ec32e9a00222a2b to your computer and use it in GitHub Desktop.
ESPHome config for Linkind relay switch
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
# Basic Config | |
#--- | |
#substitutions: | |
# https://esphome.io/guides/configuration-types.html#substitutions | |
# device_name: esp-br3 # hostname & entity_id | |
esphome: | |
name: ${device_name} | |
esp32: | |
board: esp32dev | |
framework: | |
type: esp-idf | |
sdkconfig_options: | |
CONFIG_FREERTOS_UNICORE: y | |
wifi: | |
# https://esphome.io/components/wifi | |
#captive_portal: | |
# doesn't work under esp-idf | |
#web_server: | |
#port: 80 | |
# https://esphome.io/components/web_server.html | |
# doesn't work under esp-idf | |
logger: | |
# https://esphome.io/components/logger | |
api: | |
#password: !secret esphome_api_password | |
# https://esphome.io/components/api | |
reboot_timeout: 0s #disable auto-reboot if homeassistant is not connecting | |
ota: | |
#password: !secret esphome_ota_password | |
# https://esphome.io/components/ota | |
light: | |
- platform: binary | |
id: relaylight | |
name: ${device_name} relay | |
output: relay | |
on_turn_on: | |
- output.turn_on: | |
id: green_led | |
on_turn_off: | |
- output.turn_off: | |
id: green_led | |
- platform: binary | |
id: greenlight | |
name: ${device_name} green led | |
output: green_led | |
- platform: status_led | |
#id: redlight | |
name: ${device_name} red led | |
pin: GPIO26 | |
output: | |
- platform: gpio | |
# https://esphome.io/components/output/gpio.html | |
pin: GPIO5 | |
inverted: false | |
id: relay | |
- platform: gpio | |
# https://esphome.io/components/output/gpio.html | |
pin: GPIO14 | |
inverted: false | |
id: green_led | |
#pin: GPIO25 might or might not be hooked up to something? Not clear. | |
#- platform: gpio | |
## https://esphome.io/components/output/gpio.html | |
#pin: GPIO26 | |
#inverted: false | |
#id: red_led | |
#replaced with the status_led entity above | |
binary_sensor: | |
- platform: gpio | |
# https://esphome.io/components/binary_sensor/gpio.html | |
pin: | |
number: GPIO32 | |
inverted: true | |
mode: INPUT_PULLUP | |
name: ${device_name} Top Button | |
internal: false | |
on_click: | |
- light.turn_on: relaylight | |
- platform: gpio | |
# https://esphome.io/components/binary_sensor/gpio.html | |
pin: | |
number: GPIO33 | |
inverted: true | |
mode: INPUT_PULLUP | |
name: ${device_name} Bottom Button | |
internal: False | |
on_click: | |
- light.turn_off: relaylight | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No, sorry to say I didn't. I eventually just gave up on putting the ble_tracker on it.