2020-04-08 16:43:09 +02:00
|
|
|
{ pkgs, config, lib, ... }:
|
|
|
|
let unstablePkgs = import <nixpkgs-unstable> { };
|
|
|
|
in {
|
|
|
|
|
|
|
|
imports = [
|
|
|
|
#./home-assistant/mpd.nix
|
|
|
|
#./home-assistant/timer.nix
|
2020-06-01 04:12:15 +02:00
|
|
|
./home-assistant/light-control.nix
|
2020-04-17 20:59:12 +02:00
|
|
|
./home-assistant/chaospott.nix
|
2020-04-10 11:36:58 +02:00
|
|
|
./home-assistant/kodi.nix
|
2020-04-12 13:36:15 +02:00
|
|
|
./home-assistant/mqtt.nix
|
|
|
|
./home-assistant/sonoff.nix
|
2020-04-17 20:59:12 +02:00
|
|
|
./home-assistant/stocks.nix
|
2020-04-12 13:36:15 +02:00
|
|
|
./home-assistant/weather.nix
|
|
|
|
./home-assistant/workday.nix
|
2020-04-10 13:50:20 +02:00
|
|
|
./home-assistant/zigbee2mqtt.nix
|
2020-04-08 16:43:09 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
services.homeAssistantConfig = {
|
|
|
|
|
|
|
|
# turn on to edit GUI
|
2020-06-01 23:20:15 +02:00
|
|
|
lovelace = { };
|
2020-04-08 16:43:09 +02:00
|
|
|
|
|
|
|
homeassistant = {
|
2020-06-01 23:20:15 +02:00
|
|
|
|
|
|
|
name = "Home";
|
2020-04-08 16:43:09 +02:00
|
|
|
latitude = 51.444847;
|
|
|
|
longitude = 6.967006;
|
|
|
|
elevation = 116;
|
2020-06-01 23:20:15 +02:00
|
|
|
unit_system = "metric";
|
2020-04-08 16:43:09 +02:00
|
|
|
|
2020-06-01 23:20:15 +02:00
|
|
|
time_zone = config.time.timeZone;
|
2020-04-08 16:43:09 +02:00
|
|
|
auth_providers = [{
|
|
|
|
type = "trusted_networks";
|
2020-06-11 18:16:18 +02:00
|
|
|
trusted_networks = [
|
|
|
|
config.module.cluster.services.tinc."private".networkSubnet
|
|
|
|
# lan network
|
|
|
|
"10.1.0.0/24"
|
|
|
|
];
|
2020-04-08 16:43:09 +02:00
|
|
|
}];
|
2020-06-01 23:20:15 +02:00
|
|
|
|
2020-04-08 16:43:09 +02:00
|
|
|
};
|
|
|
|
|
2020-06-01 23:20:15 +02:00
|
|
|
# needed, don't know why
|
|
|
|
default_config = { };
|
|
|
|
config = { };
|
|
|
|
|
|
|
|
# to grab metrics via prometheus
|
2020-04-08 16:43:09 +02:00
|
|
|
prometheus.namespace = "hass";
|
|
|
|
|
2020-04-16 02:58:44 +02:00
|
|
|
# manual state
|
|
|
|
# ------------
|
2020-06-01 23:20:15 +02:00
|
|
|
# all scenes
|
|
|
|
input_select.scene = {
|
2020-04-16 01:26:02 +02:00
|
|
|
icon = "mdi:brightness-auto";
|
2020-06-11 12:28:29 +02:00
|
|
|
options = [ "default" "night" "outside" "cooking" ];
|
2020-04-16 01:26:02 +02:00
|
|
|
};
|
2020-06-01 23:20:15 +02:00
|
|
|
# scenes controlled by buttons
|
|
|
|
input_select.scene_button = {
|
|
|
|
icon = "mdi:brightness-auto";
|
|
|
|
options = [ "default" "night" ];
|
|
|
|
};
|
2020-04-16 01:26:02 +02:00
|
|
|
input_boolean.situation_toggle.icon = "mdi:toggle-switch";
|
2020-07-11 18:54:59 +02:00
|
|
|
input_boolean.printer_toggle.icon = "mdi:toggle-switch";
|
2020-04-14 17:29:00 +02:00
|
|
|
|
2020-11-05 00:23:44 +01:00
|
|
|
input_boolean.windows_up.icon = "mdi:toggle-switch";
|
|
|
|
|
|
|
|
# heater scenes
|
2020-11-16 22:04:21 +01:00
|
|
|
input_select.heater_state.options = [ "off" "on1" "on2" ];
|
|
|
|
input_select.heater_state_memory.options = [ "off" "on1" "on2" ];
|
2020-11-05 00:23:44 +01:00
|
|
|
|
2020-06-01 04:12:15 +02:00
|
|
|
automation = [
|
2020-04-17 20:59:12 +02:00
|
|
|
|
2020-07-11 18:54:59 +02:00
|
|
|
{
|
|
|
|
alias = "Hold Button -> Toggle Printer";
|
|
|
|
trigger = {
|
|
|
|
platform = "state";
|
|
|
|
entity_id = "input_boolean.printer_toggle";
|
|
|
|
};
|
|
|
|
action = {
|
|
|
|
service = "switch.toggle";
|
|
|
|
data.entity_id = "switch.pal02";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-04-16 01:26:02 +02:00
|
|
|
{
|
2020-06-11 12:28:29 +02:00
|
|
|
alias = "set light-control scene";
|
2020-04-16 01:26:02 +02:00
|
|
|
trigger = {
|
|
|
|
platform = "state";
|
2020-06-01 23:20:15 +02:00
|
|
|
entity_id = "input_select.scene";
|
2020-04-16 01:26:02 +02:00
|
|
|
};
|
|
|
|
action = {
|
2020-06-01 04:12:15 +02:00
|
|
|
service = "mqtt.publish";
|
2020-06-01 23:20:15 +02:00
|
|
|
data_template = {
|
2020-06-01 04:12:15 +02:00
|
|
|
topic = "control/lights/set";
|
2020-06-01 23:20:15 +02:00
|
|
|
payload_template =
|
|
|
|
''{"scene":"{{ states('input_select.scene')}}"}'';
|
2020-04-16 01:26:02 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
2020-06-01 23:20:15 +02:00
|
|
|
|
|
|
|
# control situation with buttons
|
2020-04-16 01:26:02 +02:00
|
|
|
{
|
2020-06-11 12:28:29 +02:00
|
|
|
alias = "Button -> Change Scene";
|
2020-04-16 01:26:02 +02:00
|
|
|
trigger = {
|
|
|
|
platform = "state";
|
|
|
|
entity_id = "input_boolean.situation_toggle";
|
|
|
|
};
|
|
|
|
action = {
|
2020-06-01 23:20:15 +02:00
|
|
|
service = "input_select.select_next";
|
|
|
|
data.entity_id = "input_select.scene_button";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
{
|
|
|
|
alias = "Button Scene -> Scene";
|
|
|
|
trigger = {
|
|
|
|
platform = "state";
|
|
|
|
entity_id = "input_select.scene_button";
|
|
|
|
};
|
|
|
|
action = {
|
|
|
|
service = "input_select.select_option";
|
|
|
|
data_template = {
|
|
|
|
entity_id = "input_select.scene";
|
|
|
|
option = "{{ states('input_select.scene_button') }}";
|
2020-04-16 01:26:02 +02:00
|
|
|
};
|
|
|
|
};
|
2020-04-16 00:22:29 +02:00
|
|
|
}
|
2020-11-14 00:46:45 +01:00
|
|
|
|
|
|
|
# outside and home
|
2020-05-12 22:52:51 +02:00
|
|
|
{
|
2020-11-16 22:04:21 +01:00
|
|
|
alias = "when opening door I'm outside";
|
2020-05-12 22:52:51 +02:00
|
|
|
trigger = [
|
|
|
|
{
|
|
|
|
platform = "state";
|
2020-06-01 04:12:15 +02:00
|
|
|
# todo : groups are not working right now
|
2020-10-21 22:57:48 +02:00
|
|
|
entity_id = "binary_sensor.door_sensor_4";
|
2020-05-12 22:52:51 +02:00
|
|
|
from = "off";
|
|
|
|
to = "on";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
platform = "state";
|
2020-06-01 04:12:15 +02:00
|
|
|
# todo : groups are not working right now
|
2020-10-21 22:57:48 +02:00
|
|
|
entity_id = "binary_sensor.door_sensor_4";
|
2020-05-12 22:52:51 +02:00
|
|
|
from = "on";
|
|
|
|
to = "off";
|
|
|
|
}
|
|
|
|
];
|
2020-11-16 22:04:21 +01:00
|
|
|
action = [
|
|
|
|
{
|
|
|
|
service = "input_select.select_option";
|
|
|
|
data = {
|
|
|
|
entity_id = "input_select.scene";
|
|
|
|
option = "outside";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
{
|
|
|
|
service = "input_select.select_option";
|
|
|
|
data_template = {
|
|
|
|
entity_id = "input_select.heater_state_memory";
|
|
|
|
option = ''
|
|
|
|
{% if not is_state("input_select.heater_state", "off") %}
|
|
|
|
{{ states('input_select.heater_state') }}
|
|
|
|
{%- else -%}
|
|
|
|
{{ states('input_select.heater_state_memory') }}
|
|
|
|
{%- endif %}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|
|
|
|
{
|
|
|
|
service = "input_select.select_option";
|
|
|
|
data = {
|
|
|
|
entity_id = "input_select.heater_state";
|
|
|
|
option = "off";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
2020-05-12 22:52:51 +02:00
|
|
|
}
|
2020-11-05 00:23:44 +01:00
|
|
|
|
2020-11-14 00:46:45 +01:00
|
|
|
{
|
2020-11-16 22:04:21 +01:00
|
|
|
alias = "reset everything when back home";
|
2020-11-14 00:46:45 +01:00
|
|
|
trigger = map (entity_id: {
|
|
|
|
platform = "state";
|
|
|
|
entity_id = entity_id;
|
|
|
|
from = "off";
|
|
|
|
to = "on";
|
|
|
|
}) [
|
|
|
|
"binary_sensor.motion_sensor_1"
|
|
|
|
"binary_sensor.motion_sensor_2"
|
|
|
|
"binary_sensor.motion_sensor_3"
|
|
|
|
"binary_sensor.motion_sensor_4"
|
|
|
|
"binary_sensor.motion_sensor_5"
|
|
|
|
"binary_sensor.motion_sensor_6"
|
|
|
|
"binary_sensor.motion_sensor_7"
|
|
|
|
"binary_sensor.motion_sensor_8"
|
|
|
|
];
|
|
|
|
condition = {
|
|
|
|
condition = "template";
|
|
|
|
value_template =
|
|
|
|
''{{ states.input_select.scene.state == "outside" }}'';
|
|
|
|
};
|
2020-11-16 22:04:21 +01:00
|
|
|
action = [
|
|
|
|
{
|
|
|
|
service = "input_select.select_option";
|
|
|
|
data = {
|
|
|
|
entity_id = "input_select.scene";
|
|
|
|
option = "default";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
{
|
|
|
|
service = "input_select.select_option";
|
|
|
|
data_template = {
|
|
|
|
entity_id = "input_select.heater_state";
|
|
|
|
option = "{{ states('input_select.heater_state_memory') }}";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
2020-11-14 00:46:45 +01:00
|
|
|
}
|
|
|
|
|
2020-10-28 23:56:10 +01:00
|
|
|
# window roles
|
|
|
|
{
|
2020-11-05 00:23:44 +01:00
|
|
|
alias = "windows state = down in the evening";
|
2020-10-28 23:56:10 +01:00
|
|
|
trigger = [{
|
|
|
|
platform = "sun";
|
|
|
|
event = "sunset";
|
2020-10-30 23:39:40 +01:00
|
|
|
offset = "+00:01:00"; # 10 min after sunset
|
2020-10-28 23:56:10 +01:00
|
|
|
}];
|
2020-11-05 00:23:44 +01:00
|
|
|
action = [{
|
2020-11-05 09:45:08 +01:00
|
|
|
service = "input_boolean.turn_off";
|
|
|
|
data.entity_id = "input_boolean.windows_up";
|
2020-11-05 00:23:44 +01:00
|
|
|
}];
|
2020-10-28 23:56:10 +01:00
|
|
|
}
|
|
|
|
{
|
2020-11-05 00:23:44 +01:00
|
|
|
alias = "windows state = up in the morning";
|
2020-10-28 23:56:10 +01:00
|
|
|
trigger = [{
|
2020-10-30 23:39:40 +01:00
|
|
|
platform = "time";
|
|
|
|
at = "09:00:00";
|
2020-10-28 23:56:10 +01:00
|
|
|
}];
|
2020-11-05 00:23:44 +01:00
|
|
|
action = [{
|
2020-11-05 09:45:08 +01:00
|
|
|
service = "input_boolean.turn_on";
|
|
|
|
data.entity_id = "input_boolean.windows_up";
|
2020-11-05 00:23:44 +01:00
|
|
|
}];
|
|
|
|
}
|
|
|
|
{
|
2020-11-16 22:04:21 +01:00
|
|
|
alias = "handle windows up state";
|
2020-11-05 00:23:44 +01:00
|
|
|
trigger = [
|
2020-11-16 22:04:21 +01:00
|
|
|
#{
|
|
|
|
# platform = "time_pattern";
|
|
|
|
# minutes = "/5"; # every 5 minutes
|
|
|
|
#}
|
2020-10-30 23:39:40 +01:00
|
|
|
{
|
2020-11-05 00:23:44 +01:00
|
|
|
platform = "state";
|
|
|
|
entity_id = "input_boolean.windows_up";
|
2020-10-30 23:39:40 +01:00
|
|
|
}
|
|
|
|
];
|
2020-11-05 00:23:44 +01:00
|
|
|
action = [{
|
|
|
|
service = "script.turn_on";
|
|
|
|
data_template.entity_id = ''
|
|
|
|
{% if is_state('input_boolean.windows_up','on') -%}
|
|
|
|
script.fyrtur_up
|
|
|
|
{%- else -%}
|
|
|
|
script.fyrtur_down
|
|
|
|
{%- endif %}
|
|
|
|
'';
|
|
|
|
}];
|
2020-10-28 23:56:10 +01:00
|
|
|
}
|
2020-11-05 00:23:44 +01:00
|
|
|
|
2020-10-30 23:39:40 +01:00
|
|
|
# heater
|
2020-10-28 23:56:10 +01:00
|
|
|
{
|
2020-11-05 00:23:44 +01:00
|
|
|
alias = "heater state = on1 in the morning";
|
2020-10-28 23:56:10 +01:00
|
|
|
trigger = [{
|
2020-10-30 23:39:40 +01:00
|
|
|
platform = "time";
|
|
|
|
at = "09:00:00";
|
2020-10-28 23:56:10 +01:00
|
|
|
}];
|
2020-11-16 22:04:21 +01:00
|
|
|
action = [
|
|
|
|
{
|
|
|
|
service = "input_select.select_option";
|
|
|
|
data = {
|
|
|
|
entity_id = "input_select.heater_state";
|
|
|
|
option = "on1";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
{
|
|
|
|
service = "input_select.select_option";
|
|
|
|
data = {
|
|
|
|
entity_id = "input_select.heater_state_memory";
|
|
|
|
option = "on1";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
2020-10-28 23:56:10 +01:00
|
|
|
}
|
2020-10-30 00:36:00 +01:00
|
|
|
{
|
2020-11-05 00:23:44 +01:00
|
|
|
alias = "heater state = on2 in the early evening";
|
2020-10-30 00:36:00 +01:00
|
|
|
trigger = [{
|
|
|
|
platform = "time";
|
2020-11-12 20:04:01 +01:00
|
|
|
at = "22:30:00";
|
2020-10-30 00:36:00 +01:00
|
|
|
}];
|
2020-11-16 22:04:21 +01:00
|
|
|
action = [
|
|
|
|
{
|
|
|
|
service = "input_select.select_option";
|
|
|
|
data = {
|
|
|
|
entity_id = "input_select.heater_state";
|
|
|
|
option = "on2";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
{
|
|
|
|
service = "input_select.select_option";
|
|
|
|
data = {
|
|
|
|
entity_id = "input_select.heater_state_memory";
|
|
|
|
option = "on2";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
2020-10-30 00:36:00 +01:00
|
|
|
}
|
|
|
|
{
|
2020-11-05 00:23:44 +01:00
|
|
|
alias = "heater state = off in the evening";
|
2020-10-30 00:36:00 +01:00
|
|
|
trigger = [{
|
|
|
|
platform = "time";
|
2020-11-05 00:23:44 +01:00
|
|
|
at = "23:30:00";
|
2020-10-30 00:36:00 +01:00
|
|
|
}];
|
2020-11-16 22:04:21 +01:00
|
|
|
action = [
|
|
|
|
{
|
|
|
|
service = "input_select.select_option";
|
|
|
|
data = {
|
|
|
|
entity_id = "input_select.heater_state";
|
|
|
|
option = "off";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
{
|
|
|
|
service = "input_select.select_option";
|
|
|
|
data = {
|
|
|
|
entity_id = "input_select.heater_state_memory";
|
|
|
|
option = "off";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
2020-11-05 00:23:44 +01:00
|
|
|
}
|
|
|
|
{
|
2020-11-16 22:04:21 +01:00
|
|
|
alias = "handle heater state";
|
2020-11-05 00:23:44 +01:00
|
|
|
trigger = [
|
2020-10-30 00:36:00 +01:00
|
|
|
{
|
2020-11-05 00:23:44 +01:00
|
|
|
platform = "time_pattern";
|
2020-11-16 22:04:21 +01:00
|
|
|
minutes = "/10"; # every 5 minutes
|
2020-10-30 00:36:00 +01:00
|
|
|
}
|
|
|
|
{
|
2020-11-05 00:23:44 +01:00
|
|
|
platform = "state";
|
|
|
|
entity_id = "input_select.heater_state";
|
2020-10-30 00:36:00 +01:00
|
|
|
}
|
|
|
|
];
|
2020-11-05 00:23:44 +01:00
|
|
|
action = [{
|
|
|
|
service = "script.turn_on";
|
|
|
|
data_template.entity_id =
|
|
|
|
"script.heater_{{ states('input_select.heater_state') }}";
|
|
|
|
}];
|
2020-10-30 00:36:00 +01:00
|
|
|
}
|
2020-05-03 18:22:28 +02:00
|
|
|
];
|
2020-04-08 16:43:09 +02:00
|
|
|
|
2020-04-14 11:38:40 +02:00
|
|
|
group = let
|
2020-04-14 17:49:09 +02:00
|
|
|
create_room = { name, description }: {
|
2020-04-14 11:38:40 +02:00
|
|
|
"${name}" = {
|
2020-04-16 00:22:29 +02:00
|
|
|
name = "${description}";
|
2020-04-15 18:08:27 +02:00
|
|
|
entities = [ ];
|
2020-04-14 11:38:40 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
create_rooms = rooms:
|
|
|
|
lib.foldr (a: b: a // b) { } (map create_room rooms);
|
2020-04-12 21:05:55 +02:00
|
|
|
# rooms
|
|
|
|
# -----
|
2020-04-14 11:38:40 +02:00
|
|
|
in (create_rooms [
|
|
|
|
{
|
|
|
|
name = "floor_room";
|
|
|
|
description = "Flur";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "bed_room";
|
|
|
|
description = "Schlafzimmer";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "living_room";
|
|
|
|
description = "Wohnzimmer";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "kitchen_room";
|
|
|
|
description = "Küche";
|
|
|
|
}
|
2020-04-15 18:08:27 +02:00
|
|
|
{
|
|
|
|
name = "bath_room";
|
|
|
|
description = "Klo";
|
|
|
|
}
|
2020-04-14 11:38:40 +02:00
|
|
|
]) // {
|
2020-05-06 22:35:31 +02:00
|
|
|
|
2020-04-12 21:05:55 +02:00
|
|
|
# overview
|
|
|
|
# --------
|
2020-06-01 23:20:15 +02:00
|
|
|
all_sensors = { name = "Alle Sensoren"; };
|
2020-04-12 21:05:55 +02:00
|
|
|
today = {
|
|
|
|
name = "Today";
|
2020-06-01 23:20:15 +02:00
|
|
|
entities = [ "input_select.scene" ];
|
2020-04-12 19:57:49 +02:00
|
|
|
};
|
2020-04-12 21:05:55 +02:00
|
|
|
# other stuff
|
|
|
|
# -----------
|
2020-06-01 23:20:15 +02:00
|
|
|
tv = { name = "TV"; };
|
|
|
|
all_lights = { name = "Alle Lampen"; };
|
2020-04-12 21:05:55 +02:00
|
|
|
unknown = {
|
|
|
|
name = "Not Used";
|
2020-04-12 21:42:11 +02:00
|
|
|
entities = [ ];
|
2020-04-08 16:43:09 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2020-11-05 00:23:44 +01:00
|
|
|
script = let
|
|
|
|
# delay in seconds
|
|
|
|
delay = 2;
|
|
|
|
|
|
|
|
heater_on = heater: temperatur: {
|
|
|
|
service = "mqtt.publish";
|
|
|
|
data_template = {
|
|
|
|
topic = "zigbee2mqtt/${heater}/set"; # office
|
|
|
|
payload_template = ''
|
|
|
|
{"system_mode":"auto","current_heating_setpoint":${
|
|
|
|
toString temperatur
|
|
|
|
}}'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
heater_off = heater: {
|
|
|
|
service = "mqtt.publish";
|
|
|
|
data_template = {
|
|
|
|
topic = "zigbee2mqtt/${heater}/set"; # office
|
|
|
|
payload_template = ''{"system_mode":"off"}'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-11-29 21:51:16 +01:00
|
|
|
hot = 24;
|
2020-11-05 00:23:44 +01:00
|
|
|
cold = 19;
|
|
|
|
|
|
|
|
fyrtur_command = device: position: {
|
|
|
|
service = "mqtt.publish";
|
|
|
|
data_template = {
|
|
|
|
topic = "zigbee2mqtt/${device}/set";
|
|
|
|
payload_template = ''{"position":"${toString position}"}'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
in {
|
|
|
|
heater_off = {
|
|
|
|
sequence = [
|
2020-11-11 14:40:37 +01:00
|
|
|
(heater_on "heater1" 5) # office
|
2020-11-05 00:23:44 +01:00
|
|
|
{ delay = delay; }
|
2020-11-11 14:40:37 +01:00
|
|
|
(heater_on "heater2" 5) # office
|
2020-11-05 00:23:44 +01:00
|
|
|
{ delay = delay; }
|
2020-11-11 14:40:37 +01:00
|
|
|
(heater_on "heater3" 5) # bed room
|
2020-11-05 00:23:44 +01:00
|
|
|
{ delay = delay; }
|
2020-11-11 14:40:37 +01:00
|
|
|
(heater_on "heater4" 5) # storage room
|
2020-11-05 00:23:44 +01:00
|
|
|
];
|
|
|
|
};
|
|
|
|
heater_on1 = {
|
|
|
|
sequence = [
|
|
|
|
(heater_on "heater1" hot) # office
|
|
|
|
{ delay = delay; }
|
|
|
|
(heater_on "heater2" hot) # office
|
|
|
|
{ delay = delay; }
|
|
|
|
(heater_on "heater3" cold) # bed room
|
|
|
|
{ delay = delay; }
|
|
|
|
(heater_on "heater4" cold) # storage room
|
|
|
|
];
|
|
|
|
};
|
|
|
|
heater_on2 = {
|
|
|
|
sequence = [
|
|
|
|
(heater_on "heater1" hot) # office
|
|
|
|
{ delay = delay; }
|
|
|
|
(heater_on "heater2" hot) # office
|
|
|
|
{ delay = delay; }
|
|
|
|
(heater_on "heater3" hot) # bed room
|
|
|
|
{ delay = delay; }
|
|
|
|
(heater_on "heater4" cold) # storage room
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
fyrtur_up = {
|
|
|
|
sequence = [
|
2020-11-10 18:21:30 +01:00
|
|
|
(fyrtur_command "fyrtur1" 100)
|
2020-11-05 00:23:44 +01:00
|
|
|
{ delay = delay; }
|
2020-11-10 18:21:30 +01:00
|
|
|
(fyrtur_command "fyrtur2" 100)
|
2020-11-05 00:23:44 +01:00
|
|
|
{ delay = delay; }
|
2020-11-05 09:45:08 +01:00
|
|
|
(fyrtur_command "fyrtur3" 100)
|
2020-11-05 00:23:44 +01:00
|
|
|
{ delay = delay; }
|
2020-11-05 09:45:08 +01:00
|
|
|
(fyrtur_command "fyrtur4" 100)
|
2020-11-05 00:23:44 +01:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
fyrtur_down = {
|
|
|
|
sequence = [
|
2020-11-05 09:45:08 +01:00
|
|
|
(fyrtur_command "fyrtur1" 16)
|
2020-11-05 00:23:44 +01:00
|
|
|
{ delay = delay; }
|
2020-11-05 09:45:08 +01:00
|
|
|
(fyrtur_command "fyrtur2" 16)
|
2020-11-05 00:23:44 +01:00
|
|
|
{ delay = delay; }
|
2020-11-05 09:45:08 +01:00
|
|
|
(fyrtur_command "fyrtur3" 22)
|
2020-11-05 00:23:44 +01:00
|
|
|
{ delay = delay; }
|
2020-11-05 09:45:08 +01:00
|
|
|
(fyrtur_command "fyrtur4" 22)
|
2020-11-05 00:23:44 +01:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2020-04-08 16:43:09 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
services.home-assistant = {
|
|
|
|
enable = true;
|
2020-06-01 23:20:15 +02:00
|
|
|
#package = unstablePkgs.home-assistant.override {
|
|
|
|
# python3 = unstablePkgs.python37;
|
|
|
|
# extraPackages = python: [
|
|
|
|
# # todo : check which is still needed
|
|
|
|
# python.netdisco
|
|
|
|
# python.xmltodict
|
|
|
|
# python.mpd2
|
|
|
|
# # for mqtt
|
|
|
|
# python.hbmqtt
|
|
|
|
# python.paho-mqtt
|
|
|
|
# # needed for platform workday
|
|
|
|
# #(python.buildPythonPackage rec {
|
|
|
|
# # pname = "holidays";
|
|
|
|
# # version = "0.9.10";
|
|
|
|
# # src = python.fetchPypi {
|
|
|
|
# # inherit pname version;
|
|
|
|
# # sha256 =
|
|
|
|
# # "9f06d143eb708e8732230260636938f2f57114e94defd8fa2082408e0d422d6f";
|
|
|
|
# # };
|
|
|
|
# # doCheck = false;
|
|
|
|
# # buildInputs = [ pkgs.dateutils ];
|
|
|
|
# # propagatedBuildInputs = [ python."python-dateutil" python."six" ];
|
|
|
|
# # meta = with pkgs.stdenv.lib; {
|
|
|
|
# # homepage = "https://github.com/dr-prodigy/python-holidays";
|
|
|
|
# # license = licenses.mit;
|
|
|
|
# # description = "Generate and work with holidays in Python";
|
|
|
|
# # maintainers = with maintainers; [ mrVanDalo ];
|
|
|
|
# # };
|
|
|
|
# #})
|
|
|
|
# ];
|
|
|
|
#};
|
2020-04-08 16:43:09 +02:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2020-04-09 01:19:00 +02:00
|
|
|
# host nginx setup
|
|
|
|
services.nginx = {
|
|
|
|
enable = true;
|
|
|
|
recommendedProxySettings = true;
|
|
|
|
virtualHosts = {
|
|
|
|
"iot.pepe.private" = {
|
2020-04-09 16:51:39 +02:00
|
|
|
serverAliases = [ "hass.pepe.private" "home.pepe.private" ];
|
|
|
|
locations."/" = { proxyPass = "http://pepe.private:8123"; };
|
2020-04-09 01:19:00 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-04-08 16:43:09 +02:00
|
|
|
}
|