dotfiles/nixng/containers/home-assistant/configs/automations/alarm/triggered.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

33 lines
701 B
Nix

{
alias = "Alarm - Triggered";
id = "6b9c6dac-2c6b-4add-b499-8e2b134e5d9c";
trigger = [
{
entity_id = "alarm_control_panel.home_alarm";
platform = "state";
to = "triggered";
}
];
action = [
{
service = "camera.record";
target.entity_id = "camera.mirror_camera";
data = {
lookback = 30;
duration = 30;
filename = "/mnt/cctv/cctv-{{ states('sensor.date_time_iso') }}.mp4";
};
}
{
data = {
message = "Alarm Triggered - Motion Detected!";
data = {
channel = "Motion";
importance = "high";
};
};
service = "notify.mobile_app_redrum";
}
];
}