-
Notifications
You must be signed in to change notification settings - Fork 1
/
example.yaml
79 lines (69 loc) · 1.66 KB
/
example.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
external_components:
# Pull from Github
- source: github://mill1000/esphome-winix-c545@main
components: [winix_c545]
# # Pull from local folder
# - source: components
# components: [winix_c545]
uart:
- tx_pin: 26
rx_pin: 25
baud_rate: 115200
winix_c545:
fan:
- platform: winix_c545
name: None # Use friendly name of device
globals:
- id: filter_lifetime_value
type: int
restore_value: yes
sensor:
- platform: winix_c545
filter_age:
name: Filter Age
id: filter_age
on_value:
then:
- component.update: filter_remaining
filter_lifetime:
id: raw_filter_lifetime
internal: true
on_value:
then:
- lambda: |-
id(filter_lifetime_value) = x;
id(filter_lifetime_sensor).update();
aqi:
name: AQI
light:
name: Light Intensity
- platform: template
name: Filter Lifetime
id: filter_lifetime_sensor
device_class: duration
entity_category: diagnostic
unit_of_measurement: h
accuracy_decimals: 0
lambda: |-
auto value = id(filter_lifetime_value);
return (value == 0) ? NAN : value;
on_value:
then:
- component.update: filter_remaining
- platform: template
name: Filter Remaining
id: filter_remaining
device_class: ""
entity_category: diagnostic
unit_of_measurement: "%"
accuracy_decimals: 0
lambda: |-
return 100 * (1 - (id(filter_age).state / id(filter_lifetime_sensor).state));
text_sensor:
- platform: winix_c545
aqi_indicator:
name: AQI Indicator
switch:
- platform: winix_c545
plasmawave:
name: Plasmawave