From b955549fe5a076ed3c99c6a54309ea4cd0c16ce8 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sun, 20 Oct 2024 18:58:49 +0100 Subject: [PATCH] totoro: tidy up HA, add various things to HA homescreen --- ops/nixos/totoro/home-assistant.nix | 50 ++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 12 deletions(-) diff --git a/ops/nixos/totoro/home-assistant.nix b/ops/nixos/totoro/home-assistant.nix index d4fb98e9ec..40944907c1 100644 --- a/ops/nixos/totoro/home-assistant.nix +++ b/ops/nixos/totoro/home-assistant.nix @@ -105,13 +105,7 @@ in { brightness = 255; color_temp = 316; } // x); - bedroomRing = x: ({ - color_mode = "color_temp"; - brightness = 69; - color_temp = 142; - } // x); entityDefs = ring: overhead: let o = bedroomOverhead { state = overhead; }; in { - "light.bedside_lamp" = bedroomRing { state = ring; }; "light.overhead_left_1" = o; "light.overhead_left_2" = o; "light.overhead_left_3" = o; @@ -176,14 +170,46 @@ in { lovelaceConfig = { title = "117 Malden Road"; views = [{ - title = "Bedroom Lights"; + title = "Luke's Bedroom"; + badges = let + scene = scene: cfg: lib.mkMerge [{ + type = "entity"; + show_name = true; + show_state = false; + show_icon = true; + entity = "scene.${scene}"; + tap_action.action = "toggle"; + } cfg]; + in [(scene "bedroom_off" { + icon = "mdi:ceiling-light-outline"; + }) (scene "bedroom_reset" { + icon = "mdi:ceiling-light-multiple"; + })]; cards = [{ - type = "light"; - entity = "light.bedroom_lights"; + type = "grid"; + square = false; + columns = 1; + cards = [{ + type = "light"; + entity = "light.bedroom_lights"; + } { + type = "entities"; + entities = ["switch.lukes_bedroom_mosquitto_repellent"]; + }]; } { - type = "light"; - entity = "light.bedside_lamp"; - icon = "mdi:webcam"; + type = "grid"; + square = false; + columns = 1; + cards = [{ + type = "entities"; + entities = ["switch.samsung_soundbar_q930b"]; + } { + type = "media-control"; + entity = "media_player.nebula_3"; + } { + type = "media-control"; + entity = "media_player.shield_2"; + }]; }]; }]; };