mirror of
https://github.com/anotherhadi/nixy.git
synced 2026-10-05 11:18:24 +02:00
add uptime kuma, card-mod and others
Signed-off-by: Hadi <[email protected]>
This commit is contained in:
@@ -53,6 +53,7 @@ in {
|
||||
"meteo_france"
|
||||
"remote_calendar"
|
||||
"systemmonitor"
|
||||
"uptime_kuma"
|
||||
];
|
||||
customComponents = plugins.customComponents;
|
||||
customLovelaceModules = plugins.customLovelaceModules;
|
||||
@@ -65,7 +66,11 @@ in {
|
||||
scene = "!include scenes.yaml";
|
||||
automation = "!include automations.yaml";
|
||||
script = "!include scripts.yaml";
|
||||
frontend.themes = nixyTheme;
|
||||
frontend = {
|
||||
themes = nixyTheme;
|
||||
# Load card-mod early so it can style every card
|
||||
extra_module_url = ["/local/nixos-lovelace-modules/card-mod.js"];
|
||||
};
|
||||
# Timestamp of the last motion detection (trigger-based, survives restarts)
|
||||
template =
|
||||
map (room: {
|
||||
@@ -86,7 +91,61 @@ in {
|
||||
}
|
||||
];
|
||||
})
|
||||
motionRooms;
|
||||
motionRooms
|
||||
++ [
|
||||
# Uptime Kuma monitors that are not up (down, pending or maintenance)
|
||||
{
|
||||
sensor = [
|
||||
{
|
||||
name = "Websites not up";
|
||||
unique_id = "websites_not_up";
|
||||
icon = "mdi:web-off";
|
||||
state = ''
|
||||
{{ integration_entities('uptime_kuma')
|
||||
| select('match', 'sensor\.')
|
||||
| select('is_state', ['down', 'pending', 'maintenance'])
|
||||
| list | count }}
|
||||
'';
|
||||
attributes.sites = ''
|
||||
{{ integration_entities('uptime_kuma')
|
||||
| select('match', 'sensor\.')
|
||||
| select('is_state', ['down', 'pending', 'maintenance'])
|
||||
| map('device_attr', 'name')
|
||||
| list }}
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
# Battery sensors below 15%
|
||||
{
|
||||
sensor = [
|
||||
{
|
||||
name = "Batteries to replace";
|
||||
unique_id = "batteries_to_replace";
|
||||
icon = "mdi:battery-alert-variant-outline";
|
||||
state = ''
|
||||
{{ states.sensor
|
||||
| selectattr('attributes.device_class', 'defined')
|
||||
| selectattr('attributes.device_class', 'eq', 'battery')
|
||||
| map(attribute='state')
|
||||
| select('is_number') | map('float')
|
||||
| select('lt', 15)
|
||||
| list | count }}
|
||||
'';
|
||||
attributes.devices = ''
|
||||
{% set ns = namespace(low=[]) %}
|
||||
{% for s in states.sensor
|
||||
| selectattr('attributes.device_class', 'defined')
|
||||
| selectattr('attributes.device_class', 'eq', 'battery')
|
||||
if is_number(s.state) and s.state | float < 15 %}
|
||||
{% set ns.low = ns.low + [s.name ~ ' (' ~ s.state | int ~ '%)'] %}
|
||||
{% endfor %}
|
||||
{{ ns.low }}
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
alarm_control_panel = [
|
||||
{
|
||||
platform = "manual";
|
||||
|
||||
@@ -64,5 +64,6 @@ in {
|
||||
pkgs.home-assistant-custom-lovelace-modules.bubble-card
|
||||
pkgs.home-assistant-custom-lovelace-modules.auto-entities
|
||||
pkgs.home-assistant-custom-lovelace-modules.mushroom
|
||||
pkgs.home-assistant-custom-lovelace-modules.card-mod
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user