dotfiles/nixng/containers/home-assistant/configs/automations/alarm/motion-detected-away.nix
Magic_RB 47ad385ca2 Add the NixNG containers for Home Assistant
Signed-off-by: Magic_RB <magic_rb@redalder.org>
2023-06-16 16:08:09 +02:00

43 lines
912 B
Nix

{
alias = "Alarm - Trigger when motion detected - Away";
id = "b16e988f-2ee0-4596-a14d-0fda1a95ac2d";
trigger = [
{
platform = "state";
entity_id = "binary_sensor.motion_sensor_occupancy";
to = "on";
}
{
platform = "state";
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";
conditions = [
{
condition = "state";
entity_id = "alarm_control_panel.home_alarm";
state = "armed_away";
}
];
};
action = [
{
service = "alarm_control_panel.alarm_trigger";
entity_id = "alarm_control_panel.home_alarm";
}
];
}