update
This commit is contained in:
parent
a18e244ba5
commit
05a9d96d4e
26 changed files with 861 additions and 182 deletions
30
server/home-assistant/bathroom.nix
Normal file
30
server/home-assistant/bathroom.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{ ... }:
|
||||
{
|
||||
services.home-assistant.config = {
|
||||
"automation" = [
|
||||
{
|
||||
alias = "Towel Warmer Timer";
|
||||
trigger = {
|
||||
type = "turned_on";
|
||||
device_id = "bf77f1611d1d9959e967b4e35ba5234c";
|
||||
entity_id = "b674ce8cc70a4d0c1bfba7c6946ab3e4";
|
||||
domain = "switch";
|
||||
trigger = "device";
|
||||
for = {
|
||||
hours = 0;
|
||||
minutes = 60;
|
||||
seconds = 0;
|
||||
};
|
||||
};
|
||||
action = [
|
||||
{
|
||||
type = "turn_off";
|
||||
device_id = "bf77f1611d1d9959e967b4e35ba5234c";
|
||||
entity_id = "b674ce8cc70a4d0c1bfba7c6946ab3e4";
|
||||
domain = "switch";
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
66
server/home-assistant/default.nix
Normal file
66
server/home-assistant/default.nix
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
{ lib, config, ... }:
|
||||
{
|
||||
options.server.home-assistant.enable = lib.mkEnableOption "Enable home-assistant";
|
||||
|
||||
config = lib.mkIf config.server.home-assistant.enable {
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
8123
|
||||
5683
|
||||
];
|
||||
|
||||
imports = [
|
||||
./zones.nix
|
||||
./wyoming.nix
|
||||
./mosquitto.nix
|
||||
./bathroom.nix
|
||||
./lights.nix
|
||||
./heating.nix
|
||||
];
|
||||
|
||||
services.home-assistant = {
|
||||
enable = true;
|
||||
|
||||
extraComponents = [
|
||||
"pushover"
|
||||
"isal"
|
||||
"nina"
|
||||
"jellyfin"
|
||||
"deluge"
|
||||
"conversation"
|
||||
|
||||
"ollama"
|
||||
"anthropic"
|
||||
|
||||
"mqtt"
|
||||
|
||||
"shelly"
|
||||
"tasmota"
|
||||
|
||||
"wyoming"
|
||||
"whisper"
|
||||
"piper"
|
||||
|
||||
"open_meteo"
|
||||
|
||||
"wake_on_lan"
|
||||
"bluetooth"
|
||||
"bthome"
|
||||
"fritz"
|
||||
];
|
||||
|
||||
config = {
|
||||
default_config = { };
|
||||
|
||||
# anthropic = {
|
||||
# intents = [
|
||||
# "HassTurnOn"
|
||||
# "HassTurnOff"
|
||||
# "HassGetWeather"
|
||||
# ];
|
||||
# };
|
||||
|
||||
intent = { };
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
16
server/home-assistant/heating.nix
Normal file
16
server/home-assistant/heating.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{...}: {
|
||||
services.home-assistant.config.automation = [
|
||||
{
|
||||
description = "Pause Heating when Window opens";
|
||||
alias = "Heating Pause";
|
||||
use_blueprint = {
|
||||
path = "raffy-ops/hvac_pause.yaml";
|
||||
input = {
|
||||
climate_device = "climate.shellyblutrv_286847ef7fc0";
|
||||
doors_windows = "binary_sensor.shelly_blu_door_window_3a5a_window";
|
||||
action_first = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
55
server/home-assistant/lights.nix
Normal file
55
server/home-assistant/lights.nix
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
{...}: {
|
||||
services.home-assistant.config.automation = [
|
||||
{
|
||||
alias = "Wake Up Light";
|
||||
description = "Turn on the light on alarm ringing";
|
||||
trigger = {
|
||||
platform = "time";
|
||||
at = "sensor.lilith_phone_next_alarm";
|
||||
};
|
||||
condition = [];
|
||||
action = [
|
||||
{
|
||||
action = "light.turn_on";
|
||||
metadata = {};
|
||||
data = {
|
||||
transition = 3;
|
||||
kelvin = 3000;
|
||||
brightness_pct = 100;
|
||||
};
|
||||
target = {
|
||||
device_id = "7d40ebcac890a2743d7dc2a6dc4ca797";
|
||||
};
|
||||
}
|
||||
];
|
||||
mode = "single";
|
||||
}
|
||||
{
|
||||
alias = "Automatic Light Off";
|
||||
description = "Turn off the light after 15 minutes once Liv leaves the house";
|
||||
trigger = {
|
||||
platform = "state";
|
||||
entity_id = "person.liv_benstem";
|
||||
from = "home";
|
||||
to = "not_home";
|
||||
for = {
|
||||
hours = 0;
|
||||
minutes = 10;
|
||||
seconds = 0;
|
||||
};
|
||||
};
|
||||
condition = [];
|
||||
action = [
|
||||
{
|
||||
action = "light.turn_off";
|
||||
metadata = {};
|
||||
data = {};
|
||||
target = {
|
||||
area_id = "bedroom";
|
||||
};
|
||||
}
|
||||
];
|
||||
mode = "single";
|
||||
}
|
||||
];
|
||||
}
|
||||
20
server/home-assistant/mosquitto.nix
Normal file
20
server/home-assistant/mosquitto.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{ sops, config, ...}: {
|
||||
|
||||
sops.secrets."home-assistant/mosquitto/hass" = {};
|
||||
|
||||
services.mosquitto = {
|
||||
enable = true;
|
||||
listeners = [
|
||||
{
|
||||
address = "192.168.178.111";
|
||||
port = 1883;
|
||||
users.hass = {
|
||||
acl = [ "readwrite #" ];
|
||||
hashedPasswordFile = config.sops.secrets."home-assistant/mosquitto/hass".path;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 1883 ];
|
||||
}
|
||||
19
server/home-assistant/wyoming.nix
Normal file
19
server/home-assistant/wyoming.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{...}: {
|
||||
services.wyoming = {
|
||||
piper.servers = {
|
||||
alba = {
|
||||
enable=true;
|
||||
uri="tcp://localhost:12001";
|
||||
voice="en_GB-alba-medium";
|
||||
};
|
||||
};
|
||||
faster-whisper.servers = {
|
||||
tiny = {
|
||||
enable=true;
|
||||
uri="tcp://localhost:12002";
|
||||
model="tiny-int8";
|
||||
language="en";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
27
server/home-assistant/zones.nix
Normal file
27
server/home-assistant/zones.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
services.home-assistant.config.homeassistant = {
|
||||
name = "Home";
|
||||
latitude = "52.405212";
|
||||
country = "DE";
|
||||
longitude = "13.047246";
|
||||
elevation = "45";
|
||||
unit_system = "metric";
|
||||
time_zone = "Europe/Berlin";
|
||||
};
|
||||
services.home-assistant.config.zone = [
|
||||
{
|
||||
name = "University";
|
||||
icon = "mdi:school";
|
||||
latitude = "52.408866";
|
||||
longitude = "12.97513";
|
||||
radius = "500";
|
||||
}
|
||||
{
|
||||
name = "Parents";
|
||||
icon = "mdi:human-male-female-child";
|
||||
latitude = "52.153352";
|
||||
longitude = "9.919335";
|
||||
radius = "100";
|
||||
}
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue