diff --git a/configs/pepe/home-assistant.nix b/configs/pepe/home-assistant.nix index 7d6736f..891c6db 100644 --- a/configs/pepe/home-assistant.nix +++ b/configs/pepe/home-assistant.nix @@ -159,14 +159,14 @@ in { { platform = "state"; # todo : groups are not working right now - entity_id = "binary_sensor.door_sensor_2"; + entity_id = "binary_sensor.door_sensor_4"; from = "off"; to = "on"; } { platform = "state"; # todo : groups are not working right now - entity_id = "binary_sensor.door_sensor_2"; + entity_id = "binary_sensor.door_sensor_4"; from = "on"; to = "off"; } diff --git a/configs/pepe/home-assistant/light-control.nix b/configs/pepe/home-assistant/light-control.nix index 2b40bc4..e9fafa9 100644 --- a/configs/pepe/home-assistant/light-control.nix +++ b/configs/pepe/home-assistant/light-control.nix @@ -8,34 +8,23 @@ user = "homeassistant"; password = "hallo"; }; - scenes = [{ - name = "default"; - room_tracking_enabled = false; - } - #{ - # name = "outside"; - # room_tracking_enabled = false; - # ignored_sensors = [ "zigbee2mqtt/door_sensor_4" ]; - #} - #{ - # name = "cooking"; - # enabled_switches = [ "stat/PAL07/RESULT" "stat/PAL08/RESULT" ]; - #} - #{ - # name = "night"; - # room_tracking_enabled = false; - # brightness = 25; - # disabled_switches = [ - # "stat/PAL01/RESULT" - # "stat/PAL03/RESULT" - # "stat/PAL04/RESULT" - # "stat/PAL07/RESULT" - # "stat/PAL08/RESULT" - # "zigbee2mqtt/light_2" - # ]; - # ignored_sensors = [ "zigbee2mqtt/motion_sensor_7" ]; - #} - ]; + scenes = [ + { name = "default"; } + { + name = "outside"; + room_tracking_enabled = false; + ignored_sensors = [ "zigbee2mqtt/door_sensor_4" ]; + } + { + name = "night"; + room_tracking_enabled = false; + brightness = 25; + #disabled_switches = [ + #"zigbee2mqtt/light_2" + #]; + ignored_sensors = [ "zigbee2mqtt/motion_sensor_7" ]; + } + ]; sensors = let door = { topic, room }: { topic = topic; @@ -51,6 +40,7 @@ delay = 60; }; in [ + (motion { topic = "zigbee2mqtt/motion_sensor_1"; room = "office_room"; @@ -59,42 +49,25 @@ topic = "zigbee2mqtt/motion_sensor_2"; room = "office_room"; }) - #(motion { - # topic = "zigbee2mqtt/motion_sensor_7"; - # room = "bed_room"; - #}) - #(motion { - # topic = "zigbee2mqtt/motion_sensor_1"; - # room = "kitchen"; - #}) - #(motion { - # topic = "zigbee2mqtt/motion_sensor_3"; - # room = "living_room"; - #}) - #(motion { - # topic = "zigbee2mqtt/motion_sensor_4"; - # room = "living_room"; - #}) - #(motion { - # topic = "zigbee2mqtt/motion_sensor_5"; - # room = "bath_room"; - #}) - #(motion { - # topic = "zigbee2mqtt/motion_sensor_8"; - # room = "bath_room"; - #}) - #(motion { - # topic = "zigbee2mqtt/motion_sensor_6"; - # room = "floor"; - #}) - #(door { - # topic = "zigbee2mqtt/door_sensor_2"; - # room = "floor"; - #}) - #(door { - # topic = "zigbee2mqtt/door_sensor_4"; - # room = "floor"; - #}) + (motion { + topic = "zigbee2mqtt/motion_sensor_7"; + room = "sleeping_room"; + }) + + (door { + topic = "zigbee2mqtt/door_sensor_1"; + room = "storage_room"; + }) + (door { + topic = "zigbee2mqtt/door_sensor_5"; + room = "sleeping_room"; + }) + (door { + # house door + topic = "zigbee2mqtt/door_sensor_4"; + room = "floor"; + }) + ]; switches = let sonoff = { id, rooms, delay ? 0 }: { @@ -122,20 +95,20 @@ off = "OFF"; }; }; + led = { topic, rooms, delay ? 0 }: { + topic = topic; + key = "state"; + rooms = rooms; + delay = delay; + command = { + command = '' + {"state":"{{state}}","brightness":{{brightness}},"color":{"hex":"#FFFFFF}}''; + topic = "${topic}/set"; + on = "ON"; + off = "OFF"; + }; + }; in [ - #(light { - # topic = "zigbee2mqtt/light_1"; - # rooms = [ "floor" ]; - #}) - #(light { - # topic = "zigbee2mqtt/light_2"; - # rooms = [ "floor" ]; - #}) - #(light { - # topic = "zigbee2mqtt/light_3"; - # rooms = [ "living_room" ]; - # delay = 10; - #}) (light { topic = "zigbee2mqtt/light_2"; @@ -145,6 +118,18 @@ topic = "zigbee2mqtt/light_4"; rooms = [ "office_room" ]; }) + (light { + topic = "zigbee2mqtt/light_5"; + rooms = [ "storage_room" ]; + }) + (light { + topic = "zigbee2mqtt/light_7"; + rooms = [ "sleeping_room" ]; + }) + #(led { + # topic = "zigbee2mqtt/led_2"; + # rooms = [ "sleeping_room" ]; + #}) #(sonoff { # id = "PAL01"; diff --git a/configs/pepe/home-assistant/zigbee2mqtt/doors.nix b/configs/pepe/home-assistant/zigbee2mqtt/doors.nix index 3f84faa..6332b4d 100644 --- a/configs/pepe/home-assistant/zigbee2mqtt/doors.nix +++ b/configs/pepe/home-assistant/zigbee2mqtt/doors.nix @@ -3,26 +3,11 @@ let # https://www.zigbee2mqtt.io/devices/MCCGQ11LM.html allDevices = { - "window_sensor_1" = { - id = "0x00158d000312dc52"; - groups = [ "living_room" ]; - }; - "door_sensor_2" = { - id = "0x00158d000316d5bf"; - groups = [ "floor_room" ]; - }; - "window_sensor_3" = { - id = "0x00158d0002f9516f"; - groups = [ "kitchen_room" ]; - }; - "door_sensor_4" = { - id = "0x00158d00031383b9"; - groups = [ "floor_room" ]; - }; - "window_sensor_5" = { - id = "0x00158d0003120d3e"; - groups = [ "bath_room" ]; - }; + "door_sensor_1" = { id = "0x00158d000312dc52"; }; + "door_sensor_2" = { id = "0x00158d000316d5bf"; }; + "door_sensor_3" = { id = "0x00158d0002f9516f"; }; + "door_sensor_4" = { id = "0x00158d00031383b9"; }; + "door_sensor_5" = { id = "0x00158d0003120d3e"; }; }; in { diff --git a/configs/pepe/home-assistant/zigbee2mqtt/lights.nix b/configs/pepe/home-assistant/zigbee2mqtt/lights.nix index e5017e3..bd53916 100644 --- a/configs/pepe/home-assistant/zigbee2mqtt/lights.nix +++ b/configs/pepe/home-assistant/zigbee2mqtt/lights.nix @@ -3,34 +3,14 @@ let # https://www.zigbee2mqtt.io/devices/AC10787.html allDevices = { - "light_1" = { - id = "0x7cb03eaa0a0347b5"; - groups = [ - "floor_room" - "floor_room_bright" - "floor_room_essential" - "floor_room_lights" - ]; - }; - "light_2" = { - id = "0x7cb03eaa0a0387b9"; - groups = [ "floor_room" ]; - }; - "light_3" = { - id = "0x7cb03eaa0a033a86"; - groups = [ "living_room" ]; - }; - "light_4" = { - id = "0x7cb03eaa0a04aabf"; - groups = [ "bath_room" ]; - }; + "light_1" = { id = "0x7cb03eaa0a0347b5"; }; + "light_2" = { id = "0x7cb03eaa0a0387b9"; }; + "light_3" = { id = "0x7cb03eaa0a033a86"; }; + "light_4" = { id = "0x7cb03eaa0a04aabf"; }; "light_5" = { id = "0x7cb03eaa0a0346e4"; }; "light_6" = { id = "0x7cb03eaa0a034b46"; }; "light_7" = { id = "0x7cb03eaa0a033b4f"; }; - "light_8" = { - id = "0x7cb03eaa0a0384d3"; - groups = [ "bed_room" ]; - }; + "light_8" = { id = "0x7cb03eaa0a0384d3"; }; }; in {