72 lines
1.5 KiB
Nix
72 lines
1.5 KiB
Nix
{
|
|
services.home-assistant.extraComponents = [
|
|
"wake_on_lan"
|
|
];
|
|
services.home-assistant.config = {
|
|
ios = {
|
|
actions = [
|
|
{
|
|
name = "Turn on PC";
|
|
label.text = "Turn on PC";
|
|
icon = {
|
|
icon = "controller";
|
|
color = "#ffffff";
|
|
};
|
|
show_in_watch = true;
|
|
}
|
|
];
|
|
};
|
|
wake_on_lan = {};
|
|
"automation pc_switch" = {
|
|
alias = "switch pc";
|
|
trigger = {
|
|
platform = "event";
|
|
event_type = "button_pressed";
|
|
event_data = {
|
|
id = [ 254 235 105 198 ];
|
|
onoff = 0;
|
|
};
|
|
};
|
|
action = {
|
|
service = "script.turn_on";
|
|
target = {
|
|
entity_id = "script.turn_on_pc";
|
|
};
|
|
};
|
|
};
|
|
script = {
|
|
turn_on_pc = {
|
|
sequence = [
|
|
{
|
|
service = "wake_on_lan.send_magic_packet";
|
|
data = {
|
|
mac = "04:7c:16:d5:63:5e";
|
|
broadcast_address = "10.42.96.5";
|
|
broadcast_port = 9;
|
|
};
|
|
}
|
|
];
|
|
};
|
|
};
|
|
"automation turn on pc" = {
|
|
trigger = [
|
|
{
|
|
platform = "event";
|
|
event_type = "ios.action_fired";
|
|
event_data = {
|
|
actionID = "Turn on PC";
|
|
};
|
|
}
|
|
];
|
|
action = [
|
|
{
|
|
service = "script.turn_on";
|
|
target = {
|
|
entity_id = "script.turn_on_pc";
|
|
};
|
|
}
|
|
];
|
|
};
|
|
};
|
|
}
|