Make Start Date and Control Flag inputs optional in Periodic Notification
- Start Date: when empty, day interval is ignored and notifications fire daily - Control Flag: when empty, notifications always fire (no toggle control) - Update documentation to reflect optional inputs - Fix markdown linting issues Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -83,10 +83,12 @@ blueprint:
|
||||
collapsed: false
|
||||
input:
|
||||
control_flag:
|
||||
name: Control Flag
|
||||
name: Control Flag (optional)
|
||||
description: >
|
||||
Toggle entity to enable or disable notifications.
|
||||
Notifications are only sent when this entity is ON.
|
||||
Leave empty to always send notifications.
|
||||
default: ""
|
||||
selector:
|
||||
entity:
|
||||
domain:
|
||||
@@ -120,6 +122,7 @@ variables:
|
||||
message_text: !input message
|
||||
interval: !input day_interval
|
||||
start_date: !input start_date
|
||||
control_flag: !input control_flag
|
||||
|
||||
# Debug flag - set to true to enable persistent notifications for troubleshooting
|
||||
is_debug: false
|
||||
@@ -128,10 +131,14 @@ variables:
|
||||
# Conditions
|
||||
# =============================================================================
|
||||
condition:
|
||||
# Control flag must be ON
|
||||
- condition: state
|
||||
entity_id: !input control_flag
|
||||
state: "on"
|
||||
# Control flag must be ON (skipped if no control flag)
|
||||
- condition: template
|
||||
value_template: >
|
||||
{%- if control_flag | length == 0 -%}
|
||||
true
|
||||
{%- else -%}
|
||||
{{ is_state(control_flag, 'on') }}
|
||||
{%- endif -%}
|
||||
|
||||
# Today must fall on the correct day in the interval cycle (skipped if no start date)
|
||||
- condition: template
|
||||
|
||||
Reference in New Issue
Block a user