77 lines
1.9 KiB
Nix
77 lines
1.9 KiB
Nix
{
|
|
services.home-assistant.config = {
|
|
"automation wakeup" = {
|
|
alias = "wakeup";
|
|
hide_entity = true;
|
|
trigger = {
|
|
platform = "time";
|
|
at = "input_datetime.wakeup";
|
|
};
|
|
action = [
|
|
{
|
|
service = "switch.turn_on";
|
|
entity_id = "switch.coffee";
|
|
}
|
|
{
|
|
delay = 1700;
|
|
}
|
|
{
|
|
service = "switch.turn_on";
|
|
entity_id = "switch.78_8c_b5_fe_41_62_port_2_poe"; # livingroom
|
|
}
|
|
{
|
|
service = "switch.turn_on";
|
|
entity_id = "switch.78_8c_b5_fe_41_62_port_3_poe"; # garden
|
|
}
|
|
];
|
|
};
|
|
"automation sleep" = {
|
|
alias = "sleep";
|
|
hide_entity = true;
|
|
trigger = [
|
|
{
|
|
platform = "event";
|
|
event_type = "shelly.click";
|
|
event_data = {
|
|
device = "shellybutton1-E8DB84AA196D";
|
|
};
|
|
}
|
|
{
|
|
platform = "event";
|
|
event_type = "shelly.click";
|
|
event_data = {
|
|
device = "shellybutton1-E8DB84AA136D";
|
|
};
|
|
}
|
|
];
|
|
action = [
|
|
{
|
|
choose = [
|
|
{
|
|
conditions = [ "{{ trigger.event.data.click_type == \"long\" }}" ];
|
|
sequence = [
|
|
{
|
|
service = "light.turn_off";
|
|
entity_id = "all";
|
|
}
|
|
{
|
|
service = "switch.turn_off";
|
|
entity_id = "switch.coffee";
|
|
}
|
|
{
|
|
service = "switch.turn_off";
|
|
entity_id = "switch.78_8c_b5_fe_41_62_port_2_poe";
|
|
}
|
|
{
|
|
service = "switch.turn_off";
|
|
entity_id = "switch.78_8c_b5_fe_41_62_port_3_poe";
|
|
}
|
|
];
|
|
}
|
|
];
|
|
}
|
|
];
|
|
};
|
|
};
|
|
}
|