totoro: add HA config

This commit is contained in:
Luke Granger-Brown 2022-01-17 04:04:07 +00:00
parent 6276e4b620
commit bd3c7c090e

View file

@ -35,6 +35,89 @@ in {
cast = {}; cast = {};
plex = {}; plex = {};
default_config = {}; default_config = {};
google_assistant = {
project_id = "malden-homeassistant";
service_account = secrets.homeAssistant.googleServiceAccount;
report_state = true;
exposed_domains = [
"light"
];
};
scene = let
bedroomOverhead = x: ({
color_mode = "color_temp";
brightness = 255;
color_temp = 316;
} // x);
bedroomRing = x: ({
color_mode = "color_temp";
brightness = 69;
color_temp = 142;
} // x);
entityDefs = ring: overhead: let o = bedroomOverhead { state = overhead; }; in {
"light.bedside_lamp" = bedroomRing { state = ring; };
"light.overhead_left_1" = o;
"light.overhead_left_2" = o;
"light.overhead_left_3" = o;
"light.overhead_left_4" = o;
"light.overhead_right_1" = o;
"light.overhead_right_2" = o;
"light.overhead_right_3" = o;
"light.overhead_right_4" = o;
};
in [{
name = "Bedroom Reset";
entities = entityDefs "off" "on";
} {
name = "Bedroom Off";
entities = entityDefs "off" "off";
}];
automation = let
base = extra: alias: webhook_id: ({
inherit alias;
trigger = [{
inherit webhook_id;
platform = "webhook";
}];
} // extra);
toggleEntity = entity_id: base {
action = [{
service = "homeassistant.toggle";
target.entity_id = entity_id;
}];
};
playPauseEntity = entity_id: base {
action = [{
service = "media_player.media_play_pause";
target.entity_id = entity_id;
}];
};
scene = scene_entity_id: base {
action = [{
service = "scene.turn_on";
target.entity_id = scene_entity_id;
data.transition = 1.0;
}];
};
in [
(toggleEntity "light.bedroom_lights" "Desk LHS Switch press - toggle room" "flic_desk_lhs")
(scene "scene.bedroom_reset" "Desk LHS Switch hold - reset room" "flic_desk_lhs_hold")
(toggleEntity "light.bedside_lamp" "Desk RHS Switch press - toggle bedside" "flic_desk_rhs")
(toggleEntity "light.bedroom_lights" "Bed LHS Switch press - toggle room" "flic_bed_lhs")
(scene "scene.bedroom_reset" "Bed LHS Switch dblpress - reset room" "flic_bed_lhs_dbl")
(scene "scene.bedroom_off" "Bed LHS Switch dblpress - reset room" "flic_bed_lhs_hold")
(playPauseEntity "media_player.nebula" "Bed RHS Switch press - play/pause nebula" "flic_bed_rhs")
(toggleEntity "light.bedroom_lights" "Bedroom Door Switch press - toggle room" "flic_bedroom_door")
(scene "scene.bedroom_off" "Bedroom Door Switch dblpress - room off" "flic_bedroom_door_dbl")
(scene "scene.bedroom_off" "Bedroom Door Switch hold - room off" "flic_bedroom_door_hold")
];
}; };
lovelaceConfig = { lovelaceConfig = {
title = "117 Malden Road"; title = "117 Malden Road";