-
Notifications
You must be signed in to change notification settings - Fork 108
/
homeassistant.configuration.yaml
146 lines (132 loc) · 4.56 KB
/
homeassistant.configuration.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# кусок конфигурации отсутствует
# в актуальной версии настраивается через графический интерфейс
mqtt:
discovery: true
discovery_prefix: homeassistant
password: hello
birth_message:
topic: 'homeassistant/status'
payload: 'online'
# С недавнего времени появился домен mqtt в котором описываются все датчики
mqtt:
sensor:
# waterius на кухне
- name: "Kitchen Cold Water"
object_id: wateriuskcwm
state_topic: "waterius/kitchen/ch1"
value_template: "{{ value }}"
unit_of_measurement: "m³"
device_class: water
state_class: total
icon: mdi:water
device:
manufacturer: Waterius
identifiers: [wateriusk]
connections: [["mac", "aa:bb:cc:dd:ee:ff"]]
suggested_area: Kitchen
- name: "Kitchen Hot Water"
object_id: wateriuskhwm
state_topic: "waterius/kitchen/ch0"
value_template: "{{ value }}"
unit_of_measurement: "m³"
device_class: water
state_class: total
icon: mdi:water
device:
identifiers: [wateriusk]
- name: "Kitchen Voltage"
object_id: wateriuskv
state_topic: "waterius/kitchen/voltage"
value_template: "{{ value }}"
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
entity_category: diagnostic
icon: mdi:lightning-bolt
device:
identifiers: [wateriusk]
- name: "Kitchen Battery"
object_id: wateriuskb
icon: mdi:battery
device_class: battery
state_class: measurement
entity_category: diagnostic
unit_of_measurement: '%'
state_topic: 'waterius/kitchen/voltage_diff'
device:
identifiers: [wateriusk]
value_template: >
{% if float(value) > 0.1 %}
{{ 0 }}
{% else %}
{% if float(value) > 0.05 %}
{{ ((0.1 - value | float) * 500) | round(0) }}
{% else %}
{{ (25 + (0.05 - value | float) * 1500) | round(0) }}
{% endif %}
{% endif %}
# waterius в ванной
- name: "Bathroom Cold Water"
object_id: wateriusbcwm
state_topic: "waterius/bathroom/ch1"
value_template: "{{ value }}"
unit_of_measurement: "m³"
device_class: water
state_class: total
icon: mdi:water
device:
manufacturer: Waterius
identifiers: [wateriusb]
connections: [["mac", "aa:bb:cc:dd:ee:ff"]]
suggested_area: Bathroom
- name: "Bathroom Hot Water"
object_id: wateriusbhwm
state_topic: "waterius/bathroom/ch0"
value_template: "{{ value }}"
unit_of_measurement: "m³"
device_class: water
state_class: total
icon: mdi:water
device:
identifiers: [wateriusb]
- name: "Bathroom Voltage"
object_id: wateriusbv
state_topic: "waterius/bathroom/voltage"
value_template: "{{ value }}"
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
entity_category: diagnostic
icon: mdi:lightning-bolt
device:
identifiers: [wateriusb]
- name: "Bathroom Battery"
object_id: wateriusbb
icon: mdi:battery
device_class: battery
state_class: measurement
entity_category: diagnostic
unit_of_measurement: '%'
state_topic: 'waterius/bathroom/voltage_diff'
device:
identifiers: [wateriusb]
value_template: >
{% if float(value) > 0.1 %}
{{ 0 }}
{% else %}
{% if float(value) > 0.05 %}
{{ ((0.1 - value | float) * 500) | round(0) }}
{% else %}
{{ (25 + (0.05 - value | float) * 1500) | round(0) }}
{% endif %}
{% endif %}
# Создаём сенсор счётчик прошедшего времени с момента последнего обновления данных Ватериусом
# Используем время последнего обновления показаний холодной воды (object_id: wateriuskcwm), так как этот сенсор обновляется
# чаще, чем все остальные
template:
sensors:
vaterius_last_seen:
friendly_name: 'Ватериус вне сети'
value_template: >
{{(as_timestamp(now())-as_timestamp(states.sensor.wateriuskcwm.last_updated)) | timestamp_custom('%Hh %Mm %Ss',false)}}
# кусок конфигурации отсутствует