hass.io: add bright setup

This commit is contained in:
Ingolf Wagner 2020-05-03 06:55:38 +02:00
parent 3608d2a0d9
commit 2b8fef6473
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
3 changed files with 70 additions and 10 deletions

View file

@ -218,7 +218,6 @@ in {
]; ];
} }
]; ];
in lib.flatten (map roomPresents (lib.flatten (map (name: [ in lib.flatten (map roomPresents (lib.flatten (map (name: [
{ {
roomGroup = "${name}_lights"; roomGroup = "${name}_lights";
@ -232,6 +231,12 @@ in {
situation = "essential"; situation = "essential";
brightness = 30; brightness = 30;
} }
{
roomGroup = "${name}_bright";
roomOffGroup = "${name}_lights";
presentsGroup = "${name}_present";
situation = "bright";
}
]) allRooms))) ++ [ ]) allRooms))) ++ [
# control situation with buttons # control situation with buttons
@ -268,6 +273,8 @@ in {
}; };
} }
] ++ (lib.flatten (map situationSwitch (lib.flatten (map (name: [ ] ++ (lib.flatten (map situationSwitch (lib.flatten (map (name: [
# essential <-> dark
{ {
presentsGroup = "${name}_present"; presentsGroup = "${name}_present";
fromSituation = "dark"; fromSituation = "dark";
@ -283,6 +290,40 @@ in {
fromRoomGroup = "${name}_essential"; fromRoomGroup = "${name}_essential";
toRoomGroup = "${name}_lights"; toRoomGroup = "${name}_lights";
} }
# bright <-> dark
{
presentsGroup = "${name}_present";
fromSituation = "dark";
toSituation = "bright";
fromRoomGroup = "${name}_lights";
toRoomGroup = "${name}_bright";
}
{
presentsGroup = "${name}_present";
fromSituation = "bright";
toSituation = "dark";
fromRoomGroup = "${name}_bright";
toRoomGroup = "${name}_lights";
}
# bright <-> essential
{
presentsGroup = "${name}_present";
fromSituation = "bright";
toSituation = "essential";
fromRoomGroup = "${name}_bright";
toRoomGroup = "${name}_essential";
brightness = 30;
}
{
presentsGroup = "${name}_present";
fromSituation = "essential";
toSituation = "bright";
fromRoomGroup = "${name}_essential";
toRoomGroup = "${name}_bright";
}
]) allRooms)))); ]) allRooms))));
group = let group = let
@ -310,14 +351,21 @@ in {
view = false; view = false;
entities = [ ]; entities = [ ];
}; };
"${name}_bright" = {
control = "hidden";
name = "${description} Tages Beleuchtung";
view = false;
entities = [ ];
};
"view_${name}" = { "view_${name}" = {
name = description; name = description;
view = true; view = true;
entities = [ entities = [
"group.${name}" "group.${name}"
"group.${name}_bright"
"group.${name}_essential"
"group.${name}_lights" "group.${name}_lights"
"group.${name}_present" "group.${name}_present"
"group.${name}_essential"
]; ];
}; };
}; };

View file

@ -5,7 +5,7 @@ let
"pal01" = { "pal01" = {
label = "Schlafzimmer Lampe Links"; label = "Schlafzimmer Lampe Links";
icon = "mdi:lightbulb"; icon = "mdi:lightbulb";
groups = [ "all_lights" "bed_room_lights" "bed_room" ]; groups = [ "all_lights" "bed_room_lights" "bed_room_bright" "bed_room" ];
}; };
"pal02" = { "pal02" = {
label = "Nummer 2"; label = "Nummer 2";
@ -19,7 +19,7 @@ let
"pal04" = { "pal04" = {
label = "Schlafzimmer Lampe Rechts"; label = "Schlafzimmer Lampe Rechts";
icon = "mdi:lightbulb"; icon = "mdi:lightbulb";
groups = [ "all_lights" "bed_room_lights" "bed_room" ]; groups = [ "all_lights" "bed_room_lights" "bed_room_bright" "bed_room" ];
}; };
"pal05" = { "pal05" = {
label = "TV"; label = "TV";
@ -32,9 +32,10 @@ let
icon = "mdi:lightbulb"; icon = "mdi:lightbulb";
groups = [ groups = [
"all_lights" "all_lights"
"kitchen_room_lights"
"kitchen_room_essential"
"kitchen_room" "kitchen_room"
"kitchen_room_bright"
"kitchen_room_essential"
"kitchen_room_lights"
]; ];
}; };
"pal07" = { label = "Nummer 7"; }; "pal07" = { label = "Nummer 7"; };

View file

@ -5,7 +5,10 @@ let
allDevices = { allDevices = {
"light_1" = { "light_1" = {
id = "0x7cb03eaa0a0347b5"; id = "0x7cb03eaa0a0347b5";
groups = [ "floor_room" "floor_room_essential" "floor_room_lights" ]; groups = [
"floor_room"
"floor_room_bright" "floor_room_essential" "floor_room_lights"
];
}; };
"light_2" = { "light_2" = {
id = "0x7cb03eaa0a0387b9"; id = "0x7cb03eaa0a0387b9";
@ -13,18 +16,26 @@ let
}; };
"light_3" = { "light_3" = {
id = "0x7cb03eaa0a033a86"; id = "0x7cb03eaa0a033a86";
groups = [ "living_room" "living_room_essential" "living_room_lights" ]; groups = [
"living_room"
"living_room_essential" "living_room_lights"
];
}; };
"light_4" = { "light_4" = {
id = "0x7cb03eaa0a04aabf"; id = "0x7cb03eaa0a04aabf";
groups = [ "bath_room" "bath_room_essential" "bath_room_lights" ]; groups = [
"bath_room"
"bath_room_bright"
"bath_room_essential" "bath_room_lights"
];
}; };
"light_5" = { id = "0x7cb03eaa0a0346e4"; }; "light_5" = { id = "0x7cb03eaa0a0346e4"; };
"light_6" = { id = "0x7cb03eaa0a034b46"; }; "light_6" = { id = "0x7cb03eaa0a034b46"; };
"light_7" = { id = "0x7cb03eaa0a033b4f"; }; "light_7" = { id = "0x7cb03eaa0a033b4f"; };
"light_8" = { "light_8" = {
id = "0x7cb03eaa0a0384d3"; id = "0x7cb03eaa0a0384d3";
groups = [ "bed_room" "bed_room_essential" "bed_room_lights" ]; groups =
[ "bed_room" "bed_room_essential" "bed_room_lights" "bed_room_bright" ];
}; };
}; };