-
Notifications
You must be signed in to change notification settings - Fork 53
/
control_mode.yaml
57 lines (52 loc) · 1.75 KB
/
control_mode.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
control_mode:
mqtt:
binary_sensor:
- name: control
state_topic: "states/control"
switch:
- platform: template
switches:
control_mode:
friendly_name: "Режим управления"
value_template: "{{ is_state('binary_sensor.control', 'on') }}"
turn_on:
service: mqtt.publish
data_template:
topic: "states/control"
payload_template: 'ON'
retain: true
turn_off:
service: mqtt.publish
data_template:
topic: "states/control"
payload_template: 'OFF'
retain: true
icon_template: >-
{% if is_state('switch.control_mode', 'on') %}
mdi:server
{% else %}
mdi:server-off
{% endif %}
# - platform: template
# switches:
# control_mode:
# friendly_name: "Режим управления"
# value_template: "{{ is_state('binary_sensor.control', 'off') }}"
# turn_on:
# service: mqtt.publish
# data_template:
# topic: "states/control"
# payload_template: 'OFF'
# retain: true
# turn_off:
# service: mqtt.publish
# data_template:
# topic: "states/control"
# payload_template: 'ON'
# retain: true
# icon_template: >-
# {% if is_state('switch.control_mode', 'on') %}
# mdi:server
# {% else %}
# mdi:server-off
# {% endif %}