From b46fed0624ac226292ef699f8ad6ff8bc4fb7b4e Mon Sep 17 00:00:00 2001 From: Dominik Polakovics Date: Sat, 9 Nov 2024 20:50:03 +0100 Subject: [PATCH] changes for esphome --- hosts/fw.cloonar.com/modules/avahi.nix | 8 +++++++- hosts/fw.cloonar.com/modules/home-assistant/light.nix | 4 ++-- .../fw.cloonar.com/modules/home-assistant/multimedia.nix | 3 ++- hosts/fw.cloonar.com/modules/home-assistant/shelly.nix | 5 +---- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/hosts/fw.cloonar.com/modules/avahi.nix b/hosts/fw.cloonar.com/modules/avahi.nix index 9353735..73c1173 100644 --- a/hosts/fw.cloonar.com/modules/avahi.nix +++ b/hosts/fw.cloonar.com/modules/avahi.nix @@ -1,10 +1,16 @@ -{ ... }: { +{ pkgs, ... }: { services.avahi = { enable = true; reflector = true; allowInterfaces = [ + "multimedia" "server" "lan" + "smart" ]; }; + + environment.systemPackages = with pkgs; [ + nssmdns + ]; } diff --git a/hosts/fw.cloonar.com/modules/home-assistant/light.nix b/hosts/fw.cloonar.com/modules/home-assistant/light.nix index 3abe142..68ef290 100644 --- a/hosts/fw.cloonar.com/modules/home-assistant/light.nix +++ b/hosts/fw.cloonar.com/modules/home-assistant/light.nix @@ -150,8 +150,8 @@ entity_id = "light.bedroom_lights"; }; data = { - brightness_pct = 5; - color_temp = 450; + brightness_pct = 15; + rgbw_color = [ 255 126 0 255 ]; }; } ]; diff --git a/hosts/fw.cloonar.com/modules/home-assistant/multimedia.nix b/hosts/fw.cloonar.com/modules/home-assistant/multimedia.nix index 155fd1e..0998159 100644 --- a/hosts/fw.cloonar.com/modules/home-assistant/multimedia.nix +++ b/hosts/fw.cloonar.com/modules/home-assistant/multimedia.nix @@ -4,6 +4,7 @@ "broadlink" "androidtv" "samsungtv" + "apple_tv" ]; services.home-assistant.config = { ios = { @@ -48,7 +49,7 @@ friendly_name = "Any multimedia device on"; device_class = "connectivity"; value_template = '' - {% if is_state('binary_sensor.ps5', 'on') or is_state('binary_sensor.xbox', 'on') or (states('media_player.fire_tv_firetv_living_cloonar_multimedia') != 'off' and states('media_player.fire_tv_firetv_living_cloonar_multimedia') != 'unavailable') or (is_state('binary_sensor.steamdeck', 'on') and (states('sensor.steamdeck_power') | float(default=0) > 5)) %} + {% if (states('media_player.living_room') != 'standby' and states('media_player.living_room') != 'off') or is_state('binary_sensor.ps5', 'on') or is_state('binary_sensor.xbox', 'on') or (states('media_player.fire_tv_firetv_living_cloonar_multimedia') != 'off' and states('media_player.fire_tv_firetv_living_cloonar_multimedia') != 'unavailable') or (is_state('binary_sensor.steamdeck', 'on') and (states('sensor.steamdeck_power') | float(default=0) > 5)) %} on {% else %} off diff --git a/hosts/fw.cloonar.com/modules/home-assistant/shelly.nix b/hosts/fw.cloonar.com/modules/home-assistant/shelly.nix index e656d72..69ce20e 100644 --- a/hosts/fw.cloonar.com/modules/home-assistant/shelly.nix +++ b/hosts/fw.cloonar.com/modules/home-assistant/shelly.nix @@ -7,10 +7,6 @@ let { name = "Living Bulb 4"; id = "485519D94A28"; } { name = "Living Bulb 5"; id = "485519DA6B6A"; } { name = "Living Bulb 6"; id = "485519D9E018"; } - { name = "Bedroom Bulb 1"; id = "485519FBDF20"; } - { name = "Bedroom Bulb 2"; id = "485519FBE171"; } - { name = "Bedroom Bulb 3"; id = "485519FBE377"; } - { name = "Bedroom Bulb 4"; id = "485519FC05C5"; } ]; switches = [ @@ -28,6 +24,7 @@ let in { services.home-assistant.extraComponents = [ "shelly" + "esphome" ]; services.home-assistant.config = {