|
|
@@ -8,15 +8,18 @@ substitutions:
|
|
|
esphome:
|
|
|
name: $devicename
|
|
|
friendly_name: $friendly_devicename
|
|
|
+ platformio_options:
|
|
|
+ lib_ignore:
|
|
|
+ - RPAsyncTCP
|
|
|
+
|
|
|
|
|
|
bk72xx:
|
|
|
board: generic-bk7231t-qfn32-tuya
|
|
|
- #framework:
|
|
|
- # version: dev
|
|
|
|
|
|
packages:
|
|
|
# Enable Home Assistant API
|
|
|
esphome: !include common/keys.yaml
|
|
|
+ diag: !include common/diag.yaml
|
|
|
|
|
|
logger:
|
|
|
|
|
|
@@ -30,32 +33,6 @@ wifi:
|
|
|
|
|
|
|
|
|
sensor:
|
|
|
- - platform: wifi_signal
|
|
|
- name: "WiFi Signal Sensor"
|
|
|
- update_interval: 60s
|
|
|
-
|
|
|
- - platform: uptime
|
|
|
- name: Uptime Sensor
|
|
|
- id: uptime_sensor
|
|
|
- update_interval: 60s
|
|
|
- on_raw_value:
|
|
|
- then:
|
|
|
- - text_sensor.template.publish:
|
|
|
- id: uptime_human
|
|
|
- state: !lambda |-
|
|
|
- int seconds = round(id(uptime_sensor).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 ? to_string(days) + "d " : "") +
|
|
|
- (hours ? to_string(hours) + "h " : "") +
|
|
|
- (minutes ? to_string(minutes) + "m " : "") +
|
|
|
- (to_string(seconds) + "s")
|
|
|
- ).c_str();
|
|
|
#
|
|
|
# power monitoring
|
|
|
#
|
|
|
@@ -164,18 +141,6 @@ sensor:
|
|
|
max_value: 1
|
|
|
update_interval: never
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-text_sensor:
|
|
|
- - platform: template
|
|
|
- name: Uptime Human Readable
|
|
|
- id: uptime_human
|
|
|
- icon: mdi:clock-start
|
|
|
- - platform: wifi_info
|
|
|
- ip_address:
|
|
|
- name: IP Address
|
|
|
- entity_category: diagnostic
|
|
|
-
|
|
|
light:
|
|
|
- platform: binary
|
|
|
name: "led"
|
|
|
@@ -183,7 +148,6 @@ light:
|
|
|
id: led
|
|
|
output: red_led
|
|
|
|
|
|
-
|
|
|
output:
|
|
|
- platform: gpio
|
|
|
id: red_led
|
|
|
@@ -191,17 +155,12 @@ output:
|
|
|
number: P8
|
|
|
# inverted: true
|
|
|
|
|
|
-
|
|
|
status_led:
|
|
|
pin:
|
|
|
number: P10
|
|
|
# inverted: true
|
|
|
|
|
|
binary_sensor:
|
|
|
- - platform: status
|
|
|
- name: Status
|
|
|
- entity_category: diagnostic
|
|
|
-
|
|
|
- platform: gpio
|
|
|
pin:
|
|
|
number: P7
|
|
|
@@ -216,9 +175,6 @@ binary_sensor:
|
|
|
on_click:
|
|
|
- switch.toggle: outlet
|
|
|
|
|
|
- - platform: status
|
|
|
- name: ${friendly_devicename} status
|
|
|
-
|
|
|
switch:
|
|
|
- platform: gpio
|
|
|
name: ${friendly_devicename} Outlet
|