149 lines
4.2 KiB
YAML
149 lines
4.2 KiB
YAML
################################################################################
|
|
# Quiet Time Package
|
|
################################################################################
|
|
#
|
|
# TITLE:
|
|
# Quiet Time
|
|
#
|
|
# VERSIONS:
|
|
# V1.3 2026-06-07
|
|
# - Added quiet time start and stop entity action lists.
|
|
# - Turns the LED matrix display OFF when quiet time starts.
|
|
# - Turns the LED matrix display ON when quiet time ends.
|
|
#
|
|
# V1.2 2026-05-21
|
|
# - Added MQTT publishing when input_boolean.quiet_time changes.
|
|
# - Publishes quiet_time state to viewroad-status/homeassistant/quiet-time.
|
|
#
|
|
# V1.1 2026-05-21
|
|
# - Reduced daily reset check frequency from every minute to every 30 minutes.
|
|
# - Reduced reset dropdown options to 00:30 through 10:00 only.
|
|
#
|
|
# V1.0 2026-05-21
|
|
# - Initial package.
|
|
# - Adds input_boolean.quiet_time.
|
|
# - Adds input_select.quiet_time_daily_reset.
|
|
# - Adds daily automation to turn quiet_time OFF at the selected reset time.
|
|
#
|
|
# OPERATION NOTES:
|
|
# - input_boolean.quiet_time is the master quiet time toggle.
|
|
# - Other packages can check input_boolean.quiet_time before sending
|
|
# announcements, notifications, TTS messages, or similar.
|
|
# - input_select.quiet_time_daily_reset selects the daily time that quiet_time
|
|
# will automatically be turned OFF.
|
|
# - Default reset time is 07:00.
|
|
# - The quiet_time state is published to MQTT whenever it changes.
|
|
# - When quiet_time changes, editable entity lists can turn things on or off.
|
|
#
|
|
# QUIET TIME ACTION LISTS:
|
|
# - quiet_time_start_turn_off_entities:
|
|
# Entities to turn OFF when quiet time starts.
|
|
#
|
|
# - quiet_time_start_turn_on_entities:
|
|
# Entities to turn ON when quiet time starts.
|
|
#
|
|
# - quiet_time_stop_turn_off_entities:
|
|
# Entities to turn OFF when quiet time ends.
|
|
#
|
|
# - quiet_time_stop_turn_on_entities:
|
|
# Entities to turn ON when quiet time ends.
|
|
#
|
|
# MQTT STATUS:
|
|
# - Topic:
|
|
# viewroad-status/quiet-time
|
|
# - Payload:
|
|
# on
|
|
# off
|
|
#
|
|
################################################################################
|
|
|
|
################################################################################
|
|
# INPUT BOOLEAN
|
|
################################################################################
|
|
|
|
input_boolean:
|
|
quiet_time:
|
|
name: Quiet Time
|
|
icon: mdi:bell-off
|
|
|
|
################################################################################
|
|
# INPUT SELECT
|
|
################################################################################
|
|
|
|
input_select:
|
|
quiet_time_daily_reset:
|
|
name: Quiet time daily reset
|
|
icon: mdi:clock-end
|
|
options:
|
|
- "00:30"
|
|
- "01:00"
|
|
- "01:30"
|
|
- "02:00"
|
|
- "02:30"
|
|
- "03:00"
|
|
- "03:30"
|
|
- "04:00"
|
|
- "04:30"
|
|
- "05:00"
|
|
- "05:30"
|
|
- "06:00"
|
|
- "06:30"
|
|
- "07:00"
|
|
- "07:30"
|
|
- "08:00"
|
|
- "08:30"
|
|
- "09:00"
|
|
- "09:30"
|
|
- "10:00"
|
|
initial: "07:00"
|
|
|
|
################################################################################
|
|
# AUTOMATIONS
|
|
################################################################################
|
|
|
|
automation:
|
|
- id: quiet_time_daily_reset_turn_off
|
|
alias: "Quiet Time - Daily Reset Off"
|
|
description: "Turns Quiet Time off once per day at the selected reset time."
|
|
mode: single
|
|
|
|
triggers:
|
|
- trigger: time_pattern
|
|
minutes: "/30"
|
|
seconds: "0"
|
|
|
|
conditions:
|
|
- condition: state
|
|
entity_id: input_boolean.quiet_time
|
|
state: "on"
|
|
|
|
- condition: template
|
|
value_template: >
|
|
{{ states('input_select.quiet_time_daily_reset') == now().strftime('%H:%M') }}
|
|
|
|
actions:
|
|
- action: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.quiet_time
|
|
|
|
- id: quiet_time_mqtt
|
|
alias: "Quiet Time - State to MQTT"
|
|
description: "Publishes the Quiet Time state to MQTT"
|
|
mode: single
|
|
|
|
triggers:
|
|
- trigger: state
|
|
entity_id: input_boolean.quiet_time
|
|
from:
|
|
- "on"
|
|
- "off"
|
|
to:
|
|
- "on"
|
|
- "off"
|
|
|
|
actions:
|
|
- action: mqtt.publish
|
|
data:
|
|
topic: viewroad-status/quiet-time
|
|
payload: "{{ trigger.to_state.state }}"
|