pepe: improved hass
This commit is contained in:
parent
53acb610b1
commit
1ff1a25e89
4 changed files with 28 additions and 15 deletions
|
@ -190,7 +190,7 @@ in {
|
|||
# overview
|
||||
# --------
|
||||
all_sensors = {
|
||||
name = "Sensor Overview";
|
||||
name = "Alle Sensoren";
|
||||
control = "hidden";
|
||||
};
|
||||
today = {
|
||||
|
|
|
@ -88,8 +88,11 @@ in {
|
|||
lightGroups = lib.mapAttrs (name:
|
||||
{ ... }: {
|
||||
control = "hidden";
|
||||
entities =
|
||||
[ "light.${name}" "sensor.link_${name}" "binary_sensor.update_${name}" ];
|
||||
entities = [
|
||||
"light.${name}"
|
||||
"sensor.link_${name}"
|
||||
"binary_sensor.update_${name}"
|
||||
];
|
||||
}) allDevices;
|
||||
|
||||
# sort lights into given groups.
|
||||
|
|
|
@ -7,45 +7,55 @@ let
|
|||
"motion_sensor_1" = {
|
||||
id = "0x00158d0002fbd451";
|
||||
groups = [ "kitchen_room_present" ];
|
||||
timeout = 60 * 2;
|
||||
};
|
||||
"motion_sensor_2" = {
|
||||
id = "0x00158d0002f9a6b8";
|
||||
groups = [ "kitchen_room_present" ];
|
||||
timeout = 60 * 2;
|
||||
};
|
||||
"motion_sensor_3" = {
|
||||
id = "0x00158d0002f04522";
|
||||
groups = [ "living_room_present" ];
|
||||
timeout = 60 * 3;
|
||||
};
|
||||
"motion_sensor_4" = {
|
||||
id = "0x00158d0002f9a558";
|
||||
groups = [ "living_room_present" ];
|
||||
timeout = 60 * 3;
|
||||
};
|
||||
"motion_sensor_5" = {
|
||||
id = "0x00158d0002f9a56f";
|
||||
groups = [ "bath_room_essential_present" ];
|
||||
timeout = 60 * 3;
|
||||
};
|
||||
"motion_sensor_6" = {
|
||||
id = "0x00158d0002f9a5cb";
|
||||
groups = [ "floor_room_present" ];
|
||||
timeout = 60 * 5;
|
||||
};
|
||||
"motion_sensor_7" = {
|
||||
id = "0x00158d0002f9a6aa";
|
||||
groups = [ "bed_room_essential_present" ];
|
||||
timeout = 60 * 1.2;
|
||||
};
|
||||
"motion_sensor_8" = {
|
||||
id = "0x00158d0002f04637";
|
||||
groups = [ "bath_room_essential_present" ];
|
||||
timeout = 60 * 3;
|
||||
};
|
||||
};
|
||||
|
||||
in {
|
||||
|
||||
services.zigbee2mqtt.devices = lib.mapAttrs' (name:
|
||||
{ id, ... }: {
|
||||
{ id, timeout ? 90, ... }: {
|
||||
name = id;
|
||||
value = {
|
||||
retain = false;
|
||||
friendly_name = name;
|
||||
# should not be set below 60 seconds
|
||||
occupancy_timeout = timeout;
|
||||
};
|
||||
}) allDevices;
|
||||
|
||||
|
|
|
@ -47,15 +47,15 @@ in {
|
|||
device_class = "humidity";
|
||||
value_template = "{{ value_json.humidity }}";
|
||||
}
|
||||
{
|
||||
platform = "mqtt";
|
||||
name = "pressure_${name}";
|
||||
state_topic = "zigbee2mqtt/${name}";
|
||||
availability_topic = "zigbee2mqtt/bridge/state";
|
||||
unit_of_measurement = "hPa";
|
||||
device_class = "pressure";
|
||||
value_template = "{{ value_json.pressure }}";
|
||||
}
|
||||
#{
|
||||
# platform = "mqtt";
|
||||
# name = "pressure_${name}";
|
||||
# state_topic = "zigbee2mqtt/${name}";
|
||||
# availability_topic = "zigbee2mqtt/bridge/state";
|
||||
# unit_of_measurement = "hPa";
|
||||
# device_class = "pressure";
|
||||
# value_template = "{{ value_json.pressure }}";
|
||||
#}
|
||||
{
|
||||
name = "battery_${name}";
|
||||
platform = "mqtt";
|
||||
|
@ -87,7 +87,7 @@ in {
|
|||
entities = [
|
||||
"sensor.${name}"
|
||||
"sensor.humidity_${name}"
|
||||
"sensor.pressure_${name}"
|
||||
#"sensor.pressure_${name}"
|
||||
"sensor.battery_${name}"
|
||||
"sensor.link_${name}"
|
||||
|
||||
|
@ -105,7 +105,7 @@ in {
|
|||
in sortedInGroups // sensorGroups // {
|
||||
|
||||
all_sensors.entities =
|
||||
lib.mapAttrsToList (name: { ... }: "binary_sensor.${name}") allDevices;
|
||||
lib.mapAttrsToList (name: { ... }: "sensor.${name}") allDevices;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue