pape: improve off switching

This commit is contained in:
Ingolf Wagner 2020-04-16 02:58:44 +02:00
parent fdc24d1a36
commit 1252eabe57
Signed by: palo
GPG key ID: 76BF5F1928B9618B

View file

@ -33,6 +33,8 @@ in {
prometheus.namespace = "hass";
# manual state
# ------------
input_select.situation = {
icon = "mdi:brightness-auto";
options = [ "on" "off" "essential" ];
@ -41,9 +43,10 @@ in {
input_boolean.situation_toggle.icon = "mdi:toggle-switch";
automation = let
# todo : at night only turn trigger essential groups
roomPresents =
{ roomGroup, presentsGroup, situation, brightness ? 255 }: [
roomPresents = { roomGroup, roomOffGroup ? roomGroup, presentsGroup
, situation, brightness ? 255 }: [
{
alias = "presents -> turn on ${roomGroup} lights";
trigger = {
@ -72,7 +75,7 @@ in {
];
}
{
alias = "absents -> turn off ${roomGroup} lights";
alias = "absents -> turn off ${roomOffGroup} lights";
trigger = {
platform = "state";
entity_id = "group.${presentsGroup}";
@ -82,11 +85,11 @@ in {
action = [
{
service = "switch.turn_off";
data.entity_id = "group.${roomGroup}";
data.entity_id = "group.${roomOffGroup}";
}
{
service = "light.turn_off";
data.entity_id = "group.${roomGroup}";
data.entity_id = "group.${roomOffGroup}";
}
];
}
@ -119,30 +122,35 @@ in {
}
{
roomGroup = "kitchen_room_essentials";
roomOffGroup = "kitchen_room";
presentsGroup = "kitchen_room_present";
situation = "essential";
brightness = 30;
}
{
roomGroup = "living_room_essential";
roomOffGroup = "living_room_lights";
presentsGroup = "living_room_present";
situation = "essential";
brightness = 30;
}
{
roomGroup = "floor_room_essential";
roomOffGroup = "floor_room_lights";
presentsGroup = "floor_room_present";
situation = "essential";
brightness = 30;
}
{
roomGroup = "bath_room_essential";
roomOffGroup = "bath_room_lights";
presentsGroup = "bath_room_present";
situation = "essential";
brightness = 30;
}
{
roomGroup = "bed_room_essential";
roomOffGroup = "bed_room_lights";
presentsGroup = "bed_room_present";
situation = "essential";
brightness = 30;