mirror of
https://git.sr.ht/~magic_rb/cluster
synced 2024-11-24 00:56:16 +01:00
Home Assistant changes
Signed-off-by: Magic_RB <magic_rb@redalder.org>
This commit is contained in:
parent
60ffcb7757
commit
9b8ef12c05
|
@ -93,6 +93,7 @@
|
||||||
# currency = "EUR";
|
# currency = "EUR";
|
||||||
unit_system = "metric";
|
unit_system = "metric";
|
||||||
time_zone = "\${TIME_ZONE}";
|
time_zone = "\${TIME_ZONE}";
|
||||||
|
country = "\${COUNTRY}";
|
||||||
internal_url = "http://localhost:8123/";
|
internal_url = "http://localhost:8123/";
|
||||||
whitelist_external_dirs = [
|
whitelist_external_dirs = [
|
||||||
"/mnt/cctv"
|
"/mnt/cctv"
|
||||||
|
@ -109,6 +110,11 @@
|
||||||
(import ./home-assistant/automations/alarm/retriggered.nix)
|
(import ./home-assistant/automations/alarm/retriggered.nix)
|
||||||
(import ./home-assistant/automations/alarm/motion-detected.nix)
|
(import ./home-assistant/automations/alarm/motion-detected.nix)
|
||||||
(import ./home-assistant/automations/alarm/motion-detected-away.nix)
|
(import ./home-assistant/automations/alarm/motion-detected-away.nix)
|
||||||
|
|
||||||
|
(import ./home-assistant/automations/bathroom_light/dim.nix)
|
||||||
|
(import ./home-assistant/automations/bathroom_light/brighten.nix)
|
||||||
|
(import ./home-assistant/automations/bathroom_light/on.nix)
|
||||||
|
(import ./home-assistant/automations/bathroom_light/off.nix)
|
||||||
];
|
];
|
||||||
alarm_control_panel = import ./home-assistant/alarm_control_panel.nix;
|
alarm_control_panel = import ./home-assistant/alarm_control_panel.nix;
|
||||||
frontend.themes =
|
frontend.themes =
|
||||||
|
@ -157,6 +163,9 @@
|
||||||
[ xmodem
|
[ xmodem
|
||||||
psycopg2
|
psycopg2
|
||||||
aiohttp-cors
|
aiohttp-cors
|
||||||
|
bleak-retry-connector
|
||||||
|
psutil-home-assistant
|
||||||
|
bluetooth-auto-recovery
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -13,6 +13,16 @@
|
||||||
entity_id = "binary_sensor.sensor_entry_door_contact";
|
entity_id = "binary_sensor.sensor_entry_door_contact";
|
||||||
to = "on";
|
to = "on";
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
platform = "state";
|
||||||
|
entity_id = "binary_sensor.left_window_contact";
|
||||||
|
to = "on";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
platform = "state";
|
||||||
|
entity_id = "binary_sensor.right_window_contact";
|
||||||
|
to = "on";
|
||||||
|
}
|
||||||
];
|
];
|
||||||
condition = {
|
condition = {
|
||||||
condition = "or";
|
condition = "or";
|
||||||
|
|
|
@ -0,0 +1,54 @@
|
||||||
|
{
|
||||||
|
alias = "Bathroom Light Brighten";
|
||||||
|
description = "";
|
||||||
|
id = "dff10ca7-a27c-469a-8015-bd6899458c8d";
|
||||||
|
|
||||||
|
action = [{
|
||||||
|
"else" = [{ stop = ""; }];
|
||||||
|
"if" = [{
|
||||||
|
condition = "trigger";
|
||||||
|
id = "brightness_down";
|
||||||
|
}];
|
||||||
|
"then" = [{
|
||||||
|
repeat = {
|
||||||
|
sequence = [
|
||||||
|
{
|
||||||
|
data = { brightness_step_pct = 10; };
|
||||||
|
service = "light.turn_on";
|
||||||
|
target = { entity_id = "light.bathroom_lights"; };
|
||||||
|
}
|
||||||
|
{
|
||||||
|
delay = {
|
||||||
|
hours = 0;
|
||||||
|
milliseconds = 200;
|
||||||
|
minutes = 0;
|
||||||
|
seconds = 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
while = [{
|
||||||
|
condition = "not";
|
||||||
|
conditions = [ ];
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
}];
|
||||||
|
}];
|
||||||
|
|
||||||
|
condition = [ ];
|
||||||
|
|
||||||
|
trigger = [
|
||||||
|
{
|
||||||
|
entity_id = [ "sensor.0x540f57fffe3c601d_action" ];
|
||||||
|
id = "brightness_down";
|
||||||
|
platform = "state";
|
||||||
|
to = "brightness_move_up";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
entity_id = [ "sensor.0x540f57fffe3c601d_action" ];
|
||||||
|
platform = "state";
|
||||||
|
to = "brightness_stop";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
mode = "restart";
|
||||||
|
}
|
54
containers/home-assistant/automations/bathroom_light/dim.nix
Normal file
54
containers/home-assistant/automations/bathroom_light/dim.nix
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
{
|
||||||
|
alias = "Bathroom Light Dim";
|
||||||
|
description = "";
|
||||||
|
id = "c28cad3b-8435-48b4-9ced-bd5befaf11df";
|
||||||
|
|
||||||
|
trigger = [
|
||||||
|
{
|
||||||
|
entity_id = [ "sensor.0x540f57fffe3c601d_action" ];
|
||||||
|
id = "brightness_down";
|
||||||
|
platform = "state";
|
||||||
|
to = "brightness_move_down";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
entity_id = [ "sensor.0x540f57fffe3c601d_action" ];
|
||||||
|
platform = "state";
|
||||||
|
to = "brightness_stop";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
condition = [ ];
|
||||||
|
|
||||||
|
action = [{
|
||||||
|
"else" = [{ stop = ""; }];
|
||||||
|
"if" = [{
|
||||||
|
condition = "trigger";
|
||||||
|
id = "brightness_down";
|
||||||
|
}];
|
||||||
|
"then" = [{
|
||||||
|
repeat = {
|
||||||
|
sequence = [
|
||||||
|
{
|
||||||
|
data = { brightness_step_pct = -10; };
|
||||||
|
service = "light.turn_on";
|
||||||
|
target = { entity_id = "light.bathroom_lights"; };
|
||||||
|
}
|
||||||
|
{
|
||||||
|
delay = {
|
||||||
|
hours = 0;
|
||||||
|
milliseconds = 200;
|
||||||
|
minutes = 0;
|
||||||
|
seconds = 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
while = [{
|
||||||
|
condition = "not";
|
||||||
|
conditions = [ ];
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
}];
|
||||||
|
}];
|
||||||
|
|
||||||
|
mode = "restart";
|
||||||
|
}
|
24
containers/home-assistant/automations/bathroom_light/off.nix
Normal file
24
containers/home-assistant/automations/bathroom_light/off.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
alias = "Light Off";
|
||||||
|
description = "";
|
||||||
|
id = "5f773a4d-5a52-4483-a49d-9c0944ea0b21";
|
||||||
|
|
||||||
|
trigger = [{
|
||||||
|
device_id = "bf6aed0be7735065cddf5a0c11629661";
|
||||||
|
discovery_id = "0x540f57fffe3c601d action_off";
|
||||||
|
domain = "mqtt";
|
||||||
|
platform = "device";
|
||||||
|
subtype = "off";
|
||||||
|
type = "action";
|
||||||
|
}];
|
||||||
|
|
||||||
|
condition = [ ];
|
||||||
|
|
||||||
|
action = [{
|
||||||
|
data = { };
|
||||||
|
service = "light.turn_off";
|
||||||
|
target = { entity_id = "light.bathroom_lights"; };
|
||||||
|
}];
|
||||||
|
|
||||||
|
mode = "single";
|
||||||
|
}
|
24
containers/home-assistant/automations/bathroom_light/on.nix
Normal file
24
containers/home-assistant/automations/bathroom_light/on.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
alias = "Light On";
|
||||||
|
description = "";
|
||||||
|
id = "1330a1c7-3f3f-488e-8aba-aea8937236ce";
|
||||||
|
|
||||||
|
trigger = [{
|
||||||
|
device_id = "bf6aed0be7735065cddf5a0c11629661";
|
||||||
|
discovery_id = "0x540f57fffe3c601d action_on";
|
||||||
|
domain = "mqtt";
|
||||||
|
platform = "device";
|
||||||
|
subtype = "on";
|
||||||
|
type = "action";
|
||||||
|
}];
|
||||||
|
|
||||||
|
condition = [ ];
|
||||||
|
|
||||||
|
action = [{
|
||||||
|
data = { };
|
||||||
|
service = "light.turn_on";
|
||||||
|
target = { entity_id = "light.bathroom_lights"; };
|
||||||
|
}];
|
||||||
|
|
||||||
|
mode = "single";
|
||||||
|
}
|
|
@ -98,6 +98,7 @@
|
||||||
pkgs.mkShell {
|
pkgs.mkShell {
|
||||||
nativeBuildInputs = with pkgs;
|
nativeBuildInputs = with pkgs;
|
||||||
[ nomad_1_3 consul vault packer jq terraform
|
[ nomad_1_3 consul vault packer jq terraform
|
||||||
|
nixfmt remarshal
|
||||||
(pkgs.buildGoModule {
|
(pkgs.buildGoModule {
|
||||||
name = "csc";
|
name = "csc";
|
||||||
version = "master";
|
version = "master";
|
||||||
|
|
Loading…
Reference in a new issue