Home Assistant changes

Signed-off-by: Magic_RB <magic_rb@redalder.org>
This commit is contained in:
Magic_RB 2023-05-23 10:28:56 +02:00
parent 60ffcb7757
commit 9b8ef12c05
No known key found for this signature in database
GPG key ID: 08D5287CC5DDCA0E
7 changed files with 176 additions and 0 deletions

View file

@ -93,6 +93,7 @@
# currency = "EUR";
unit_system = "metric";
time_zone = "\${TIME_ZONE}";
country = "\${COUNTRY}";
internal_url = "http://localhost:8123/";
whitelist_external_dirs = [
"/mnt/cctv"
@ -109,6 +110,11 @@
(import ./home-assistant/automations/alarm/retriggered.nix)
(import ./home-assistant/automations/alarm/motion-detected.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;
frontend.themes =
@ -157,6 +163,9 @@
[ xmodem
psycopg2
aiohttp-cors
bleak-retry-connector
psutil-home-assistant
bluetooth-auto-recovery
];
};
};

View file

@ -13,6 +13,16 @@
entity_id = "binary_sensor.sensor_entry_door_contact";
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 = "or";

View file

@ -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";
}

View 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";
}

View 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";
}

View 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";
}

View file

@ -98,6 +98,7 @@
pkgs.mkShell {
nativeBuildInputs = with pkgs;
[ nomad_1_3 consul vault packer jq terraform
nixfmt remarshal
(pkgs.buildGoModule {
name = "csc";
version = "master";