mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
commit
ce7aee4a3d
1 changed files with 39 additions and 7 deletions
|
|
@ -49,6 +49,10 @@ in {
|
||||||
path = "gensokyo/home-assistant";
|
path = "gensokyo/home-assistant";
|
||||||
field = "iphone-se-irk";
|
field = "iphone-se-irk";
|
||||||
};
|
};
|
||||||
|
secrets.variables.companion-pixel6 = {
|
||||||
|
path = "gensokyo/home-assistant";
|
||||||
|
field = "companion-pixel6";
|
||||||
|
};
|
||||||
secrets.variables.tile-bee = {
|
secrets.variables.tile-bee = {
|
||||||
path = "gensokyo/home-assistant";
|
path = "gensokyo/home-assistant";
|
||||||
field = "tile-bee";
|
field = "tile-bee";
|
||||||
|
|
@ -70,6 +74,7 @@ in {
|
||||||
text = let
|
text = let
|
||||||
espresenceDevices = {
|
espresenceDevices = {
|
||||||
iphone-se-irk = tf.variables.iphone-se-irk.ref;
|
iphone-se-irk = tf.variables.iphone-se-irk.ref;
|
||||||
|
companion-pixel6 = tf.variables.companion-pixel6.ref;
|
||||||
tile-kat-wallet = tf.variables.tile-kat-wallet.ref;
|
tile-kat-wallet = tf.variables.tile-kat-wallet.ref;
|
||||||
tile-kat-keys = tf.variables.tile-kat-keys.ref;
|
tile-kat-keys = tf.variables.tile-kat-keys.ref;
|
||||||
tile-bee = tf.variables.tile-bee.ref;
|
tile-bee = tf.variables.tile-bee.ref;
|
||||||
|
|
@ -91,13 +96,16 @@ in {
|
||||||
cp --no-preserve=mode ${config.secrets.files.home-assistant-secrets.path} ${config.services.home-assistant.configDir}/secrets.yaml
|
cp --no-preserve=mode ${config.secrets.files.home-assistant-secrets.path} ${config.services.home-assistant.configDir}/secrets.yaml
|
||||||
cp --no-preserve=mode ${config.secrets.files.ha-integration.path} ${config.services.home-assistant.configDir}/integration.yaml
|
cp --no-preserve=mode ${config.secrets.files.ha-integration.path} ${config.services.home-assistant.configDir}/integration.yaml
|
||||||
# UI-editable config files
|
# UI-editable config files
|
||||||
touch ${config.services.home-assistant.configDir}/{automations,scenes,scripts}.yaml
|
touch ${config.services.home-assistant.configDir}/{automations,scenes,scripts,manual}.yaml
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
services.home-assistant = {
|
services.home-assistant = {
|
||||||
enable = true;
|
enable = true;
|
||||||
config = {
|
config = {
|
||||||
|
packages = {
|
||||||
|
manual = "!include manual.yaml";
|
||||||
|
};
|
||||||
homeassistant = {
|
homeassistant = {
|
||||||
name = "Gensokyo";
|
name = "Gensokyo";
|
||||||
unit_system = "metric";
|
unit_system = "metric";
|
||||||
|
|
@ -182,7 +190,13 @@ in {
|
||||||
"light.closet_overhead".expose = true;
|
"light.closet_overhead".expose = true;
|
||||||
"light.closet_overhead_left".room = hidden;
|
"light.closet_overhead_left".room = hidden;
|
||||||
"light.closet_overhead_right".room = hidden;
|
"light.closet_overhead_right".room = hidden;
|
||||||
"fan.fornuftig_fan".expose = true;
|
"fan.bedroom_purifier" = {
|
||||||
|
expose = true;
|
||||||
|
aliases = [
|
||||||
|
"FÖRNUFTIG"
|
||||||
|
"Bedroom Air Purifier"
|
||||||
|
];
|
||||||
|
};
|
||||||
"fan.bedroom_floor".expose = true;
|
"fan.bedroom_floor".expose = true;
|
||||||
"switch.swb1_relay_3".expose = true;
|
"switch.swb1_relay_3".expose = true;
|
||||||
"switch.swb1_relay_4".expose = true;
|
"switch.swb1_relay_4".expose = true;
|
||||||
|
|
@ -201,6 +215,7 @@ in {
|
||||||
"TV Backlight"
|
"TV Backlight"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
"light.living_bookshelf".room = hidden;
|
||||||
# midea
|
# midea
|
||||||
"climate.living_ac".aliases = [
|
"climate.living_ac".aliases = [
|
||||||
"AC"
|
"AC"
|
||||||
|
|
@ -208,10 +223,21 @@ in {
|
||||||
];
|
];
|
||||||
"sensor.living_ac_outdoor_temperature".expose = false;
|
"sensor.living_ac_outdoor_temperature".expose = false;
|
||||||
|
|
||||||
|
# kitchen
|
||||||
|
"light.kitchen_overhead".expose = true;
|
||||||
|
"light.kitchen_overhead_inner".room = hidden;
|
||||||
|
"light.kitchen_overhead_middle".room = hidden;
|
||||||
|
"light.kitchen_overhead_outer".room = hidden;
|
||||||
|
|
||||||
# balcony
|
# balcony
|
||||||
"light.outdoor_strip".expose = true;
|
"light.outdoor_strip".expose = true;
|
||||||
"light.lantern".expose = true;
|
"light.lantern".expose = true;
|
||||||
|
|
||||||
|
# foyer
|
||||||
|
"light.entry_overhead".expose = true;
|
||||||
|
"light.entry_overhead_left".room = hidden;
|
||||||
|
"light.entry_overhead_right".room = hidden;
|
||||||
|
|
||||||
# shanghai systemd
|
# shanghai systemd
|
||||||
"switch.shanghai_graphical".expose = true;
|
"switch.shanghai_graphical".expose = true;
|
||||||
"switch.shanghai_mradio".expose = true;
|
"switch.shanghai_mradio".expose = true;
|
||||||
|
|
@ -241,6 +267,8 @@ in {
|
||||||
"light.living_cluster"
|
"light.living_cluster"
|
||||||
"light.bedroom_overhead"
|
"light.bedroom_overhead"
|
||||||
"light.closet_overhead"
|
"light.closet_overhead"
|
||||||
|
"light.kitchen_overhead"
|
||||||
|
"light.entry_overhead"
|
||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
entity_config = {
|
entity_config = {
|
||||||
|
|
@ -303,16 +331,23 @@ in {
|
||||||
sensor = let
|
sensor = let
|
||||||
mkESPresenceBeacon = { device_id, ... }@args: {
|
mkESPresenceBeacon = { device_id, ... }@args: {
|
||||||
platform = "mqtt_room";
|
platform = "mqtt_room";
|
||||||
state_topic = "espresense/devices/${device_id}";
|
state_topic = if hasPrefix "!secret" device_id
|
||||||
|
then "${device_id}-topic"
|
||||||
|
else "espresense/devices/${device_id}";
|
||||||
} // args;
|
} // args;
|
||||||
in [
|
in [
|
||||||
(mkESPresenceBeacon {
|
(mkESPresenceBeacon {
|
||||||
device_id = "!secret iphone-se-irk";
|
device_id = "!secret iphone-se-irk";
|
||||||
state_topic = "!secret iphone-se-irk-topic";
|
|
||||||
name = "iPhone SE";
|
name = "iPhone SE";
|
||||||
timeout = 2;
|
timeout = 2;
|
||||||
away_timeout = 120;
|
away_timeout = 120;
|
||||||
})
|
})
|
||||||
|
(mkESPresenceBeacon {
|
||||||
|
device_id = "!secret companion-pixel6";
|
||||||
|
name = "Kat's Pixel 6";
|
||||||
|
timeout = 5;
|
||||||
|
away_timeout = 120;
|
||||||
|
})
|
||||||
(mkESPresenceBeacon {
|
(mkESPresenceBeacon {
|
||||||
device_id = "name:galaxy-watch-active";
|
device_id = "name:galaxy-watch-active";
|
||||||
name = "Galaxy Watch Active";
|
name = "Galaxy Watch Active";
|
||||||
|
|
@ -331,17 +366,14 @@ in {
|
||||||
})
|
})
|
||||||
(mkESPresenceBeacon {
|
(mkESPresenceBeacon {
|
||||||
device_id = "!secret tile-bee";
|
device_id = "!secret tile-bee";
|
||||||
state_topic = "!secret tile-bee-topic";
|
|
||||||
name = "Bee";
|
name = "Bee";
|
||||||
})
|
})
|
||||||
(mkESPresenceBeacon {
|
(mkESPresenceBeacon {
|
||||||
device_id = "!secret tile-kat-wallet";
|
device_id = "!secret tile-kat-wallet";
|
||||||
state_topic = "!secret tile-kat-wallet-topic";
|
|
||||||
name = "Kat's Wallet";
|
name = "Kat's Wallet";
|
||||||
})
|
})
|
||||||
(mkESPresenceBeacon {
|
(mkESPresenceBeacon {
|
||||||
device_id = "!secret tile-kat-keys";
|
device_id = "!secret tile-kat-keys";
|
||||||
state_topic = "!secret tile-kat-keys-topic";
|
|
||||||
name = "Girlwife";
|
name = "Girlwife";
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue