93 lines
1.7 KiB
YAML
93 lines
1.7 KiB
YAML
substitutions:
|
|
device_name: "Slaapkamer Lamp"
|
|
|
|
esphome:
|
|
name: shelly1-slaapkamer
|
|
|
|
esp8266:
|
|
board: esp01_1m
|
|
|
|
wifi:
|
|
ssid: "ItHurtsWhenIP"
|
|
password: "BKl@3660"
|
|
manual_ip:
|
|
static_ip: 10.1.0.25
|
|
gateway: 10.1.0.1
|
|
subnet: 255.255.255.0
|
|
dns1: 1.1.1.1
|
|
dns2: 8.8.8.8
|
|
power_save_mode: none
|
|
ap:
|
|
ssid: "Slaapkamer Fallback Hotspot"
|
|
password: "bINLLate9rIA"
|
|
captive_portal:
|
|
|
|
logger:
|
|
|
|
api:
|
|
|
|
ota:
|
|
password: ""
|
|
platform: esphome
|
|
|
|
web_server:
|
|
port: 80
|
|
|
|
text_sensor:
|
|
- platform: wifi_info
|
|
ip_address:
|
|
name: ${device_name} IP
|
|
- platform: wifi_info
|
|
bssid:
|
|
name: ${device_name} BSSID
|
|
- platform: template
|
|
name: "${device_name} WiFi Strength"
|
|
update_interval: 60s
|
|
lambda: |-
|
|
float rssi = id(wifi_signal_sensor).state;
|
|
if (rssi <= -80.0) {
|
|
return std::string("WEAK");
|
|
} else if (rssi <= -70.0) {
|
|
return std::string("OK");
|
|
} else if (rssi <= -60.0) {
|
|
return std::string("GOOD");
|
|
} else {
|
|
return std::string("PERFECT");
|
|
}
|
|
|
|
sensor:
|
|
- platform: uptime
|
|
name: ${device_name} Uptime
|
|
|
|
- platform: wifi_signal
|
|
name: ${device_name} WiFi Signal
|
|
update_interval: 60s
|
|
id: wifi_signal_sensor
|
|
|
|
switch:
|
|
- platform: gpio
|
|
name: ${device_name}
|
|
pin: GPIO4
|
|
id: shelly_relay
|
|
restore_mode: ALWAYS_OFF
|
|
- platform: "restart"
|
|
name: "${device_name} Restart"
|
|
|
|
binary_sensor:
|
|
- platform: gpio
|
|
name: ${device_name} Input
|
|
pin:
|
|
number: GPIO5
|
|
filters:
|
|
- delayed_on_off: 50ms
|
|
id: button
|
|
|
|
time:
|
|
- platform: sntp
|
|
id: sntp_time
|
|
timezone: Europe/Brussels
|
|
servers:
|
|
- time.google.com
|
|
- 0.be.pool.ntp.org
|
|
- 3.be.pool.ntp.org
|