pepe: add double click button rule

This commit is contained in:
Ingolf Wagner 2020-04-13 11:16:52 +02:00
parent 0cad3c0b32
commit 8e80705889
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B

View file

@ -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