summaryrefslogtreecommitdiffstats
path: root/lass/2configs/hass
diff options
context:
space:
mode:
Diffstat (limited to 'lass/2configs/hass')
-rw-r--r--lass/2configs/hass/default.nix4
-rw-r--r--lass/2configs/hass/lib.nix25
-rw-r--r--lass/2configs/hass/rooms/bett.nix2
-rw-r--r--lass/2configs/hass/rooms/essen.nix4
-rw-r--r--lass/2configs/hass/rooms/nass.nix4
5 files changed, 17 insertions, 22 deletions
diff --git a/lass/2configs/hass/default.nix b/lass/2configs/hass/default.nix
index 78379ba1c..3cd6e0ebf 100644
--- a/lass/2configs/hass/default.nix
+++ b/lass/2configs/hass/default.nix
@@ -13,7 +13,9 @@ with import ./lib.nix { inherit lib; };
{ predicate = "-i int0 -p tcp --dport 1883"; target = "ACCEPT"; } # mosquitto
{ predicate = "-i docker0 -p tcp --dport 1883"; target = "ACCEPT"; } # mosquitto
{ predicate = "-i int0 -p tcp --dport 8123"; target = "ACCEPT"; } # hass
+ { predicate = "-i int0 -p tcp --dport 1337"; target = "ACCEPT"; } # hass
{ predicate = "-i retiolum -p tcp --dport 8123"; target = "ACCEPT"; } # hass
+ { predicate = "-i retiolum -p tcp --dport 1337"; target = "ACCEPT"; } # hass frontend
{ predicate = "-i wiregrill -p tcp --dport 8123"; target = "ACCEPT"; } # hass
];
@@ -47,6 +49,7 @@ with import ./lib.nix { inherit lib; };
};
config = {};
sun.elevation = 66;
+ shopping_list = {};
discovery = {};
frontend = {};
mqtt = {
@@ -81,7 +84,6 @@ with import ./lib.nix { inherit lib; };
(tasmota_s20 "Stereo Anlage" "stereo")
];
mobile_app = {};
- hue = {};
weather = [
{
platform = "openweathermap";
diff --git a/lass/2configs/hass/lib.nix b/lass/2configs/hass/lib.nix
index 9281a19ec..1f9f9945d 100644
--- a/lass/2configs/hass/lib.nix
+++ b/lass/2configs/hass/lib.nix
@@ -23,7 +23,7 @@ rec {
};
friendly_names =
- lib.mapAttrs' (n: v: lib.nameValuePair "light.${v}_light" { friendly_name = "l.${n}"; }) lights //
+ lib.mapAttrs' (n: v: lib.nameValuePair "light.${v}" { friendly_name = "l.${n}"; }) lights //
lib.mapAttrs' (n: v: lib.nameValuePair "binary_sensor.${v}_update_available" { friendly_name = "s.${n}_up"; }) switches.dimmer //
lib.mapAttrs' (n: v: lib.nameValuePair "binary_sensor.${v}_update_available" { friendly_name = "i.${n}_up"; }) sensors.movement //
lib.mapAttrs' (n: v: lib.nameValuePair "binary_sensor.${v}_update_available" { friendly_name = "l.${n}_up"; }) lights //
@@ -41,11 +41,11 @@ rec {
lib.mapAttrs' (n: v: lib.nameValuePair "sensor.${v}_illuminance" { friendly_name = "i.${n}_lux"; }) sensors.movement //
{};
- detect_movement = sensor: light: delay:
+ detect_movement = name: sensor: light: delay:
let
- id = "${sensor}_${light}";
+ id = name;
sensor_ = "binary_sensor.${sensor}_occupancy";
- light_ = "light.${light}_light";
+ light_ = "light.${light}";
in {
input_boolean."${id}" = {
};
@@ -71,7 +71,6 @@ rec {
# }
{
alias = "movement reset timer ${id}";
- hide_entity = true;
trigger = {
platform = "state";
entity_id = sensor_;
@@ -87,7 +86,6 @@ rec {
}
{
alias = "movement on ${id}";
- # hide_entity = true;
trigger = {
platform = "state";
entity_id = "binary_sensor.${sensor}_occupancy";
@@ -124,7 +122,6 @@ rec {
}
{
alias = "movement off ${id}";
- hide_entity = true;
trigger = {
platform = "state";
entity_id = sensor_;
@@ -144,7 +141,6 @@ rec {
}
{
alias = "movement override ${id}";
- hide_entity = true;
trigger = {
platform = "state";
entity_id = light_;
@@ -164,7 +160,6 @@ rec {
}
{
alias = "movement expired ${id}";
- hide_entity = true;
trigger = {
platform = "event";
event_type = "timer.finished";
@@ -186,11 +181,10 @@ rec {
];
};
- lightswitch = switch: light: {
+ lightswitch = name: switch: light: {
automation = [
{
- alias = "lightswitch ${switch} turn on light ${light}";
- hide_entity = "true";
+ alias = "lightswitch ${name} turn on";
trigger = {
platform = "mqtt";
topic = "zigbee/${switch}";
@@ -225,15 +219,14 @@ rec {
{
service = "light.turn_on";
data_template = {
- entity_id = "light.${light}_light";
+ entity_id = "light.${light}";
brightness = "{{ trigger.payload_json.brightness }}";
};
}
];
}
{
- alias = "lightswitch ${switch} turn off light ${light}";
- hide_entity = "true";
+ alias = "lightswitch ${name} turn off";
trigger = {
platform = "mqtt";
topic = "zigbee/${switch}";
@@ -254,7 +247,7 @@ rec {
action = {
service = "light.turn_off";
data_template = {
- entity_id = "light.${light}_light";
+ entity_id = "light.${light}";
};
};
}
diff --git a/lass/2configs/hass/rooms/bett.nix b/lass/2configs/hass/rooms/bett.nix
index 48a1f72d7..026c5722c 100644
--- a/lass/2configs/hass/rooms/bett.nix
+++ b/lass/2configs/hass/rooms/bett.nix
@@ -3,7 +3,7 @@ with import ../lib.nix { inherit lib; };
{
services.home-assistant.config = lib.mkMerge [
- (lightswitch switches.dimmer.bett lights.bett)
+ (lightswitch "bett" switches.dimmer.bett lights.bett)
];
# lass.hass.love = {
diff --git a/lass/2configs/hass/rooms/essen.nix b/lass/2configs/hass/rooms/essen.nix
index eeb3d30d2..293935f65 100644
--- a/lass/2configs/hass/rooms/essen.nix
+++ b/lass/2configs/hass/rooms/essen.nix
@@ -3,7 +3,7 @@ with import ../lib.nix { inherit lib; };
{
services.home-assistant.config = lib.mkMerge [
- (detect_movement sensors.movement.essen lights.essen 10)
- (lightswitch switches.dimmer.essen lights.essen)
+ (detect_movement "essen" sensors.movement.essen lights.essen 70)
+ (lightswitch "essen" switches.dimmer.essen lights.essen)
];
}
diff --git a/lass/2configs/hass/rooms/nass.nix b/lass/2configs/hass/rooms/nass.nix
index 7e6298738..b23ba86cd 100644
--- a/lass/2configs/hass/rooms/nass.nix
+++ b/lass/2configs/hass/rooms/nass.nix
@@ -3,8 +3,8 @@ with import ../lib.nix { inherit lib; };
{
services.home-assistant.config = lib.mkMerge [
- (detect_movement sensors.movement.nass lights.nass 100)
- (lightswitch switches.dimmer.nass lights.nass)
+ (detect_movement "nass" sensors.movement.nass lights.nass 100)
+ (lightswitch "nass" switches.dimmer.nass lights.nass)
];
}