diff --git a/configs/pepe/home-assistant.nix b/configs/pepe/home-assistant.nix index 7548692..c4aabb3 100644 --- a/configs/pepe/home-assistant.nix +++ b/configs/pepe/home-assistant.nix @@ -218,7 +218,6 @@ in { ]; } ]; - in lib.flatten (map roomPresents (lib.flatten (map (name: [ { roomGroup = "${name}_lights"; @@ -232,6 +231,12 @@ in { situation = "essential"; brightness = 30; } + { + roomGroup = "${name}_bright"; + roomOffGroup = "${name}_lights"; + presentsGroup = "${name}_present"; + situation = "bright"; + } ]) allRooms))) ++ [ # control situation with buttons @@ -268,6 +273,8 @@ in { }; } ] ++ (lib.flatten (map situationSwitch (lib.flatten (map (name: [ + + # essential <-> dark { presentsGroup = "${name}_present"; fromSituation = "dark"; @@ -283,6 +290,40 @@ in { fromRoomGroup = "${name}_essential"; 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)))); group = let @@ -310,14 +351,21 @@ in { view = false; entities = [ ]; }; + "${name}_bright" = { + control = "hidden"; + name = "${description} Tages Beleuchtung"; + view = false; + entities = [ ]; + }; "view_${name}" = { name = description; view = true; entities = [ "group.${name}" + "group.${name}_bright" + "group.${name}_essential" "group.${name}_lights" "group.${name}_present" - "group.${name}_essential" ]; }; }; diff --git a/configs/pepe/home-assistant/sonoff.nix b/configs/pepe/home-assistant/sonoff.nix index 2048f7d..ba9515b 100644 --- a/configs/pepe/home-assistant/sonoff.nix +++ b/configs/pepe/home-assistant/sonoff.nix @@ -5,7 +5,7 @@ let "pal01" = { label = "Schlafzimmer Lampe Links"; icon = "mdi:lightbulb"; - groups = [ "all_lights" "bed_room_lights" "bed_room" ]; + groups = [ "all_lights" "bed_room_lights" "bed_room_bright" "bed_room" ]; }; "pal02" = { label = "Nummer 2"; @@ -19,7 +19,7 @@ let "pal04" = { label = "Schlafzimmer Lampe Rechts"; icon = "mdi:lightbulb"; - groups = [ "all_lights" "bed_room_lights" "bed_room" ]; + groups = [ "all_lights" "bed_room_lights" "bed_room_bright" "bed_room" ]; }; "pal05" = { label = "TV"; @@ -32,9 +32,10 @@ let icon = "mdi:lightbulb"; groups = [ "all_lights" - "kitchen_room_lights" - "kitchen_room_essential" "kitchen_room" + "kitchen_room_bright" + "kitchen_room_essential" + "kitchen_room_lights" ]; }; "pal07" = { label = "Nummer 7"; }; diff --git a/configs/pepe/home-assistant/zigbee2mqtt/lights.nix b/configs/pepe/home-assistant/zigbee2mqtt/lights.nix index dd4d406..2d80961 100644 --- a/configs/pepe/home-assistant/zigbee2mqtt/lights.nix +++ b/configs/pepe/home-assistant/zigbee2mqtt/lights.nix @@ -5,7 +5,10 @@ let allDevices = { "light_1" = { 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" = { id = "0x7cb03eaa0a0387b9"; @@ -13,18 +16,26 @@ let }; "light_3" = { id = "0x7cb03eaa0a033a86"; - groups = [ "living_room" "living_room_essential" "living_room_lights" ]; + groups = [ + "living_room" + "living_room_essential" "living_room_lights" + ]; }; "light_4" = { 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_6" = { id = "0x7cb03eaa0a034b46"; }; "light_7" = { id = "0x7cb03eaa0a033b4f"; }; "light_8" = { id = "0x7cb03eaa0a0384d3"; - groups = [ "bed_room" "bed_room_essential" "bed_room_lights" ]; + groups = + [ "bed_room" "bed_room_essential" "bed_room_lights" "bed_room_bright" ]; }; };