ma ham: use new home-assistant merge function

This commit is contained in:
makefu 2020-11-18 22:23:33 +01:00
parent cb0343fa9e
commit a9f82645dc
9 changed files with 350 additions and 339 deletions

View file

@ -7,7 +7,10 @@ let
};
};
sec = seconds: { delay.seconds = seconds; };
in [
in
{
services.home-assistant.config.sensor =
[
{
alias = "Nightly reboot of firetv";
trigger = {
@ -30,4 +33,5 @@ in [
(cmd "RIGHT")
];
}
]
];
}

View file

@ -1,8 +1,13 @@
let
cred = import <secrets/ham/nextcloud-calendar>;
in
{
services.home-assistant.config.calendar =
[
{
platform = "caldav";
inherit (cred) username password;
url = "https://o.euer.krebsco.de/remote.php/dav";
}
];
}

View file

@ -4,39 +4,27 @@
## wake-on-lan server
##
let
upkgs = (import <nixpkgs-unstable> {}).pkgs;
hlib = (import ./lib);
prefix = hlib.prefix;
tasmota = hlib.tasmota;
prefix = (import ./lib).prefix;
firetv_stick = "192.168.1.24";
hassdir = "/var/lib/hass";
zigbee = import ./multi/zigbee2mqtt.nix;
#flurlicht = import ./multi/flurlicht.nix;
kurzzeitwecker = import ./multi/kurzzeitwecker.nix;
firetv_restart = import ./multi/firetv_restart.nix;
the_playlist = import ./multi/the_playlist.nix;
fliegen-counter = import ./multi/fliegen-couter.nix;
# switch
# automation
# binary_sensor
# sensor
# input_select
# timer
in {
imports = [
./mqtt.nix
./zigbee2mqtt/default.nix
# hass config
./zigbee2mqtt/hass.nix
# ./multi/flurlicht.nix
./multi/kurzzeitwecker.nix
./multi/the_playlist.nix
./multi/fliegen-couter.nix
./device_tracker/openwrt.nix
./sensor/outside.nix
./calendar/nextcloud.nix
./automation/firetv_restart.nix
];
services.home-assistant = {
package = (upkgs.home-assistant.overrideAttrs (old: {
doCheck = false;
checkPhase = ":";
installCheckPhase = ":";
})).override {
extraPackages = ps: with ps; [
python-forecastio jsonrpc-async jsonrpc-websocket mpd2 pkgs.picotts androidtv
];
};
config = {
influxdb = {
database = "ham";
@ -48,8 +36,6 @@ in {
};
config = {};
input_select = zigbee.input_select; # dict
timer = zigbee.timer // kurzzeitwecker.timer; # dict
homeassistant = {
name = "Home"; time_zone = "Europe/Berlin";
latitude = "48.7687";
@ -60,12 +46,10 @@ in {
conversation = {};
history = {};
logbook = {};
counter = fliegen-counter.counter;
logger = {
default = "info";
};
rest_command = {}
// the_playlist.rest_command;
rest_command = {};
tts = [
{ platform = "google_translate";
language = "de";
@ -101,7 +85,6 @@ in {
];
sun.elevation = 247;
recorder = {};
device_tracker = (import ./device_tracker/openwrt.nix);
media_player = [
{ platform = "FireTV Stick kodi";
host = firetv_stick;
@ -149,25 +132,12 @@ in {
monitored_conditions = [ "ping" "download" "upload" ];
}
# https://www.home-assistant.io/cookbook/automation_for_rainy_days/
]
++ ((import ./sensor/outside.nix) {inherit lib;})
++ the_playlist.sensor
++ zigbee.sensor ;
];
frontend = { };
calendar = [ (import ./calendar/nextcloud.nix) ];
# light = flurlicht.light;
http = { };
switch = [];
automation = []
++ (import ./automation/firetv_restart.nix)
++ kurzzeitwecker.automation
#++ flurlicht.automation
++ the_playlist.automation
++ fliegen-counter.automation
++ zigbee.automation;
script =
{ }
// kurzzeitwecker.script; # dict
automation = [];
script = { };
};
enable = true;
configDir = hassdir;

View file

@ -1,3 +1,5 @@
{
services.home-assistant.config.device_tracker =
[
{ platform = "luci";
host = "192.168.1.5";
@ -7,4 +9,5 @@
consider_home = 300; # 5 minutes timeout
new_device_defaults.track_new_devices = true;
}
]
];
}

View file

@ -15,7 +15,10 @@ let
data.entity_id = "counter.${for}_fliegen";
}) incr;
};
in {
in
{
services.home-assistant.config =
{
counter = {
felix_fliegen = {};
misa_fliegen = {};
@ -64,4 +67,5 @@ in {
];
}
];
};
}

View file

@ -8,7 +8,9 @@
# notify.telegrambot
let
button = "sensor.zigbee_btn2_click";
in {
in
{
services.home-assistant.config = {
timer.kurzzeitwecker =
{
name = "Zigbee Kurzzeitwecker";
@ -129,4 +131,5 @@ in {
];
}
];
};
}

View file

@ -6,6 +6,8 @@
# rest_command
# automation
# sensor
{
services.home-assistant.config =
{
rest_command = {
good_song = {
@ -80,4 +82,5 @@
};
}
];
};
}

View file

@ -1,4 +1,8 @@
{lib,...}: [
{lib,...}:
{
services.home-assistant.config.sensor =
[
{ platform = "darksky";
api_key = lib.removeSuffix "\n"
(builtins.readFile <secrets/hass/darksky.apikey>);
@ -17,4 +21,5 @@
units = "si" ;
scan_interval = "00:30:00";
}
]
];
}

View file

@ -0,0 +1,14 @@
{
availability_topic: /ham/zigbee/bridge/state
command_topic: /ham/zigbee/flur_arbeitszimmer_osram2/set
- platform: "mqtt"
state_topic: "zigbee2mqtt/<FRIENDLY_NAME>"
availability_topic: "zigbee2mqtt/bridge/state"
payload_on: true
payload_off: false
value_template: "{{ value_json.battery_low}}"
device_class: "battery"
}