stockholm/makefu/2configs/bureautomation/automation/nachtlicht.nix

44 lines
1.0 KiB
Nix
Raw Normal View History

2019-03-06 15:42:27 +00:00
[
{
alias = "Turn off Nachtlicht on sunrise";
trigger =
{
platform = "sun";
event = "sunrise";
};
action =
{
service = "homeassistant.turn_off";
entity_id = [ "group.nachtlicht" ];
2019-03-06 15:42:27 +00:00
};
}
{
alias = "Turn on Nachtlicht on motion and dusk";
trigger =
{
platform = "state";
entity_id = "binary_sensor.motion";
to = "on";
};
condition = # 'when dark'
{
condition = "or";
conditions = [
{ condition = "sun";
after = "sunset";
after_offset = "-00:45:00"; # on dusk
}
{ condition = "sun";
before = "sunrise";
}
];
};
action =
{
service = "homeassistant.turn_on";
entity_id = [ "group.nachtlicht" ];
2019-03-06 15:42:27 +00:00
};
}
]