This commit is contained in:
Victor Alexandrovich Tsyrenschikov
2026-02-14 21:21:36 +05:00
parent 8bb4fec06a
commit acc09e6352

109
node.yaml Normal file
View File

@@ -0,0 +1,109 @@
substitutions:
# Modify variables based on your settings
hostname: "heart"
devicename: heart light
esphome:
name: heart
esp8266:
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "Iw7I/llBJ4LsVy28quiL5/imptDeJxix+oUOvF2kAZs="
ota:
- platform: esphome
password: "7764e46209332102a3622e6bceb2afba"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
# ap:
# ssid: "Heart Fallback Hotspot"
# password: "f2MTBkrPhnmX"
use_address: 192.168.88.164
manual_ip:
static_ip: 192.168.88.164
gateway: 192.168.88.1
subnet: 255.255.255.0
# dns1: 8.8.8.8
# dns2: 8.8.4.4
captive_portal:
switch:
- platform: gpio
pin: GPIO0
name: "Heart switch"
inverted: true
# The following can be omitted
- platform: restart
name: ${devicename} restart
sensor:
- platform: wifi_signal
name: ${devicename} wifi signal
update_interval: 600s
# human readable uptime sensor output to the text sensor above
- platform: uptime
name: ${devicename} Uptime in Days
id: uptime_sensor_days
update_interval: 60s
on_raw_value:
then:
- text_sensor.template.publish:
id: uptime_human
state: !lambda |-
int seconds = round(id(uptime_sensor_days).raw_state);
int days = seconds / (24 * 3600);
seconds = seconds % (24 * 3600);
int hours = seconds / 3600;
seconds = seconds % 3600;
int minutes = seconds / 60;
seconds = seconds % 60;
return (
(days ? String(days) + "d " : "") +
(hours ? String(hours) + "h " : "") +
(minutes ? String(minutes) + "m " : "") +
(String(seconds) + "s")
).c_str();
time:
- platform: homeassistant
id: homeassistant_time
# Text sensors with general information.
text_sensor:
# Expose ESPHome version as sensor.
- platform: version
name: $devicename Version
# Expose WiFi information as sensors.
- platform: wifi_info
ip_address:
name: $devicename IP
bssid:
name: $devicename BSSID
# human readable update text sensor from sensor:uptime
- platform: template
name: Uptime Human Readable
id: uptime_human
icon: mdi:clock-start
web_server:
port: 80
auth:
username: "silver"
password: "cbvgcjy0"