diff --git a/configs/pepe/home-assistant.nix b/configs/pepe/home-assistant.nix index ec3f2ed..e2a21df 100644 --- a/configs/pepe/home-assistant.nix +++ b/configs/pepe/home-assistant.nix @@ -159,16 +159,22 @@ in { ]; onOffArguments = flatMap (name: [ { - roomGroup = "${name}_lights"; presentsGroup = "${name}_present"; + roomGroup = "${name}_lights"; situation = "dark"; } { - roomGroup = "${name}_essential"; - turnOffGroup = "${name}_lights"; - presentsGroup = "${name}_present"; - situation = "essential"; brightness = 30; + presentsGroup = "${name}_present"; + roomGroup = "${name}_essential"; + situation = "essential"; + turnOffGroup = "${name}_lights"; + } + { + presentsGroup = "${name}_present"; + roomGroup = "${name}_bright"; + turnOffGroup = "${name}_lights"; + situation = "bright"; } ]) allRooms; in (flatMap roomPresents onOffArguments); @@ -252,6 +258,7 @@ in { } ]; allArguments = flatMap (name: [ + # essential <-> dark { presentsGroup = "${name}_present"; fromSituation = "dark"; @@ -267,6 +274,37 @@ 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; in flatMap situationSwitch allArguments; @@ -332,14 +370,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..02375f0 100644 --- a/configs/pepe/home-assistant/zigbee2mqtt/lights.nix +++ b/configs/pepe/home-assistant/zigbee2mqtt/lights.nix @@ -5,7 +5,12 @@ 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"; @@ -17,14 +22,20 @@ let }; "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" ]; }; };