Skip to content

Instantly share code, notes, and snippets.

@haade-administrator
Last active December 20, 2021 02:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haade-administrator/ba9b6667ece8269cd37f64e34e908977 to your computer and use it in GitHub Desktop.
Save haade-administrator/ba9b6667ece8269cd37f64e34e908977 to your computer and use it in GitHub Desktop.
Integrate yunshan lysignal esp 8266 7 to 30v Input to homeassistant
substitutions:
devicename: esp-yunshan
friendly_name: Porte Garage
device_description: Controle Porte Garage
esphome:
name: $devicename
comment: ${device_description}
platform: ESP8266
board: esp12e
# ligne 16 à 19 manual_ip obligatoire
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
static_ip: 192.168.1.X
gateway: 192.168.1.1
subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "${friendly_name} Fallback AP"
password: "!secret fallback_ap_password"
captive_portal:
# Enable Home Assistant API
api:
password: !secret api_password
ota:
password: !secret ota_password
# Enable logging
logger:
# status de la led du signal wifi
status_led:
pin: GPIO2
# enclanchement relais
switch:
- platform: gpio
name: "${friendly_name} Relais"
icon: "hass:remote"
pin: GPIO4
id: relais1
# redémarrage du module
- platform: restart
name: "Yunshan Restart"
# extinction du module
- platform: shutdown
name: "${friendly_name} Stop"
# optocoupleur/interrupteur physique avec automatisation/liaison du relais GPIO4
binary_sensor:
- platform: gpio
pin:
number: GPIO5
mode: INPUT_PULLUP
inverted: True
name: "${friendly_name} Optocoupleur"
icon: "hass:light-switch"
on_press:
then:
- switch.toggle: relais1
# Status de connection
- platform: status
name: "${friendly_name} Status"
# version esphome
text_sensor:
- platform: version
name: "${friendly_name} ESPHome Version"
# force du signal wifi renouvelé toutes les 60s
sensor:
- platform: wifi_signal
name: "${friendly_name} WiFi Signal"
update_interval: 60s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment