Skip to content

Commit

Permalink
Updated UPS sensor names and add switch to enable/disable beeper
Browse files Browse the repository at this point in the history
  • Loading branch information
golles committed Nov 1, 2024
1 parent 207ddc4 commit 307699a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 9 deletions.
10 changes: 5 additions & 5 deletions lovelace/views/hal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 26 additions & 4 deletions packages/ups.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,48 @@
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
action: notify.sander
data:
title: UPS status
message: >-
{{ states("sensor.apc_back_ups_bx950mi_status") }}
{{ states("sensor.back_ups_bx950mi_status") }}
data:
group: ups
url: /lovelace/hal

0 comments on commit 307699a

Please sign in to comment.