mirror of
https://github.com/skalavala/mysmarthome.git
synced 2025-09-13 23:14:32 +00:00
Clean up!
This commit is contained in:
@@ -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.
|
||||
|
Reference in New Issue
Block a user