many changes and more modularizing
This commit is contained in:
43
hosts/fw-new/modules/home-assistant/power-saving.nix
Normal file
43
hosts/fw-new/modules/home-assistant/power-saving.nix
Normal file
@@ -0,0 +1,43 @@
|
||||
{
|
||||
services.home-assistant.config = {
|
||||
"automation power leave home" = {
|
||||
alias = "leave house power";
|
||||
mode = "restart";
|
||||
trigger = {
|
||||
platform = "state";
|
||||
entity_id = [
|
||||
"device_tracker.dominiks_iphone"
|
||||
];
|
||||
from = "home";
|
||||
to = "not_home";
|
||||
};
|
||||
action = [
|
||||
{
|
||||
service = "script.turn_on";
|
||||
target = {
|
||||
entity_id = "script.turn_off_circuits";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
"automation arrive home power" = {
|
||||
alias = "arrive home power";
|
||||
trigger = {
|
||||
platform = "state";
|
||||
entity_id = [
|
||||
"device_tracker.dominiks_iphone"
|
||||
];
|
||||
from = "not_home";
|
||||
to = "home";
|
||||
};
|
||||
action = [
|
||||
{
|
||||
service = "script.turn_on";
|
||||
target = {
|
||||
entity_id = "script.turn_on_circuits";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user