-
Notifications
You must be signed in to change notification settings - Fork 2
/
status_sensors.yaml
86 lines (86 loc) · 2.59 KB
/
status_sensors.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2023 Ilia Sotnikov
---
text_sensor:
- platform: template
id: lawn_sprinklers_state
name: "Lawn sprinklers state"
icon: "mdi:state-machine"
entity_category: diagnostic
lambda: !include
file: script_controller_status.yaml
vars:
sprinkler: lawn_sprinklers
update_interval: 5s
- platform: template
id: flowerbed_sprinklers_state
entity_category: diagnostic
name: "Flowerbed sprinklers state"
icon: "mdi:state-machine"
lambda: !include
file: script_controller_status.yaml
vars:
sprinkler: flowerbed_sprinklers
update_interval: 5s
- platform: template
entity_category: diagnostic
id: pump_state
name: "Pump state"
icon: "mdi:pump"
update_interval: 5s
lambda: |-
return { id(${pump_relay_id}).state ? "Active" : "Idle" };
- platform: template
entity_category: diagnostic
id: peripherals_power_state
name: "Peripherals power"
icon: "mdi:flash-triangle-outline"
update_interval: 5s
lambda: |-
return {
id(${peripherals_power_off_relay_id}).state ? "Off" : "On"
};
- platform: template
id: lawn_sprinklers_next_schedule
name: "Lawn sprinklers: next schedule"
icon: "mdi:alarm"
update_interval: 5s
entity_category: diagnostic
lambda: |-
#ifdef HAS_SCHEDULE
auto next_schedule = lawn_schedule->get_next_schedule();
if (next_schedule.has_value())
return { next_schedule.value().strftime("%c") };
#endif
return { "N/A" };
- platform: template
id: flowerbed_sprinklers_next_schedule
name: "Flowerbed sprinklers: next schedule"
icon: "mdi:alarm"
update_interval: 5s
entity_category: diagnostic
lambda: |-
#ifdef HAS_SCHEDULE
auto next_schedule = flowerbed_schedule->get_next_schedule();
if (next_schedule.has_value())
return { next_schedule.value().strftime("%c") };
#endif
return { "N/A" };
- platform: template
id: lawn_sprinklers_run_time_remaining
name: "Lawn sprinklers: run time remaining"
icon: "mdi:timer-sand"
update_interval: 1${run_duration_uom}
lambda: !include
file: script_controller_run_time_remaining.yaml
vars:
sprinkler: lawn_sprinklers
- platform: template
id: flowerbed_sprinklers_run_time_remaining
name: "Flowerbed sprinklers: run time remaining"
icon: "mdi:timer-sand"
update_interval: 1${run_duration_uom}
lambda: !include
file: script_controller_run_time_remaining.yaml
vars:
sprinkler: flowerbed_sprinklers