Skip to content

Instantly share code, notes, and snippets.

@gretel
Created December 8, 2022 17:50
Show Gist options
  • Save gretel/0c41fbe0a1fed7baf32e8b49f848710f to your computer and use it in GitHub Desktop.
Save gretel/0c41fbe0a1fed7baf32e8b49f848710f to your computer and use it in GitHub Desktop.
ESPHome on Yunshan ESP8266
#$ esphome -s devicename bathmirrorheating -s upper_devicename BathMirrorHeating run yunshanesp8266.yaml --device /dev/cu.usbserial-2230
---
substitutions:
devicename: 'yunshanesp8266'
upper_devicename: 'Yunshan ESP8266'
devicecomment: 'https://arduinoplusplus.wordpress.com/2018/08/28/home-automation-and-the-internet-of-things-the-start/'
logger_level: 'INFO'
esphome:
name: ${devicename}
comment: ${devicecomment}
project:
name: "jitter.eu"
version: "0.3.1"
esp8266:
board: esp12e
status_led:
pin:
number: GPIO2
inverted: True
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_pass
domain: !secret domain
fast_connect: on
ota:
logger:
level: ${logger_level}
# web_server:
# port: 80
# local: true
api:
encryption:
key: !secret yunshan_esp8266_key
time:
- platform: homeassistant
id: homeassistant_time
sensor:
- platform: uptime
name: "${upper_devicename} Uptime"
update_interval: 5s
icon: "mdi:clock-start"
- platform: wifi_signal
name: "${upper_devicename} WiFi Signal"
update_interval: 10s
icon: "mdi:wifi"
text_sensor:
- platform: version
name: "${upper_devicename} Version"
icon: "mdi:exponent-box"
- platform: wifi_info
ip_address:
name: "${upper_devicename} IP Address"
icon: "mdi:counter"
switch:
- platform: restart
name: "${upper_devicename} Restart"
icon: "mdi:restart"
- platform: gpio
pin: GPIO4
id: relay
name: '${upper_devicename} Relay'
# icon: mdi:power-socket-eu
binary_sensor:
- platform: status
name: "${upper_devicename} Status"
- platform: gpio
pin:
number: GPIO5
mode: INPUT_PULLUP
inverted: True
name: "${upper_devicename} Button"
# on_press:
# then:
# - switch.toggle: relay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment