Clean up!

This commit is contained in:
Mahasri Kalavala
2020-03-02 18:12:53 -05:00
parent af58f3eea3
commit 531fa23196
21 changed files with 151 additions and 639 deletions

View File

@@ -1,77 +1,77 @@
# # ###############################################################################
# # # @author : Mahasri Kalavala
# # # @date : 11/27/2017
# # # @package : APC UPS Backup
# # # @description : UPS Backup
# # ###############################################################################
# apcupsd:
# host: 127.0.0.1
# port: 3551
# sensor:
# - platform: apcupsd
# # name: Network Backup UPS
# resources:
# - bcharge
# - linev
# - loadpct
# - nominv
# - numxfers
# - status
# - timeleft
# - tonbatt
# ###############################################################################
# # @author : Mahasri Kalavala
# # @date : 11/27/2017
# # @package : APC UPS Backup
# # @description : UPS Backup
# # _ _ _
# # /\ | | | | (_)
# # / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
# # / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# # / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
# # /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
# #
# ###############################################################################
apcupsd:
host: 127.0.0.1
port: 3551
sensor:
- platform: apcupsd
# name: Network Backup UPS
resources:
- bcharge
- linev
- loadpct
- nominv
- numxfers
- status
- timeleft
- tonbatt
# automation:
# - alias: UPS State Change
# initial_state: true
# trigger:
# - platform: state
# entity_id: sensor.ups_status
# action:
# - service: script.notify_me
# data_template:
# message: "UPS Status changed from {{ trigger.from_state.state }}
# to {{ trigger.to_state.state }}
# at {{ as_timestamp(now()) | timestamp_custom('%I:%M:%S %p, %B %d,%Y', true) }}."
###############################################################################
# _ _ _
# /\ | | | | (_)
# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
# / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
# /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
#
###############################################################################
# # # Power Failure Notification
# # ###############################################################################
# - alias: Power Failure
# initial_state: true
# trigger:
# - platform: state
# entity_id: sensor.ups_status
# from: "ONLINE"
# to: "ONBATT"
# action:
# - service: script.notify_me
# data_template:
# message:
# Power failure at {{ as_timestamp(now()) | timestamp_custom('%I:%M:%S %p %B-%d,%Y', true) }}.
# Battery can last for {{ states('sensor.ups_time_left') }} minutes.
automation:
- alias: UPS State Change
initial_state: true
trigger:
- platform: state
entity_id: sensor.ups_status
action:
- service: script.notify_me
data_template:
message: "UPS Status changed from {{ trigger.from_state.state }}
to {{ trigger.to_state.state }}
at {{ as_timestamp(now()) | timestamp_custom('%I:%M:%S %p, %B %d,%Y', true) }}."
# # Power Failure Notification
# ###############################################################################
- alias: Power Failure
initial_state: true
trigger:
- platform: state
entity_id: sensor.ups_status
from: "ONLINE"
to: "ONBATT"
action:
- service: script.notify_me
data_template:
message:
Power failure at {{ as_timestamp(now()) | timestamp_custom('%I:%M:%S %p %B-%d,%Y', true) }}.
Battery can last for {{ states('sensor.ups_time_left') }} minutes.
# # Power Restored Notification
# ###############################################################################
- alias: Power Restored
initial_state: true
trigger:
- platform: state
entity_id: sensor.ups_status
from: "ONBATT"
to: "ONLINE"
action:
- service: script.notify_me
data_template:
message:
Power restored at {{ as_timestamp(now()) | timestamp_custom('%I:%M:%S %p %B-%d,%Y', true) }}.
Ran on battery for {{ "%0.2f" % (states('sensor.ups_time_on_battery') | int / 60 |float) }} minutes.
# # # Power Restored Notification
# # ###############################################################################
# - alias: Power Restored
# initial_state: true
# trigger:
# - platform: state
# entity_id: sensor.ups_status
# from: "ONBATT"
# to: "ONLINE"
# action:
# - service: script.notify_me
# data_template:
# message:
# Power restored at {{ as_timestamp(now()) | timestamp_custom('%I:%M:%S %p %B-%d,%Y', true) }}.
# Ran on battery for {{ "%0.2f" % (states('sensor.ups_time_on_battery') | int / 60 |float) }} minutes.