ma hass: rewrite
This commit is contained in:
parent
f04992a020
commit
2e7c5d0849
|
@ -50,6 +50,7 @@ in {
|
||||||
|
|
||||||
|
|
||||||
<stockholm/makefu/2configs/deployment/bureautomation>
|
<stockholm/makefu/2configs/deployment/bureautomation>
|
||||||
|
<stockholm/makefu/2configs/deployment/bureautomation/hass.nix>
|
||||||
(let
|
(let
|
||||||
collectd-port = 25826;
|
collectd-port = 25826;
|
||||||
influx-port = 8086;
|
influx-port = 8086;
|
||||||
|
|
|
@ -1,75 +1,125 @@
|
||||||
{ pkgs, lib, ... }:
|
{ pkgs, lib, ... }:
|
||||||
let
|
let
|
||||||
firetv = "192.168.1.238";
|
tasmota_plug = name: topic: {
|
||||||
in {
|
platform = "mqtt";
|
||||||
imports = [
|
inherit name;
|
||||||
<nixpkgs-unstable/nixos/modules/services/misc/home-assistant.nix>
|
state_topic = "/bam/${topic}/stat/POWER";
|
||||||
|
command_topic = "/bam/${topic}/cmnd/POWER";
|
||||||
|
availability_topic = "/bam/${topic}/tele/LWT";
|
||||||
|
qos = 1;
|
||||||
|
payload_on= "ON";
|
||||||
|
payload_off= "OFF";
|
||||||
|
payload_available= "Online";
|
||||||
|
payload_not_available= "Offline";
|
||||||
|
retain= false;
|
||||||
|
};
|
||||||
|
espeasy_dht22 = name: [
|
||||||
|
{
|
||||||
|
platform = "mqtt";
|
||||||
|
device_class = "temperature";
|
||||||
|
state_topic = "/bam/${name}/dht22/Temperature";
|
||||||
|
availability_topic = "/bam/${name}/status/LWT";
|
||||||
|
payload_available = "Connected";
|
||||||
|
payload_not_available = "Connection Lost";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
platform = "mqtt";
|
||||||
|
device_class = "humidity";
|
||||||
|
state_topic = "/bam/${name}/dht22/Temperature";
|
||||||
|
unit_of_measurement = "C";
|
||||||
|
availability_topic = "/bam/${name}/status/LWT";
|
||||||
|
payload_available = "Connected";
|
||||||
|
payload_not_available = "Connection Lost";
|
||||||
|
}];
|
||||||
|
espeasy_ds18 = name: [
|
||||||
|
{
|
||||||
|
platform = "mqtt";
|
||||||
|
device_class = "temperature";
|
||||||
|
state_topic = "/bam/${name}/ds18/Temperature";
|
||||||
|
availability_topic = "/bam/${name}/status/LWT";
|
||||||
|
payload_available = "Connected";
|
||||||
|
payload_not_available = "Connection Lost";
|
||||||
|
}
|
||||||
];
|
];
|
||||||
systemd.services.firetv = {
|
in {
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
serviceConfig = {
|
nixpkgs.config.permittedInsecurePackages = [
|
||||||
User = "nobody";
|
"homeassistant-0.65.5"
|
||||||
ExecStart = "${pkgs.python-firetv}/bin/firetv-server -d ${firetv}:5555";
|
];
|
||||||
};
|
|
||||||
};
|
|
||||||
nixpkgs.config.packageOverrides = oldpkgs: {
|
|
||||||
home-assistant = (import <nixpkgs-unstable> {}).home-assistant;
|
|
||||||
};
|
|
||||||
ids.uids.hass = 286;
|
|
||||||
ids.gids.hass = 286;
|
|
||||||
services.home-assistant = {
|
services.home-assistant = {
|
||||||
#panel_iframe:
|
|
||||||
#configurator:
|
|
||||||
# title: Configurator
|
|
||||||
# icon: mdi:wrench
|
|
||||||
# url: http://hassio.local:3218
|
|
||||||
# sensor:
|
|
||||||
# - platform: random
|
|
||||||
enable = true;
|
enable = true;
|
||||||
config = {
|
config = {
|
||||||
homeassistant = {
|
homeassistant = {
|
||||||
name = "Bureautomation";
|
name = "Bureautomation";
|
||||||
time_zone = "Europe/Berlin";
|
time_zone = "Europe/Berlin";
|
||||||
};
|
};
|
||||||
panel_iframe = {
|
|
||||||
euer_blog = {
|
mqtt = {
|
||||||
title = "Euer Blog";
|
broker = "localhost";
|
||||||
icon = "mdi:wrench";
|
port = 1883;
|
||||||
url = "https://euer.krebsco.de";
|
client_id = "home-assistant";
|
||||||
|
keepalive = 60;
|
||||||
|
protocol = 3.1;
|
||||||
|
birth_message = {
|
||||||
|
topic = "/bam/hass/tele/LWT";
|
||||||
|
payload = "Online";
|
||||||
|
qos = 1;
|
||||||
|
retain = true;
|
||||||
|
};
|
||||||
|
will_message = {
|
||||||
|
topic = "/bam/hass/tele/LWT";
|
||||||
|
payload = "Offline";
|
||||||
|
qos = 1;
|
||||||
|
retain = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
media_player = [
|
switch = [
|
||||||
{ platform = "kodi";
|
(tasmota_plug "Bauarbeiterlampe" "plug")
|
||||||
host = firetv;
|
(tasmota_plug "Blitzdings" "plug2")
|
||||||
}
|
(tasmota_plug "Fernseher" "plug3")
|
||||||
{ platform = "firetv";
|
(tasmota_plug "Pluggy" "plug4")
|
||||||
# assumes python-firetv running
|
];
|
||||||
|
binary_sensor = [
|
||||||
|
{ # esp_easy
|
||||||
|
platform = "mqtt";
|
||||||
|
device_class = "motion";
|
||||||
|
state_topic = "/bam/easy2/movement/Switch";
|
||||||
|
payload_on = "1";
|
||||||
|
payload_off = "0";
|
||||||
|
availability_topic = "/bam/easy2/status/LWT";
|
||||||
|
payload_available = "Connected";
|
||||||
|
payload_not_available = "Connection Lost";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
sensor = [
|
sensor =
|
||||||
{
|
(espeasy_dht22 "easy2") ++
|
||||||
platform = "luftdaten";
|
[ (espeasy_ds18 "easy3" )
|
||||||
name = "Shack 1";
|
{ platform = "luftdaten";
|
||||||
sensorid = "50";
|
name = "Ditzingen";
|
||||||
monitored_conditions = [ "P1" "P2" ];
|
sensorid = "5341";
|
||||||
}
|
monitored_conditions = [ "P1" "P2" ];
|
||||||
{
|
}
|
||||||
platform = "luftdaten";
|
{ platform = "influxdb";
|
||||||
name = "Shack 2";
|
queries = [
|
||||||
sensorid = "658";
|
{ name = "mean value of feinstaub P1";
|
||||||
monitored_conditions = [ "P1" "P2" ];
|
where = '' "node" = 'esp8266-1355142' '';
|
||||||
}
|
measurement = "feinstaub";
|
||||||
{
|
database = "telegraf";
|
||||||
platform = "luftdaten";
|
field = "P1";
|
||||||
name = "Ditzingen";
|
}
|
||||||
sensorid = "5341";
|
{ name = "mean value of feinstaub P2";
|
||||||
monitored_conditions = [ "P1" "P2" ];
|
where = '' "node" = 'esp8266-1355142' '';
|
||||||
}
|
measurement = "feinstaub";
|
||||||
{ platform = "random"; }
|
database = "telegraf";
|
||||||
];
|
field = "P2";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
frontend = { };
|
frontend = { };
|
||||||
http = { };
|
http = { };
|
||||||
feedreader.urls = [ "https://nixos.org/blogs.xml" ];
|
feedreader.urls = [ "http://www.heise.de/security/rss/news-atom.xml" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
67
2configs/deployment/bureautomation/home.nix
Normal file
67
2configs/deployment/bureautomation/home.nix
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
{ pkgs, lib, ... }:
|
||||||
|
let
|
||||||
|
firetv = "192.168.1.238";
|
||||||
|
in {
|
||||||
|
systemd.services.firetv = {
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
User = "nobody";
|
||||||
|
ExecStart = "${pkgs.python-firetv}/bin/firetv-server -d ${firetv}:5555";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
services.home-assistant = {
|
||||||
|
#panel_iframe:
|
||||||
|
#configurator:
|
||||||
|
# title: Configurator
|
||||||
|
# icon: mdi:wrench
|
||||||
|
# url: http://hassio.local:3218
|
||||||
|
# sensor:
|
||||||
|
# - platform: random
|
||||||
|
enable = true;
|
||||||
|
config = {
|
||||||
|
homeassistant = {
|
||||||
|
name = "Bureautomation";
|
||||||
|
time_zone = "Europe/Berlin";
|
||||||
|
};
|
||||||
|
panel_iframe = {
|
||||||
|
euer_blog = {
|
||||||
|
title = "Euer Blog";
|
||||||
|
icon = "mdi:wrench";
|
||||||
|
url = "https://euer.krebsco.de";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
media_player = [
|
||||||
|
{ platform = "kodi";
|
||||||
|
host = firetv;
|
||||||
|
}
|
||||||
|
{ platform = "firetv";
|
||||||
|
# assumes python-firetv running
|
||||||
|
}
|
||||||
|
];
|
||||||
|
sensor = [
|
||||||
|
{
|
||||||
|
platform = "luftdaten";
|
||||||
|
name = "Shack 1";
|
||||||
|
sensorid = "50";
|
||||||
|
monitored_conditions = [ "P1" "P2" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
platform = "luftdaten";
|
||||||
|
name = "Shack 2";
|
||||||
|
sensorid = "658";
|
||||||
|
monitored_conditions = [ "P1" "P2" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
platform = "luftdaten";
|
||||||
|
name = "Ditzingen";
|
||||||
|
sensorid = "5341";
|
||||||
|
monitored_conditions = [ "P1" "P2" ];
|
||||||
|
}
|
||||||
|
{ platform = "random"; }
|
||||||
|
];
|
||||||
|
frontend = { };
|
||||||
|
http = { };
|
||||||
|
feedreader.urls = [ "https://nixos.org/blogs.xml" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -2,8 +2,8 @@
|
||||||
with import <stockholm/lib>;
|
with import <stockholm/lib>;
|
||||||
let
|
let
|
||||||
shack-announce = pkgs.callPackage (builtins.fetchTarball {
|
shack-announce = pkgs.callPackage (builtins.fetchTarball {
|
||||||
url = "https://github.com/makefu/events-publisher/archive/15fbe5cc6ac9617a08a042870795f9e879d9952a.tar.gz";
|
url = "https://github.com/makefu/events-publisher/archive/5e7b083c63f25182a02c1fddb3d32cb9534fbc50.tar.gz";
|
||||||
sha256 = "1bqp1qdnwx5q1w468zbm57hmpjz3x8if3j29qrqcia0vzks1s37a";
|
sha256 = "1zzlhyj8fr6y3a3b6qlyrm474xxxs1ydqjpkd2jva3g1lnzlmvkp";
|
||||||
}) {} ;
|
}) {} ;
|
||||||
home = "/var/lib/shackannounce";
|
home = "/var/lib/shackannounce";
|
||||||
user = "shackannounce";
|
user = "shackannounce";
|
||||||
|
|
Loading…
Reference in a new issue