ctucx.git: nixfiles

ctucx' nixfiles

commit 9431fc52f65143dfa21c330359c127b035dbcefe
parent 051a72f8b4c4689b4f3b3543e12d6666ca3baf8a
Author: Leah (ctucx) <git@ctu.cx>
Date: Sat, 12 Nov 2022 11:31:34 +0100

machines/lollo/smarthome: add new device, remove unneeded devices
2 files changed, 22 insertions(+), 48 deletions(-)
M
machines/lollo/smarthome/smartied.nix
|
69
+++++++++++++++++++++------------------------------------------------
M
machines/lollo/smarthome/zigbee2mqtt.nix
|
1
+
diff --git a/machines/lollo/smarthome/smartied.nix b/machines/lollo/smarthome/smartied.nix
@@ -71,14 +71,15 @@ let
         deviceName = "ikea_lamp_bathroom";
       };
 
-      "relay-pc-speakers" = {
-        type       = "Zigbee2MqttRelay";
-        deviceName = "relay_pc_speakers";
+      "led-stripe-desk" = {
+        type       = "Zigbee2MqttLamp";
+        lampType   = "WhiteSpectrum";
+        deviceName = "led_stripe_desk";
       };
 
-      "tradfri-co-l-bed" = {
+      "relay-pc-speakers" = {
         type       = "Zigbee2MqttRelay";
-        deviceName = "ikea_control_outlet_l_bed";
+        deviceName = "relay_pc_speakers";
       };
 
       "tradfri-co-i-desk-l" = {

@@ -127,6 +128,13 @@ let
             deviceName = "relay-pc-speakers";
             toggle     = true;
           }];
+          brightness_up_click = [
+            {
+              type       = "SwitchStateAction";
+              deviceName = "led-stripe-desk";
+              toggle     = true;
+            }
+          ];
           brightness_down_click = [
             {
               type       = "SwitchStateAction";

@@ -135,7 +143,7 @@ let
             }
             {
               type       = "SwitchStateAction";
-              deviceName = "tradfri-co-l-bed";
+              deviceName = "led-stripe-desk";
               state      = false;
             }
             {

@@ -143,53 +151,18 @@ let
               deviceName = "tradfri-lamp-l";
               state      = false;
             }
+            {
+              type       = "SwitchStateAction";
+              deviceName = "tradfri-lamp-l-rgb";
+              state      = false;
+            }
           ];
         };
       };
 
-      "tradfri-motion-sensor" = {
-        type          = "Zigbee2MqttMotionSensor";
-        deviceName    = "ikea_motionsensor";
-        occupyActions = [{
-          type       = "SwitchStateAction";
-          deviceName = "tradfri-lamp-bathroom";
-          relay      = 0;
-          state      = true;
-        }];
-        clearActions = [{
-          type       = "SwitchStateAction";
-          deviceName = "tradfri-lamp-bathroom";
-          relay      = 0;
-          state      = false;
-        }];
-      };
     };
 
     clientConfigs = {
-      "grandstream-wp820" = {
-        switches = [
-          {
-            name   = "Ceiling Light";
-            device = "tradfri-lamp-i";
-            relay  = 0;
-          }
-          {
-            name   = "RGB Lamp";
-            device = "tradfri-lamp-i-rgb";
-            relay  = 0;
-          }
-          {
-            name   = "Desk (L)";
-            device = "tradfri-co-i-desk-l";
-            relay  = 0;
-          }
-          {
-            name   = "Desk (R)";
-            device = "tradfri-co-i-desk-r";
-            relay  = 0;
-          }
-        ];
-      };
       "smarthome-pwa" = {
         views = [
           {

@@ -209,8 +182,8 @@ let
                 relay  = 0;
               }
               {
-                name   = "Bed";
-                device = "tradfri-co-l-bed";
+                name   = "LEDs under Desk";
+                device = "led-stripe-desk";
                 relay  = 0;
               }
               {
diff --git a/machines/lollo/smarthome/zigbee2mqtt.nix b/machines/lollo/smarthome/zigbee2mqtt.nix
@@ -84,6 +84,7 @@
           "0x847127fffecd89b6".friendly_name = "ikea_motionsensor";
 
           "0x00124b0023ad17f1".friendly_name = "relay_pc_speakers";
+          "0xa4c138da0f6d23de".friendly_name = "led_stripe_desk";
         };
 
       };