From 307699ae02c2113fc1b5ece19afc7c2ef12613f8 Mon Sep 17 00:00:00 2001 From: golles Date: Fri, 1 Nov 2024 20:56:59 +0000 Subject: [PATCH] Updated UPS sensor names and add switch to enable/disable beeper --- lovelace/views/hal.yaml | 10 +++++----- packages/ups.yaml | 30 ++++++++++++++++++++++++++---- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/lovelace/views/hal.yaml b/lovelace/views/hal.yaml index 7d3ae86..4e3cef1 100644 --- a/lovelace/views/hal.yaml +++ b/lovelace/views/hal.yaml @@ -132,18 +132,18 @@ sections: heading_style: subtitle tap_action: action: navigate - navigation_path: /config/devices/device/3b35d47b35a6b96848962b937ee493ce + navigation_path: /config/devices/device/6ddd1bfc38e356168076c2e876b86b18 - type: tile - entity: sensor.apc_back_ups_bx950mi_status + entity: sensor.back_ups_bx950mi_status name: Status - type: tile - entity: sensor.apc_back_ups_bx950mi_battery_charge + entity: sensor.back_ups_bx950mi_batterijlading name: Batterij - type: tile - entity: sensor.apc_back_ups_bx950mi_battery_runtime + entity: sensor.back_ups_bx950mi_batterijduur name: Batterij tijd - type: tile - entity: sensor.apc_back_ups_bx950mi_self_test_result + entity: sensor.back_ups_bx950mi_resultaat_zelftest name: Test - type: grid diff --git a/packages/ups.yaml b/packages/ups.yaml index 6aa634e..ef5d207 100644 --- a/packages/ups.yaml +++ b/packages/ups.yaml @@ -1,18 +1,40 @@ +switch: + - platform: template + switches: + back_ups_bx950mi_beeper: + friendly_name: UPS Beeper + icon_template: > + {% if is_state("sensor.back_ups_bx950mi_pieperstatus", "enabled") %} + mdi:volume-high + {% else %} + mdi:volume-off + {% endif %} + value_template: > + {{ is_state("sensor.back_ups_bx950mi_pieperstatus", "enabled") }} + turn_on: + type: beeper_enable + device_id: 6ddd1bfc38e356168076c2e876b86b18 + domain: nut + turn_off: + type: beeper_disable + device_id: 6ddd1bfc38e356168076c2e876b86b18 + domain: nut + automation: - id: ups_state_change alias: UPS status verandering mode: single triggers: - trigger: state - entity_id: sensor.apc_back_ups_bx950mi_status + entity_id: sensor.back_ups_bx950mi_status conditions: - condition: not conditions: - condition: state - entity_id: sensor.apc_back_ups_bx950mi_status + entity_id: sensor.back_ups_bx950mi_status state: unavailable - condition: state - entity_id: sensor.apc_back_ups_bx950mi_self_test_result + entity_id: sensor.back_ups_bx950mi_resultaat_zelftest state: In progress actions: - alias: Sent a notification with the state @@ -20,7 +42,7 @@ automation: data: title: UPS status message: >- - {{ states("sensor.apc_back_ups_bx950mi_status") }} + {{ states("sensor.back_ups_bx950mi_status") }} data: group: ups url: /lovelace/hal