|
@@ -1,11 +1,14 @@
|
|
|
substitutions:
|
|
substitutions:
|
|
|
devicename: ff-akwarium-plug-01
|
|
devicename: ff-akwarium-plug-01
|
|
|
- low_devicename: ff-akwarium-plug-01
|
|
|
|
|
|
|
+ low_devicename: ff_akwarium_plug_01
|
|
|
friendly_devicename: FF Akwarium Light 01
|
|
friendly_devicename: FF Akwarium Light 01
|
|
|
|
|
|
|
|
esphome:
|
|
esphome:
|
|
|
name: $devicename
|
|
name: $devicename
|
|
|
friendly_name: $friendly_devicename
|
|
friendly_name: $friendly_devicename
|
|
|
|
|
+ platformio_options:
|
|
|
|
|
+ lib_ignore:
|
|
|
|
|
+ - RPAsyncTCP
|
|
|
|
|
|
|
|
bk72xx:
|
|
bk72xx:
|
|
|
board: generic-bk7231t-qfn32-tuya
|
|
board: generic-bk7231t-qfn32-tuya
|
|
@@ -15,6 +18,7 @@ bk72xx:
|
|
|
packages:
|
|
packages:
|
|
|
# Enable Home Assistant API
|
|
# Enable Home Assistant API
|
|
|
esphome: !include common/keys.yaml
|
|
esphome: !include common/keys.yaml
|
|
|
|
|
+ diag: !include common/diag.yaml
|
|
|
|
|
|
|
|
# Enable logging
|
|
# Enable logging
|
|
|
logger:
|
|
logger:
|
|
@@ -27,49 +31,7 @@ wifi:
|
|
|
password: !secret iot_password
|
|
password: !secret iot_password
|
|
|
domain: .int.mmax.cloud
|
|
domain: .int.mmax.cloud
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-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();
|
|
|
|
|
-
|
|
|
|
|
-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
|
|
|
|
|
-
|
|
|
|
|
binary_sensor:
|
|
binary_sensor:
|
|
|
- - platform: status
|
|
|
|
|
- name: Status
|
|
|
|
|
- entity_category: diagnostic
|
|
|
|
|
- platform: gpio
|
|
- platform: gpio
|
|
|
pin:
|
|
pin:
|
|
|
number: P7
|
|
number: P7
|
|
@@ -92,7 +54,6 @@ light:
|
|
|
internal: True
|
|
internal: True
|
|
|
restore_mode: ALWAYS_OFF
|
|
restore_mode: ALWAYS_OFF
|
|
|
|
|
|
|
|
-
|
|
|
|
|
output:
|
|
output:
|
|
|
- platform: gpio
|
|
- platform: gpio
|
|
|
# RED
|
|
# RED
|
|
@@ -109,12 +70,6 @@ status_led:
|
|
|
number: P26
|
|
number: P26
|
|
|
inverted: false
|
|
inverted: false
|
|
|
|
|
|
|
|
-button:
|
|
|
|
|
- - platform: restart
|
|
|
|
|
- id: restart_button
|
|
|
|
|
- name: Restart
|
|
|
|
|
- entity_category: diagnostic
|
|
|
|
|
-
|
|
|
|
|
globals:
|
|
globals:
|
|
|
- id: current_light
|
|
- id: current_light
|
|
|
type: int
|
|
type: int
|
|
@@ -201,5 +156,4 @@ switch:
|
|
|
# - lambda:
|
|
# - lambda:
|
|
|
# name: Daybreak
|
|
# name: Daybreak
|
|
|
# - lambda:
|
|
# - lambda:
|
|
|
-# name: Night
|
|
|
|
|
-
|
|
|
|
|
|
|
+# name: Night
|