pepe: add double click button rule
This commit is contained in:
parent
0cad3c0b32
commit
8e80705889
1 changed files with 31 additions and 2 deletions
|
@ -306,7 +306,35 @@ in {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
# todo : double click, turn on the light in this room and every where else turn it off
|
# double click, turn off the light in the room
|
||||||
|
room_lights_off = map ({ button, room }: {
|
||||||
|
alias = "turn on lights in ${room}, on ${button} click";
|
||||||
|
trigger = {
|
||||||
|
platform = "mqtt";
|
||||||
|
topic = "zigbee2mqtt/${button}";
|
||||||
|
};
|
||||||
|
condition = {
|
||||||
|
condition = "template";
|
||||||
|
value_template = ''{{ "double" == trigger.payload_json.click }}'';
|
||||||
|
};
|
||||||
|
action = {
|
||||||
|
service = "switch.turn_off";
|
||||||
|
entity_id = "group.${room}";
|
||||||
|
};
|
||||||
|
}) [
|
||||||
|
{
|
||||||
|
button = "button_1";
|
||||||
|
room = "living_room";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
button = "button_2";
|
||||||
|
room = "bed_room";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
button = "button_3";
|
||||||
|
room = "bed_room";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
# kitchen light automation
|
# kitchen light automation
|
||||||
# ------------------------
|
# ------------------------
|
||||||
|
@ -340,7 +368,8 @@ in {
|
||||||
}
|
}
|
||||||
]) [ "motion_sensor_1" ];
|
]) [ "motion_sensor_1" ];
|
||||||
|
|
||||||
in lib.flatten (kitchen_lights ++ all_lights_off ++ room_lights_on);
|
in lib.flatten
|
||||||
|
(kitchen_lights ++ all_lights_off ++ room_lights_on ++ room_lights_off);
|
||||||
|
|
||||||
# click = double => music an aus
|
# click = double => music an aus
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue