44 lines
928 B
Nix
44 lines
928 B
Nix
{
|
|
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";
|
|
};
|
|
}
|
|
];
|
|
};
|
|
};
|
|
}
|