summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/deployment/bureautomation
diff options
context:
space:
mode:
authorlassulus <lass@blue.r>2018-09-18 15:47:03 +0200
committerlassulus <lass@blue.r>2018-09-18 15:47:03 +0200
commit245994cc7ace5a323c476ccc50fd4026b9353dc4 (patch)
treecf4a3d85c768bd1ca18913d17c67e07bcab95db7 /makefu/2configs/deployment/bureautomation
parent1466d3e86abc4d85af6efe5a964df788cf0e36cc (diff)
parent8a756c7333e0e7c4a0433d68775f8d7c1a53b8b0 (diff)
Merge remote-tracking branch 'gum/master'
Diffstat (limited to 'makefu/2configs/deployment/bureautomation')
-rw-r--r--makefu/2configs/deployment/bureautomation/hass.nix88
1 files changed, 42 insertions, 46 deletions
diff --git a/makefu/2configs/deployment/bureautomation/hass.nix b/makefu/2configs/deployment/bureautomation/hass.nix
index d5793f886..4605e8933 100644
--- a/makefu/2configs/deployment/bureautomation/hass.nix
+++ b/makefu/2configs/deployment/bureautomation/hass.nix
@@ -1,48 +1,43 @@
{ pkgs, lib, ... }:
let
- tasmota_plug = name: topic: {
- platform = "mqtt";
- inherit name;
- 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;
- };
+ tasmota_plug = name: topic:
+ { platform = "mqtt";
+ inherit name;
+ state_topic = "/bam/${topic}/stat/POWER1";
+ command_topic = "/bam/${topic}/cmnd/POWER1";
+ availability_topic = "/bam/${topic}/tele/LWT";
+ payload_on= "ON";
+ payload_off= "OFF";
+ payload_available= "Online";
+ payload_not_available= "Offline";
+ };
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";
- }
- ];
+ { platform = "mqtt";
+ name = "${name} DHT22 Temperature";
+ device_class = "temperature";
+ state_topic = "/bam/${name}/dht22/Temperature";
+ availability_topic = "/bam/${name}/tele/LWT";
+ payload_available = "Online";
+ payload_not_available = "Offline";
+ }
+ { platform = "mqtt";
+ device_class = "humidity";
+ name = "${name} DHT22 Humidity";
+ state_topic = "/bam/${name}/dht22/Humidity";
+ availability_topic = "/bam/${name}/tele/LWT";
+ payload_available = "Online";
+ payload_not_available = "Offline";
+ }];
+ espeasy_ds18 = name:
+ { platform = "mqtt";
+ name = "${name} DS18 Temperature";
+ state_topic = "/bam/${name}/ds18/Temperature";
+ availability_topic = "/bam/${name}/tele/LWT";
+ payload_available = "Online";
+ payload_not_available = "Offline";
+ };
in {
-
+ networking.firewall.allowedTCPPorts = [ 8123 ];
nixpkgs.config.permittedInsecurePackages = [
"homeassistant-0.65.5"
];
@@ -81,18 +76,19 @@ in {
(tasmota_plug "Pluggy" "plug4")
];
binary_sensor = [
- { # esp_easy
- platform = "mqtt";
+ { platform = "mqtt";
device_class = "motion";
+ name = "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";
+ availability_topic = "/bam/easy2/tele/LWT";
+ payload_available = "Online";
+ payload_not_available = "Offline";
}
];
sensor =
+ (espeasy_dht22 "easy1") ++
(espeasy_dht22 "easy2") ++
[ (espeasy_ds18 "easy3" )
{ platform = "luftdaten";