stockholm/makefu/2configs/ham/default.nix

160 lines
3.9 KiB
Nix
Raw Normal View History

{ pkgs, lib, config, ... }:
# Ideas:
## wake-on-lan server
2020-02-04 17:26:59 +00:00
##
2018-09-13 20:29:29 +00:00
let
prefix = (import ./lib).prefix;
2020-02-24 15:55:34 +00:00
firetv_stick = "192.168.1.24";
2019-03-06 15:42:52 +00:00
hassdir = "/var/lib/hass";
2018-09-13 20:29:29 +00:00
in {
2018-09-17 19:52:41 +00:00
imports = [
./mqtt.nix
./zigbee2mqtt/default.nix
# hass config
./zigbee2mqtt/hass.nix
# ./multi/flurlicht.nix
./multi/kurzzeitwecker.nix
./multi/the_playlist.nix
2020-12-30 10:02:21 +00:00
# ./multi/fliegen-couter.nix
2020-11-18 22:57:59 +00:00
./device_tracker/openwrt.nix
2020-11-18 22:57:59 +00:00
./sensor/outside.nix
2020-11-18 22:57:59 +00:00
./calendar/nextcloud.nix
2020-11-18 22:57:59 +00:00
./automation/firetv_restart.nix
2020-11-19 00:39:10 +00:00
./automation/light_buttons.nix
2020-12-30 10:02:21 +00:00
./automation/wohnzimmer_rf_fernbedienung.nix
./automation/giesskanne.nix
./automation/urlaub.nix
2020-11-18 22:57:59 +00:00
2020-12-30 10:02:21 +00:00
./light/arbeitszimmer.nix
./light/schlafzimmer.nix
./light/wohnzimmer.nix
2018-09-17 19:52:41 +00:00
];
2019-03-06 15:42:52 +00:00
2018-09-13 20:29:29 +00:00
services.home-assistant = {
config = {
2020-09-16 20:24:12 +00:00
influxdb = {
database = "ham";
2020-10-23 19:22:32 +00:00
host = "localhost";
2020-09-16 20:24:12 +00:00
tags = {
instance = "omo";
source = "hass";
};
};
config = {};
2018-09-13 20:29:29 +00:00
homeassistant = {
name = "Home"; time_zone = "Europe/Berlin";
latitude = "48.7687";
longitude = "9.2478";
elevation = 247;
2018-09-13 20:29:29 +00:00
};
discovery = {};
conversation = {};
history = {};
logbook = {};
2020-03-13 09:41:23 +00:00
logger = {
default = "info";
};
rest_command = {};
tts = [
2020-02-04 17:26:59 +00:00
{ platform = "google_translate";
language = "de";
time_memory = 57600;
service_name = "google_say";
}
];
2020-10-23 19:22:32 +00:00
api = {};
esphome = {};
camera = [];
2020-02-04 17:26:59 +00:00
telegram_bot = [
# secrets file: {
# "platform": "broadcast",
# "api_key": "", # talk to Botfather /newbot
# "allowed_chat_ids": [ ID ] # curl -X GET # https://api.telegram.org/bot<YOUR_API_TOKEN>/getUpdates
# }
2020-02-04 17:26:59 +00:00
(builtins.fromJSON
(builtins.readFile <secrets/hass/telegram-bot.json>))
];
notify = [
{
platform = "kodi";
name = "wohnzimmer";
2020-02-24 15:55:34 +00:00
host = firetv_stick;
2020-02-04 17:26:59 +00:00
}
{
platform = "telegram";
name = "telegrambot";
chat_id = builtins.elemAt
(builtins.fromJSON (builtins.readFile
<secrets/hass/telegram-bot.json>)).allowed_chat_ids 0;
}
];
sun.elevation = 247;
recorder = {};
2018-09-13 20:29:29 +00:00
media_player = [
{ platform = "FireTV Stick kodi";
2020-02-24 15:55:34 +00:00
host = firetv_stick;
2018-09-13 20:29:29 +00:00
}
2020-02-24 15:55:34 +00:00
{ platform = "androidtv";
2019-03-06 15:42:52 +00:00
name = "FireTV Stick";
2020-02-24 15:55:34 +00:00
device_class = "firetv";
# adb_server_ip = firetv_stick;
host = firetv_stick;
port = 5555;
2019-03-06 15:42:52 +00:00
}
2018-09-13 20:29:29 +00:00
];
mqtt = {
broker = "localhost";
discovery = true; #enable esphome discovery
discovery_prefix = "homeassistant";
port = 1883;
client_id = "home-assistant";
username = "hass";
password = lib.removeSuffix "\n" (builtins.readFile <secrets/mqtt/hass>);
keepalive = 60;
protocol = 3.1;
birth_message = {
2020-02-04 17:26:59 +00:00
topic = "${prefix}/hass/tele/LWT";
payload = "Online";
qos = 1;
retain = true;
};
will_message = {
2020-02-04 17:26:59 +00:00
topic = "${prefix}/hass/tele/LWT";
payload = "Offline";
qos = 1;
retain = true;
};
};
2020-02-24 15:55:34 +00:00
luftdaten = {
show_on_map = true;
2020-09-16 20:24:12 +00:00
sensor_id = 10529;
2020-02-24 15:55:34 +00:00
sensors.monitored_conditions = [ "P1" "P2" ];
};
#binary_sensor =
# flurlicht.binary_sensor;
2018-09-13 20:29:29 +00:00
sensor = [
2020-02-24 15:55:34 +00:00
{ platform = "speedtest";
monitored_conditions = [ "ping" "download" "upload" ];
}
2018-09-13 20:29:29 +00:00
# https://www.home-assistant.io/cookbook/automation_for_rainy_days/
];
2018-09-13 20:29:29 +00:00
frontend = { };
http = { };
switch = [];
automation = [];
script = { };
2018-09-13 20:29:29 +00:00
};
enable = true;
2019-03-06 15:42:52 +00:00
configDir = hassdir;
2018-09-13 20:29:29 +00:00
};
2020-09-16 20:24:12 +00:00
state = [ "/var/lib/hass/known_devices.yaml" ];
2018-09-13 20:29:29 +00:00
}