mirror of
https://github.com/Anonym-tsk/smart-domofon.git
synced 2026-01-06 08:39:00 +03:00
call_start_detect_delay fix & action sensor
This commit is contained in:
@@ -59,45 +59,6 @@ globals:
|
||||
restore_value: yes
|
||||
initial_value: 'false'
|
||||
|
||||
sensor:
|
||||
- platform: template
|
||||
name: "${board_name} Heap Size"
|
||||
lambda: "return ESP.getFreeHeap();"
|
||||
update_interval: 20s
|
||||
unit_of_measurement: bytes
|
||||
accuracy_decimals: 0
|
||||
entity_category: "diagnostic"
|
||||
|
||||
- platform: uptime
|
||||
internal: true
|
||||
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
|
||||
id: uptime_human
|
||||
name: "${board_name} Uptime"
|
||||
icon: mdi:clock-start
|
||||
entity_category: "diagnostic"
|
||||
|
||||
substitutions:
|
||||
# Ge1mer board
|
||||
board: esp12e
|
||||
@@ -117,4 +78,5 @@ packages:
|
||||
switch: !include switch.yaml
|
||||
button: !include button.yaml
|
||||
light: !include light.yaml
|
||||
sensor: !include sensor.yaml
|
||||
binary_sensor: !include binary_sensor.yaml
|
||||
|
||||
Reference in New Issue
Block a user