initial setup of HA with christmas lights

This commit is contained in:
Tyler Starr 2023-12-03 11:59:29 -08:00
parent c73e8a5e94
commit 15f0b0e9b0
5 changed files with 95 additions and 2 deletions

View File

@ -8,6 +8,7 @@
./obsidian-vault.nix
./share.nix
./rss.nix
./home-assistant
];
nix = {
@ -117,8 +118,8 @@
"rss.tstarr.us" = (SSL // {
locations."/".proxyPass = "http://localhost:8081/";
});
"rss1.tstarr.us" = (SSL // {
locations."/".proxyPass = "http://localhost:8087/";
"home.tstarr.us" = (SSL // {
locations."/".proxyPass = "http://localhost:8123/";
});
"media.tstarr.us" = (SSL // {
locations."/".proxyPass = "http://localhost:8096/";

View File

@ -0,0 +1,50 @@
{ config, lib, pkgs, user, ... }:
{
services.home-assistant.config = {
"automation manual" = [
{
alias = "turn on christmas lights";
trigger = {
platform = "time";
at = "16:45";
};
action = [
{
type = "turn_on";
device_id = "32bf8baf1214391472566d4300c7d6fb";
entity_id = "72c7694c3a3aed5d67499bfe0574346b";
domain = "switch";
}
{
type = "turn_on";
device_id = "08db6bd9e7bf98d5bf1b08351b909c94";
entity_id = "ecec82df2265c6b92c8474fe0c9fde6b";
domain = "switch";
}
];
}
{
alias = "turn off christmas lights";
trigger = {
platform = "time";
at = "23:59";
};
action = [
{
type = "turn_off";
device_id = "32bf8baf1214391472566d4300c7d6fb";
entity_id = "72c7694c3a3aed5d67499bfe0574346b";
domain = "switch";
}
{
type = "turn_off";
device_id = "08db6bd9e7bf98d5bf1b08351b909c94";
entity_id = "ecec82df2265c6b92c8474fe0c9fde6b";
domain = "switch";
}
];
}
];
"automation ui" = "!include automations.yaml";
};
}

View File

@ -0,0 +1,26 @@
{ config, lib, pkgs, user, ... }:
{
imports = [
./mqtt.nix
./automations.nix
];
networking.firewall.allowedTCPPorts = [ 8123 ];
networking.firewall.allowedUDPPorts = [ 8123 ];
services.home-assistant = {
enable = true;
extraComponents = [
# Components required to complete the onboarding
"esphome"
"met"
"radio_browser"
"tasmota"
];
config = {
# Includes dependencies for a basic setup
# https://www.home-assistant.io/integrations/default_config/
default_config = {};
};
};
}

View File

@ -0,0 +1,15 @@
{ config, lib, pkgs, user, ... }:
{
networking.firewall.allowedTCPPorts = [ 1883 ];
services.home-assistant.config.mqtt = { };
services.mosquitto = {
enable = true;
listeners = [{
users.tstarr = {
acl = [ "readwrite #" ];
hashedPassword = "$7$101$fWS64zbpdeUWd8fA$A31ESjDqooTB9BTYA9dvdU20Cwpxc3wmXfm7QLEJYZzd+UkbCVG1Ic7VsD9BBghka0WQZgkQczzag/t09BZ+5w==";
};
}];
};
}

View File

@ -0,0 +1 @@
{"NAME":"Amysen JSMWF02","GPIO":[0,17,0,0,0,0,0,0,0,56,21,0,0],"FLAG":0,"BASE":18}