Wie kan mij helpen met een Xiaomi Aqara Opple schakelaar (via Zigbee2MQTT).
Ik heb de variant met 6 knoppen. Elke knop heeft een functie "single", "double", "hold" en "release".
Ik heb 1 automation gemaakt dat zodra 1 van de functies van 1 van de knoppen gebruikt wordt er een actie wordt uitgevoerd.
Nu is het echter heel vaak zo dat de eerste keer dat ik de knop in druk, er niets gebeurd. Doe ik het dan nog een keer, dan werkt het wel.
Dit is mij Yaml code:
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
| alias: Slaapkamer - Nachtkastje Maarten - 6 button schakelaar
description: ''
trigger:
- platform: state
entity_id:
- sensor.xiaomi_aqara_opple_remote_slaapkamer_maarten_action
attribute: action
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: sensor.xiaomi_aqara_opple_remote_slaapkamer_maarten_action
state: button_1_single
attribute: action
sequence:
- type: turn_on
device_id: f8b7a39a4079a626a8d9946b3f10130d
entity_id: switch.ikea_e1603_slaapkamer_licht_maarten
domain: switch
- conditions:
- condition: state
entity_id: sensor.xiaomi_aqara_opple_remote_slaapkamer_maarten_action
state: button_1_double
attribute: action
sequence:
- type: turn_off
device_id: f8b7a39a4079a626a8d9946b3f10130d
entity_id: switch.ikea_e1603_slaapkamer_licht_maarten
domain: switch
- conditions:
- condition: state
entity_id: sensor.xiaomi_aqara_opple_remote_slaapkamer_maarten_action
state: button_1_hold
attribute: action
sequence:
- type: turn_off
device_id: ea85ee35dc86ddff7b5d17f175f37d67
entity_id: switch.wall_plug_switch
domain: switch
- conditions:
- condition: state
entity_id: sensor.xiaomi_aqara_opple_remote_slaapkamer_maarten_action
state: button_3_single
attribute: action
sequence:
- type: turn_on
device_id: a2e72268fe93ffd245e2e9ac7e3db46d
entity_id: switch.ikea_e1603_slaapkamer_ledstrip
domain: switch
- conditions:
- condition: state
entity_id: sensor.xiaomi_aqara_opple_remote_slaapkamer_maarten_action
state: button_3_double
attribute: action
sequence:
- type: turn_off
device_id: a2e72268fe93ffd245e2e9ac7e3db46d
entity_id: switch.ikea_e1603_slaapkamer_ledstrip
domain: switch
- conditions:
- condition: state
entity_id: sensor.xiaomi_aqara_opple_remote_slaapkamer_maarten_action
state: button_6_double
attribute: action
sequence:
- service: climate.turn_off
data: {}
target:
device_id: 529384ca16eb62aa56da92f72c247501
- conditions:
- condition: state
entity_id: sensor.xiaomi_aqara_opple_remote_slaapkamer_maarten_action
state: button_4_single
attribute: action
sequence:
- service: climate.set_temperature
data:
temperature: 18
hvac_mode: cool
target:
device_id: 529384ca16eb62aa56da92f72c247501
- service: climate.set_fan_mode
data:
fan_mode: auto
target:
device_id: 529384ca16eb62aa56da92f72c247501
- conditions:
- condition: state
entity_id: sensor.xiaomi_aqara_opple_remote_slaapkamer_maarten_action
attribute: action
state: Button_5_single
sequence:
- service: cover.open_cover
data: {}
target:
device_id: b84f7e8a2f93fc7ce2efe6fc10d478e9
- conditions:
- condition: state
entity_id: sensor.xiaomi_aqara_opple_remote_slaapkamer_maarten_action
attribute: action
state: button_5_double
sequence:
- service: cover.open_cover
data: {}
target:
device_id: b84f7e8a2f93fc7ce2efe6fc10d478e9
- conditions:
- condition: state
entity_id: sensor.xiaomi_aqara_opple_remote_slaapkamer_maarten_action
attribute: action
state: button_5_hold
sequence:
- service: cover.open_cover
data: {}
target:
device_id:
- b84f7e8a2f93fc7ce2efe6fc10d478e9
- 8c81905abbebef4e9ee01784edeba4e6
- d644c0cddbd883adc011d95d5b3b8f18
default: []
mode: parallel |
Om even een voorbeeld te geven, in de debug zie je ook dat er de 1e keer niets wordt uitgevoerd, en de 2e keer wel op exact hetzelfde tijdstip:
Of moet ik een automation per button maken en triggeren op de specifieke action (dus button_1_single) enzn.
Dan zou ik dus heel veel automations moeten maken