summaryrefslogtreecommitdiffstats
path: root/lass/2configs/hass
diff options
context:
space:
mode:
Diffstat (limited to 'lass/2configs/hass')
-rw-r--r--lass/2configs/hass/default.nix56
-rw-r--r--lass/2configs/hass/lib.nix18
-rw-r--r--lass/2configs/hass/zigbee.nix141
3 files changed, 72 insertions, 143 deletions
diff --git a/lass/2configs/hass/default.nix b/lass/2configs/hass/default.nix
index cc8189f51..1745bbfe5 100644
--- a/lass/2configs/hass/default.nix
+++ b/lass/2configs/hass/default.nix
@@ -41,8 +41,7 @@ in {
configWritable = true;
lovelaceConfigWritable = true;
config = let
- tasmota_s20 = name: topic: {
- platform = "mqtt";
+ tasmota = name: topic: {
inherit name;
state_topic = "stat/${topic}/POWER";
command_topic = "cmnd/${topic}/POWER";
@@ -57,7 +56,7 @@ in {
longitude = "13.41489";
elevation = 90;
unit_system = "metric";
- customize = friendly_names;
+ # customize = friendly_names;
};
config = {};
sun.elevation = 66;
@@ -65,36 +64,37 @@ in {
discovery = {};
frontend = {};
http = {};
- mqtt = {
- broker = "localhost";
- port = 1883;
- client_id = "home-assistant";
- username = "gg23";
- password = "gg23-mqtt";
- keepalive = 60;
- protocol = 3.1;
+ # mqtt = {
+ # broker = "localhost";
+ # port = 1883;
+ # client_id = "home-assistant";
+ # username = "gg23";
+ # password = "gg23-mqtt";
+ # keepalive = 60;
+ # protocol = 3.1;
- discovery = true;
- birth_message = {
- topic = "/hass/status";
- payload = "online";
- };
- will_message = {
- topic = "/hass/status";
- payload = "offline";
- };
- };
+ # discovery = true;
+ # birth_message = {
+ # topic = "/hass/status";
+ # payload = "online";
+ # };
+ # will_message = {
+ # topic = "/hass/status";
+ # payload = "offline";
+ # };
+ # };
sensor = [
{
platform = "dwd_weather_warnings";
region_name = "Berlin";
}
];
- switch = [
- (tasmota_s20 "TV" "tv")
- (tasmota_s20 "Drucker Strom" "drucker")
- (tasmota_s20 "Waschmaschine" "wasch")
- (tasmota_s20 "Stereo Anlage" "stereo")
+ mqtt.switch = [
+ (tasmota "TV" "tv")
+ (tasmota "Drucker Strom" "drucker")
+ (tasmota "Waschmaschine" "wasch")
+ (tasmota "Stereo Anlage" "stereo")
+ (tasmota "Wohnzimmer Lampe" "wohn_lampe")
];
mobile_app = {};
weather = [
@@ -106,6 +106,10 @@ in {
system_health = {};
history = {};
shopping_list = {};
+ media_player = {
+ platform = "snapcast";
+ host = "127.0.0.1";
+ };
};
};
diff --git a/lass/2configs/hass/lib.nix b/lass/2configs/hass/lib.nix
index 1f9f9945d..72ff2966f 100644
--- a/lass/2configs/hass/lib.nix
+++ b/lass/2configs/hass/lib.nix
@@ -1,24 +1,24 @@
{ lib, ... }:
rec {
lights = {
- bett = "0x0017880106ed3bd8";
- essen = "0x0017880108327622";
- arbeit = "0x0017880106ee2865";
- nass = "0x00178801082e9f2f";
+ bett = "l_bett";
+ essen = "l_essen";
+ arbeit = "l_arbeit";
+ nass = "l_nass";
};
switches = {
dimmer = {
- bett = "0x00178801086ac38c";
- essen = "0x00178801086ad1fb";
- nass = "0x00178801086ac373";
+ bett = "i_bett";
+ essen = "i_essen";
+ nass = "i_nass";
};
};
sensors = {
movement = {
- essen = "0x0017880106f772f2";
- nass = "0x0017880106f77f30";
+ essen = "s_essen";
+ nass = "s_nass";
};
};
diff --git a/lass/2configs/hass/zigbee.nix b/lass/2configs/hass/zigbee.nix
index 8fc02263b..210c761b5 100644
--- a/lass/2configs/hass/zigbee.nix
+++ b/lass/2configs/hass/zigbee.nix
@@ -34,117 +34,42 @@ in {
advanced = {
pan_id = 4222;
};
- };
- };
+ devices = let
+ set_device = id: name:
+ lib.nameValuePair id {
+ };
+ in {
+ # lights https://www.zigbee2mqtt.io/devices/9290022166.html#philips-9290022166
+ "0x0017880106ed3bd8".friendly_name = "l_bett";
+ "0x0017880108327622".friendly_name = "l_essen";
+ "0x0017880106ee2865".friendly_name = "l_arbeit";
+ "0x00178801082e9f2f".friendly_name = "l_nass";
- services.home-assistant.config = {
- sensor = [
- # Sensor for monitoring the bridge state
- {
- platform = "mqtt";
- name = "Zigbee2mqtt Bridge state";
- state_topic = "/zigbee2mqtt/bridge/state";
- icon = "mdi:router-wireless";
- }
- # Sensor for Showing the Zigbee2mqtt Version
- {
- platform = "mqtt";
- name = "Zigbee2mqtt Version";
- state_topic = "/zigbee2mqtt/bridge/config";
- value_template = "{{ value_json.version }}";
- icon = "mdi:zigbee";
- }
- # Sensor for Showing the Coordinator Version
- {
- platform = "mqtt";
- name = "Coordinator Version";
- state_topic = "/zigbee2mqtt/bridge/config";
- value_template = "{{ value_json.coordinator }}";
- icon = "mdi:chip";
- }
- ];
- switch = [
- {
- platform = "mqtt";
- name = "zigbee2mqtt_join";
- state_topic = "/zigbee2mqtt/bridge/config/permit_join";
- command_topic = "/zigbee2mqtt/bridge/config/permit_join";
- payload_on = "true";
- payload_off = "false";
- }
- ];
- automation = [
- #{
- # alias = "Zigbee2mqtt Log Level";
- # initial_state = "on";
- # trigger = {
- # platform = "state";
- # entity_id = "input_select.zigbee2mqtt_log_level";
- # };
- # action = [
- # {
- # service = "mqtt.publish";
- # data = {
- # payload_template = "{{ states('input_select.zigbee2mqtt_log_level') }}";
- # topic = "/zigbee2mqtt/bridge/config/log_level";
- # };
- # }
- # ];
- #}
- # Automation to start timer when enable join is turned on
- {
- id = "zigbee_join_enabled";
- alias = "";
- trigger = {
- platform = "state";
- entity_id = "switch.zigbee2mqtt_join";
- to = "on";
- };
- action = {
- service = "timer.start";
- entity_id = "timer.zigbee_permit_join";
+ # switches https://www.zigbee2mqtt.io/devices/324131092621.html#philips-324131092621
+ "0x00178801086ac38c".friendly_name = "i_bett";
+ "0x00178801086ad1fb".friendly_name = "i_essen";
+ "0x00178801086ac373".friendly_name = "i_nass";
+
+ # sensors https://www.zigbee2mqtt.io/devices/9290012607.html#philips-9290012607
+ "0x0017880106f772f2".friendly_name = "s_essen";
+ "0x0017880106f77f30".friendly_name = "s_nass";
+
+ # heat https://www.zigbee2mqtt.io/devices/701721.html#popp-701721
+ "0x842e14fffe27109a".friendly_name = "t_bett";
+ "0x842e14fffe269a73".friendly_name = "t_nass";
+ "0x842e14fffe269a56".friendly_name = "t_arbeit";
+
+ # rotation https://www.zigbee2mqtt.io/devices/E1744.html
+ "0x8cf681fffe065493" = {
+ friendly_name = "r_test";
+ device_id = "r_test";
+ simulated_brightness = {
+ delta = 2;
+ interval = 100;
+ };
};
- }
- # Automation to stop timer when switch turned off and turn off switch when timer finished
- {
- id = "zigbee_join_disabled";
- trigger = [
- {
- platform = "event";
- event_type = "timer.finished";
- event_data.entity_id = "timer.zigbee_permit_join";
- }
- {
- platform = "state";
- entity_id = "switch.zigbee2mqtt_join";
- to = "off";
- }
- ];
- action = [
- { service = "timer.cancel";
- data.entity_id = "timer.zigbee_permit_join";
- }
- { service = "switch.turn_off";
- entity_id = "switch.zigbee2mqtt_join";
- }
- ];
- }
- ];
- #input_select.zigbee2mqtt_log_level = {
- # name = "Zigbee2mqtt Log Level";
- # options = [
- # "debug"
- # "info"
- # "warn"
- # "error"
- # ];
- # initial = "info";
- # icon = "mdi:format-list-bulleted";
- #};
- timer.zigbee_permit_join = {
- name = "Zigbee Time remaining";
- duration = 120;
+ };
};
};
}