mirror of
https://git.sr.ht/~magic_rb/cluster
synced 2024-11-24 09:06:15 +01:00
36 lines
677 B
Nix
36 lines
677 B
Nix
|
{
|
||
|
alias = "Alarm - ReTriggered";
|
||
|
id = "2f4942bc-3538-4888-bc52-84171e0b040f";
|
||
|
|
||
|
trigger = [
|
||
|
{
|
||
|
platform = "state";
|
||
|
entity_id = "binary_sensor.motion_sensor_occupancy";
|
||
|
to = "on";
|
||
|
}
|
||
|
];
|
||
|
|
||
|
condition = {
|
||
|
condition = "or";
|
||
|
conditions = [
|
||
|
{
|
||
|
condition = "state";
|
||
|
entity_id = "alarm_control_panel.home_alarm";
|
||
|
state = "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";
|
||
|
};
|
||
|
}
|
||
|
];
|
||
|
}
|