home-assistant: worked on kodi and wifi
This commit is contained in:
parent
2d87be4885
commit
93fa05acd8
4 changed files with 33 additions and 66 deletions
|
@ -7,71 +7,36 @@
|
||||||
media_player = [{
|
media_player = [{
|
||||||
platform = "kodi";
|
platform = "kodi";
|
||||||
host = "127.0.0.1";
|
host = "127.0.0.1";
|
||||||
turn_on_action.service = "script.watch_tv";
|
|
||||||
turn_off_action.service = "script.stop_watch_tv";
|
|
||||||
}];
|
}];
|
||||||
|
|
||||||
shell_command = {
|
shell_command = {
|
||||||
start_display =
|
start_kodi = "sudo ${pkgs.systemd}/bin/systemctl start display-manager";
|
||||||
"sudo ${pkgs.systemd}/bin/systemctl start display-manager";
|
stop_kodi = "sudo ${pkgs.systemd}/bin/systemctl stop display-manager";
|
||||||
stop_display = "sudo ${pkgs.systemd}/bin/systemctl stop display-manager";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
script = {
|
automation = [
|
||||||
|
|
||||||
turn_all_off.sequence = [
|
|
||||||
# todo : use the shell_command here
|
|
||||||
{
|
{
|
||||||
alias = "turn off tv";
|
alias = "turn kodi on once the tv is turned on";
|
||||||
service = "switch.turn_off";
|
trigger = {
|
||||||
data.entity_id = "group.tv";
|
platform = "state";
|
||||||
}
|
entity_id = "group.tv";
|
||||||
{
|
from = "off";
|
||||||
alias = "stop kodi";
|
to = "on";
|
||||||
service = "shell_command.stop_display";
|
for.seconds = 60;
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
test_display.sequence = [
|
|
||||||
{ service = "shell_command.start_display"; }
|
|
||||||
{ delay.seconds = 20; }
|
|
||||||
{ service = "shell_command.stop_display"; }
|
|
||||||
];
|
|
||||||
|
|
||||||
watch_tv = {
|
|
||||||
alias = "Watch TV";
|
|
||||||
sequence = [
|
|
||||||
{
|
|
||||||
alias = "turn on tv";
|
|
||||||
service = "switch.turn_on";
|
|
||||||
data.entity_id = "group.tv";
|
|
||||||
}
|
|
||||||
{ delay.seconds = 20; }
|
|
||||||
{
|
|
||||||
alias = "start kodi";
|
|
||||||
service = "shell_command.start_display";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
action = [{ service = "shell_command.start_kodi"; }];
|
||||||
stop_watch_tv = {
|
|
||||||
alias = "Stop TV";
|
|
||||||
sequence = [
|
|
||||||
{
|
|
||||||
alias = "turn off tv";
|
|
||||||
service = "switch.turn_off";
|
|
||||||
data.entity_id = "group.tv";
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
alias = "stop kodi";
|
alias = "turn off kodi on once the tv is turned off";
|
||||||
service = "shell_command.stop_display";
|
trigger = {
|
||||||
|
platform = "state";
|
||||||
|
entity_id = "group.tv";
|
||||||
|
from = "on";
|
||||||
|
to = "off";
|
||||||
|
};
|
||||||
|
action = [{ service = "shell_command.stop_kodi"; }];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
group.tv.entities =
|
|
||||||
[ "script.watch_tv" "script.stop_watch_tv" "script.test_display" ];
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ in {
|
||||||
16 numbers between 0 and 255
|
16 numbers between 0 and 255
|
||||||
see https://www.zigbee2mqtt.io/how_tos/how_to_secure_network.html
|
see https://www.zigbee2mqtt.io/how_tos/how_to_secure_network.html
|
||||||
'';
|
'';
|
||||||
example = [7 3 5 7 9 11 13 15 0 2 4 6 8 11 12 13];
|
example = [ 7 3 5 7 9 11 13 15 0 2 4 6 8 11 12 13 ];
|
||||||
};
|
};
|
||||||
devices = mkOption {
|
devices = mkOption {
|
||||||
type = with types; attrs;
|
type = with types; attrs;
|
||||||
|
|
|
@ -4,10 +4,10 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
autorun = false;
|
autorun = false;
|
||||||
videoDrivers = [ "intel" ];
|
videoDrivers = [ "intel" ];
|
||||||
deviceSection = ''
|
#deviceSection = ''
|
||||||
Option "DRI" "2"
|
# Option "DRI" "2"
|
||||||
Option "TearFree" "true"
|
# Option "TearFree" "true"
|
||||||
'';
|
#'';
|
||||||
desktopManager = {
|
desktopManager = {
|
||||||
kodi.enable = true;
|
kodi.enable = true;
|
||||||
default = "kodi";
|
default = "kodi";
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
{ lib, pkgs, ... }:
|
{ lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
wifi = "wlp0s29u1u1";
|
# you find this device using `ifconfig -a` or `ip link`
|
||||||
|
wifi = "wlp0s26u1u2";
|
||||||
|
#wifi = "wlp3s0-ifb";
|
||||||
ipAddress = "10.23.45.1";
|
ipAddress = "10.23.45.1";
|
||||||
prefixLength = 24;
|
prefixLength = 24;
|
||||||
servedAddressRange = "10.23.45.2,10.23.45.150,12h";
|
servedAddressRange = "10.23.45.2,10.23.45.150,12h";
|
||||||
|
|
Loading…
Reference in a new issue