various tidyups
This commit is contained in:
@@ -9,42 +9,24 @@
|
||||
# quiet_time_on_off_actions.yaml
|
||||
#
|
||||
# VERSION:
|
||||
# V1.2 2026-06-20
|
||||
#
|
||||
# VERSION HISTORY:
|
||||
# V1.2 2026-06-20
|
||||
# - Added Quiet Time OFF action to change OpenHASP panel openhasp_1
|
||||
# back to page 1.
|
||||
#
|
||||
# V1.1 2026-06-15
|
||||
# - Added separate Quiet Time ON and Quiet Time OFF action sections.
|
||||
# - Added support for non-binary Quiet Time OFF actions.
|
||||
# - Sets input_number.openhasp_1_backlight_level to 200 when Quiet Time ends.
|
||||
#
|
||||
# V1.0 2026-06-15
|
||||
# - Initial standalone package split out from the main Quiet Time package.
|
||||
# - Turns selected entities on/off when input_boolean.quiet_time changes.
|
||||
# V1.3 2026-09-04
|
||||
#
|
||||
# PURPOSE:
|
||||
# Runs local Home Assistant actions when Quiet Time is turned ON or OFF.
|
||||
#
|
||||
# The main Quiet Time package should continue to own:
|
||||
# - input_boolean.quiet_time
|
||||
# - daily reset behaviour
|
||||
# - MQTT quiet_time state publishing
|
||||
# The main Quiet Time package owns the helper, daily reset behaviour, and MQTT
|
||||
# publishing. This package owns extra local Quiet Time actions.
|
||||
#
|
||||
# This package only handles extra local actions that should happen when
|
||||
# Quiet Time starts or ends.
|
||||
# VERSION HISTORY:
|
||||
# V1.3 2026-09-04
|
||||
# - Disables Flounder Motion Wake during Quiet Time and requests a one-off
|
||||
# 10-second presence fade to Screen Off.
|
||||
# - Restores Flounder Motion Wake when Quiet Time ends.
|
||||
#
|
||||
# EDITING NOTES:
|
||||
# - Add normal on/off entities to the relevant entity lists.
|
||||
# - Empty lists are fine and will simply do nothing.
|
||||
# - Use the "Other Quiet Time OFF Actions" section for things that are not
|
||||
# simple on/off actions, such as setting input_numbers, selects, scenes,
|
||||
# scripts, MQTT commands, or custom service calls.
|
||||
# V1.2 2026-06-20
|
||||
# - Added Quiet Time OFF action to change OpenHASP panel openhasp_1 back to
|
||||
# page 1.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
################################################################################
|
||||
# AUTOMATIONS
|
||||
################################################################################
|
||||
@@ -56,56 +38,15 @@ automation:
|
||||
mode: single
|
||||
|
||||
variables:
|
||||
##########################################################################
|
||||
# QUIET TIME ON ACTION LISTS
|
||||
##########################################################################
|
||||
#
|
||||
# These actions run when input_boolean.quiet_time changes to "on".
|
||||
#
|
||||
|
||||
quiet_time_on_turn_off_entities:
|
||||
- light.led_matrix_display_led_matrix_display_display
|
||||
|
||||
quiet_time_on_turn_on_entities: []
|
||||
|
||||
##########################################################################
|
||||
# QUIET TIME OFF ACTION LISTS
|
||||
##########################################################################
|
||||
#
|
||||
# These actions run when input_boolean.quiet_time changes to "off".
|
||||
#
|
||||
|
||||
quiet_time_off_turn_off_entities: []
|
||||
|
||||
quiet_time_off_turn_on_entities:
|
||||
- light.led_matrix_display_led_matrix_display_display
|
||||
|
||||
##########################################################################
|
||||
# OTHER QUIET TIME OFF ACTION VALUES
|
||||
##########################################################################
|
||||
#
|
||||
# Use this list for input_number helpers that should be set when Quiet Time
|
||||
# ends.
|
||||
#
|
||||
# Format:
|
||||
# - entity_id: input_number.some_helper
|
||||
# value: 123
|
||||
#
|
||||
|
||||
quiet_time_off_input_number_values:
|
||||
- entity_id: input_number.openhasp_1_backlight_level
|
||||
value: 200
|
||||
|
||||
##########################################################################
|
||||
# OPENHASP QUIET TIME OFF PAGE ACTION
|
||||
##########################################################################
|
||||
#
|
||||
# Sends the OpenHASP panel back to the main page when Quiet Time ends.
|
||||
#
|
||||
# Current OpenHASP MQTT command topic:
|
||||
# hasp/openhasp_1/command/page
|
||||
#
|
||||
|
||||
quiet_time_off_openhasp_page_topic: "hasp/openhasp_1/command/page"
|
||||
quiet_time_off_openhasp_page: 1
|
||||
|
||||
@@ -121,13 +62,6 @@ automation:
|
||||
|
||||
actions:
|
||||
- choose:
|
||||
######################################################################
|
||||
# QUIET TIME ON ACTIONS
|
||||
######################################################################
|
||||
#
|
||||
# Runs when Quiet Time starts.
|
||||
#
|
||||
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: "{{ trigger.to_state.state == 'on' }}"
|
||||
@@ -138,47 +72,44 @@ automation:
|
||||
- action: homeassistant.turn_off
|
||||
target:
|
||||
entity_id: "{{ repeat.item }}"
|
||||
|
||||
- repeat:
|
||||
for_each: "{{ quiet_time_on_turn_on_entities }}"
|
||||
sequence:
|
||||
- action: homeassistant.turn_on
|
||||
target:
|
||||
entity_id: "{{ repeat.item }}"
|
||||
|
||||
######################################################################
|
||||
# QUIET TIME OFF ACTIONS
|
||||
######################################################################
|
||||
#
|
||||
# Runs when Quiet Time ends.
|
||||
#
|
||||
|
||||
# Stop camera motion from extending presence, then fade the
|
||||
# current session to the existing Screen Off base state.
|
||||
- action: switch.turn_off
|
||||
target:
|
||||
entity_id: switch.flounder_kiosk_motion_wake
|
||||
- wait_template: "{{ is_state('switch.flounder_kiosk_motion_wake', 'off') }}"
|
||||
timeout: "00:00:10"
|
||||
continue_on_timeout: true
|
||||
- action: mqtt.publish
|
||||
data:
|
||||
topic: "viewroad-commands/flounder/presence/end"
|
||||
payload: "10"
|
||||
retain: false
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: "{{ trigger.to_state.state == 'off' }}"
|
||||
sequence:
|
||||
##################################################################
|
||||
# Quiet Time OFF - binary/entity actions
|
||||
##################################################################
|
||||
|
||||
- repeat:
|
||||
for_each: "{{ quiet_time_off_turn_off_entities }}"
|
||||
sequence:
|
||||
- action: homeassistant.turn_off
|
||||
target:
|
||||
entity_id: "{{ repeat.item }}"
|
||||
|
||||
- repeat:
|
||||
for_each: "{{ quiet_time_off_turn_on_entities }}"
|
||||
sequence:
|
||||
- action: homeassistant.turn_on
|
||||
target:
|
||||
entity_id: "{{ repeat.item }}"
|
||||
|
||||
##################################################################
|
||||
# Quiet Time OFF - input_number set actions
|
||||
##################################################################
|
||||
|
||||
- action: switch.turn_on
|
||||
target:
|
||||
entity_id: switch.flounder_kiosk_motion_wake
|
||||
- repeat:
|
||||
for_each: "{{ quiet_time_off_input_number_values }}"
|
||||
sequence:
|
||||
@@ -187,34 +118,8 @@ automation:
|
||||
entity_id: "{{ repeat.item.entity_id }}"
|
||||
data:
|
||||
value: "{{ repeat.item.value | float }}"
|
||||
|
||||
##################################################################
|
||||
# Quiet Time OFF - OpenHASP page action
|
||||
##################################################################
|
||||
#
|
||||
# Change OpenHASP panel back to page 1 when Quiet Time ends.
|
||||
#
|
||||
|
||||
- action: mqtt.publish
|
||||
data:
|
||||
topic: "{{ quiet_time_off_openhasp_page_topic }}"
|
||||
payload: "{{ quiet_time_off_openhasp_page | int }}"
|
||||
retain: false
|
||||
|
||||
##################################################################
|
||||
# Quiet Time OFF - other custom actions
|
||||
##################################################################
|
||||
#
|
||||
# Add any extra non-binary service calls here later.
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# - action: script.some_script
|
||||
#
|
||||
# - action: select.select_option
|
||||
# target:
|
||||
# entity_id: select.some_select
|
||||
# data:
|
||||
# option: "Some Option"
|
||||
#
|
||||
##################################################################
|
||||
|
||||
Reference in New Issue
Block a user