-
Notifications
You must be signed in to change notification settings - Fork 2
/
tx_ultimate_07_soggiorno_corridoio.yaml
98 lines (86 loc) · 2.55 KB
/
tx_ultimate_07_soggiorno_corridoio.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
substitutions:
name: "interruttore-soggiorno-corr"
friendly_name: "Soggiorno Corridoio"
use_ip_address: 192.168.2.147 # Usato da esphome per monitor e upload
wifi_ssid: !secret wifi_dmz_ssid
wifi_password: !secret wifi_dmz_password
#esp32_ble_tracker:
# scan_parameters:
# active: True
# continuous: false
packages:
# Connessione MQTT
mqtt_client: !include includes/mqtt_client.yaml
# Configurazione di base
device_base: !include includes/tx_ultimate_base.yaml
# Configurazione leds
leds: !include includes/tx_ultimate_leds_4_zone.yaml
# Relè e luci locali
light_1: !include
file: includes/tx_ultimate_mqtt_relay.yaml
vars:
id: relay_1
relay_index: 0
subscribe_topic: "zigbee2mqtt/luce_corridoio"
value_on: "ON"
mqtt_json_key: "state"
command_topic: "zigbee2mqtt/luce_corridoio/set"
command_toggle: "TOGGLE"
light_2: !include
file: includes/tx_ultimate_light.yaml
vars:
id: relay_2
relay_index: 1
name: "Soggiorno Sinistra"
pin: ${relay_2_pin}
light_3: !include
file: includes/tx_ultimate_light.yaml
vars:
id: relay_3
relay_index: 2
name: "Soggiorno Destra"
pin: ${relay_1_pin}
light_4: !include
file: includes/tx_ultimate_mqtt_relay.yaml
vars:
id: relay_4
relay_index: 3
subscribe_topic: "zigbee2mqtt/Lampada soggiorno"
value_on: "ON"
mqtt_json_key: "state"
command_topic: "zigbee2mqtt/Lampada soggiorno/set"
command_toggle: "TOGGLE"
# Topic verso altri esphome: "interruttore-soggiorno-cucina/light/cucina/command"
# Valore: "{ "state": "TOGGLE" }"
script:
- id: !extend on_release
then:
- if:
condition:
lambda: "return index == 0;"
then:
- script.execute: mqtt_toggle_relay_1
else:
- if:
condition:
lambda: "return index == 1;"
then:
- light.toggle: relay_2
else:
- if:
condition:
lambda: "return index == 2;"
then:
- light.toggle: relay_3
else:
- script.execute: mqtt_toggle_relay_4
- id: !extend on_swipe_right
then:
- mqtt.publish:
topic: sonoff_4ch_02/cmnd/ShutterStopOpen1
payload: ""
- id: !extend on_swipe_left
then:
- mqtt.publish:
topic: sonoff_4ch_02/cmnd/ShutterStopClose1
payload: ""