One more fix for Washing Machine.yaml. Add better variable comments.
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
This commit is contained in:
@@ -35,17 +35,17 @@
|
|||||||
# - lst: Last Sample Time (ISO timestamp)
|
# - lst: Last Sample Time (ISO timestamp)
|
||||||
#
|
#
|
||||||
# Message Template Variables:
|
# Message Template Variables:
|
||||||
# All message templates support Jinja2 templating with these variables:
|
# All message templates support these placeholder variables (use single braces):
|
||||||
# - {{ appliance_name }} - Device name (e.g., "Washing Machine")
|
# - `{appliance_name}` - Device name (e.g., "Washing Machine")
|
||||||
# - {{ remaining }} - Remaining time as string (e.g., "01:30:00")
|
# - `{remaining}` - Remaining time as string (e.g., "01:30:00")
|
||||||
# - {{ estimated_end }} - Estimated completion time (e.g., "14:30")
|
# - `{estimated_end}` - Estimated completion time (e.g., "14:30")
|
||||||
# - {{ minutes }} - Remaining minutes as number (e.g., 90)
|
# - `{minutes}` - Remaining minutes as number (e.g., 90)
|
||||||
# - {{ error }} - Error message text (only in error notification)
|
# - `{error}` - Error message text (only in error notification)
|
||||||
# - {{ tub_count }} - Tub clean counter value (only in tub clean notification)
|
# - `{tub_count}` - Tub clean counter value (only in tub clean notification)
|
||||||
# - {{ tub_threshold }} - Tub clean threshold (only in tub clean notification)
|
# - `{tub_threshold}` - Tub clean threshold (only in tub clean notification)
|
||||||
# - {{ details }} - Startup details from sensors (only in start notification)
|
# - `{details}` - Startup details from sensors (only in start notification)
|
||||||
# - {{ energy_kwh }} - Energy consumed in kWh (only in completion notification)
|
# - `{energy_kwh}` - Energy consumed in kWh (only in completion notification)
|
||||||
# - {{ energy_cost }} - Estimated cost (only in completion notification)
|
# - `{energy_cost}` - Estimated cost (only in completion notification)
|
||||||
#
|
#
|
||||||
# Requirements:
|
# Requirements:
|
||||||
# - Sensors for: remaining time, run state, error messages
|
# - Sensors for: remaining time, run state, error messages
|
||||||
@@ -157,7 +157,7 @@ blueprint:
|
|||||||
input:
|
input:
|
||||||
input_device_name:
|
input_device_name:
|
||||||
name: "Device Name"
|
name: "Device Name"
|
||||||
description: "Device name used in notification messages (available as {{ appliance_name }} in templates)"
|
description: "Device name used in notification messages (available as `{appliance_name}` in templates)"
|
||||||
default: "Стиральная машина"
|
default: "Стиральная машина"
|
||||||
selector:
|
selector:
|
||||||
text:
|
text:
|
||||||
@@ -182,8 +182,8 @@ blueprint:
|
|||||||
name: "Start Message"
|
name: "Start Message"
|
||||||
description: >
|
description: >
|
||||||
Message sent when cycle starts.
|
Message sent when cycle starts.
|
||||||
Variables: {{ appliance_name }}, {{ remaining }}, {{ details }}, {{ estimated_end }}
|
Variables: `{appliance_name}`, `{remaining}`, `{details}`, `{estimated_end}`
|
||||||
default: "🧺 {{ appliance_name }}: старт. Длительность: `{{ remaining }}`. Завершение: ~{{ estimated_end }}.{{ details }}"
|
default: "🧺 {appliance_name}: старт. Длительность: `{remaining}`. Завершение: ~{estimated_end}.{details}"
|
||||||
selector:
|
selector:
|
||||||
text:
|
text:
|
||||||
multiline: true
|
multiline: true
|
||||||
@@ -192,8 +192,8 @@ blueprint:
|
|||||||
name: "Completed Message"
|
name: "Completed Message"
|
||||||
description: >
|
description: >
|
||||||
Message sent when cycle completes.
|
Message sent when cycle completes.
|
||||||
Variables: {{ appliance_name }}
|
Variables: `{appliance_name}`
|
||||||
default: "🟢 {{ appliance_name }}: завершено. Не забудьте достать вещи!"
|
default: "🟢 {appliance_name}: завершено. Не забудьте достать вещи!"
|
||||||
selector:
|
selector:
|
||||||
text:
|
text:
|
||||||
multiline: true
|
multiline: true
|
||||||
@@ -202,8 +202,8 @@ blueprint:
|
|||||||
name: "Almost Done Message"
|
name: "Almost Done Message"
|
||||||
description: >
|
description: >
|
||||||
Message sent when cycle is about to finish.
|
Message sent when cycle is about to finish.
|
||||||
Variables: {{ appliance_name }}, {{ minutes }}
|
Variables: `{appliance_name}`, `{minutes}`
|
||||||
default: "🟢 {{ appliance_name }}: завершение через {{ minutes }} минут."
|
default: "🟢 {appliance_name}: завершение через {minutes} минут."
|
||||||
selector:
|
selector:
|
||||||
text:
|
text:
|
||||||
multiline: true
|
multiline: true
|
||||||
@@ -212,8 +212,8 @@ blueprint:
|
|||||||
name: "Preparation Message"
|
name: "Preparation Message"
|
||||||
description: >
|
description: >
|
||||||
Message sent when device enters preparation mode.
|
Message sent when device enters preparation mode.
|
||||||
Variables: {{ appliance_name }}
|
Variables: `{appliance_name}`
|
||||||
default: "⚙️ {{ appliance_name }}: подготовка активирована!"
|
default: "⚙️ {appliance_name}: подготовка активирована!"
|
||||||
selector:
|
selector:
|
||||||
text:
|
text:
|
||||||
multiline: true
|
multiline: true
|
||||||
@@ -222,8 +222,8 @@ blueprint:
|
|||||||
name: "Error Message"
|
name: "Error Message"
|
||||||
description: >
|
description: >
|
||||||
Message sent when an error occurs.
|
Message sent when an error occurs.
|
||||||
Variables: {{ appliance_name }}, {{ error }}
|
Variables: `{appliance_name}`, `{error}`
|
||||||
default: "⚠️ {{ appliance_name }}: ошибка. Детали: {{ error }}. Для более подробной информации обратитесь к приложению LG ThinQ."
|
default: "⚠️ {appliance_name}: ошибка. Детали: {error}. Для более подробной информации обратитесь к приложению LG ThinQ."
|
||||||
selector:
|
selector:
|
||||||
text:
|
text:
|
||||||
multiline: true
|
multiline: true
|
||||||
@@ -232,8 +232,8 @@ blueprint:
|
|||||||
name: "Tub Clean Reminder Message"
|
name: "Tub Clean Reminder Message"
|
||||||
description: >
|
description: >
|
||||||
Message sent when tub cleaning is needed.
|
Message sent when tub cleaning is needed.
|
||||||
Variables: {{ appliance_name }}, {{ tub_count }}, {{ tub_threshold }}
|
Variables: `{appliance_name}`, `{tub_count}`, `{tub_threshold}`
|
||||||
default: "⚠️ {{ appliance_name }}: внимание. Необходима чистка барабана. Число стирок: {{ tub_count }}. Допустимый предел: {{ tub_threshold }}."
|
default: "⚠️ {appliance_name}: внимание. Необходима чистка барабана. Число стирок: {tub_count}. Допустимый предел: {tub_threshold}."
|
||||||
selector:
|
selector:
|
||||||
text:
|
text:
|
||||||
multiline: true
|
multiline: true
|
||||||
@@ -242,8 +242,8 @@ blueprint:
|
|||||||
name: "Paused Message"
|
name: "Paused Message"
|
||||||
description: >
|
description: >
|
||||||
Message sent when cycle is paused.
|
Message sent when cycle is paused.
|
||||||
Variables: {{ appliance_name }}, {{ remaining }}
|
Variables: `{appliance_name}`, `{remaining}`
|
||||||
default: "⏸️ {{ appliance_name }}: пауза. Осталось: {{ remaining }}."
|
default: "⏸️ {appliance_name}: пауза. Осталось: {remaining}."
|
||||||
selector:
|
selector:
|
||||||
text:
|
text:
|
||||||
multiline: true
|
multiline: true
|
||||||
@@ -252,8 +252,8 @@ blueprint:
|
|||||||
name: "Resumed Message"
|
name: "Resumed Message"
|
||||||
description: >
|
description: >
|
||||||
Message sent when cycle resumes.
|
Message sent when cycle resumes.
|
||||||
Variables: {{ appliance_name }}, {{ remaining }}
|
Variables: `{appliance_name}`, `{remaining}`
|
||||||
default: "▶️ {{ appliance_name }}: продолжение. Осталось: {{ remaining }}."
|
default: "▶️ {appliance_name}: продолжение. Осталось: {remaining}."
|
||||||
selector:
|
selector:
|
||||||
text:
|
text:
|
||||||
multiline: true
|
multiline: true
|
||||||
@@ -262,8 +262,8 @@ blueprint:
|
|||||||
name: "Energy Report Message"
|
name: "Energy Report Message"
|
||||||
description: >
|
description: >
|
||||||
Appended to completion message with energy stats.
|
Appended to completion message with energy stats.
|
||||||
Variables: {{ energy_kwh }}, {{ energy_cost }}
|
Variables: `{energy_kwh}`, `{energy_cost}`
|
||||||
default: " Потребление: {{ energy_kwh }} kWh."
|
default: " Потребление: {energy_kwh} kWh."
|
||||||
selector:
|
selector:
|
||||||
text:
|
text:
|
||||||
multiline: true
|
multiline: true
|
||||||
@@ -608,13 +608,13 @@ action:
|
|||||||
sequence:
|
sequence:
|
||||||
- service: persistent_notification.create
|
- service: persistent_notification.create
|
||||||
data:
|
data:
|
||||||
title: "Debug - {{ appliance_name }}"
|
title: "Debug - {appliance_name}"
|
||||||
message: >
|
message: >
|
||||||
Trigger: {{ trigger.entity_id }}
|
Trigger: {{ trigger.entity_id }}
|
||||||
Run State: {{ run_state }}
|
Run State: {{ run_state }}
|
||||||
Is Running: {{ is_running }}
|
Is Running: {{ is_running }}
|
||||||
Is Paused: {{ is_paused }}
|
Is Paused: {{ is_paused }}
|
||||||
Remaining: {{ remaining }}
|
Remaining: {remaining}
|
||||||
Remaining Minutes: {{ remaining_time_in_minutes }}
|
Remaining Minutes: {{ remaining_time_in_minutes }}
|
||||||
Power: {{ current_power }} W
|
Power: {{ current_power }} W
|
||||||
Start Sent: {{ automation_state.get(state_notification_about_start_sent, false) }}
|
Start Sent: {{ automation_state.get(state_notification_about_start_sent, false) }}
|
||||||
@@ -640,7 +640,7 @@ action:
|
|||||||
- variables:
|
- variables:
|
||||||
startup_info_sensors: !input startup_info_sensors
|
startup_info_sensors: !input startup_info_sensors
|
||||||
startup_info_texts: !input startup_info_texts
|
startup_info_texts: !input startup_info_texts
|
||||||
# Build sensor details string for the {{ details }} placeholder
|
# Build sensor details string for the `{details}` placeholder
|
||||||
details: >
|
details: >
|
||||||
{% set ns = namespace(text = '') %}
|
{% set ns = namespace(text = '') %}
|
||||||
{% for i in range(startup_info_sensors | count) %}
|
{% for i in range(startup_info_sensors | count) %}
|
||||||
@@ -652,10 +652,10 @@ action:
|
|||||||
# Render the message template with available variables
|
# Render the message template with available variables
|
||||||
message: >
|
message: >
|
||||||
{% set tpl = message_start_template %}
|
{% set tpl = message_start_template %}
|
||||||
{{ tpl | replace('{{ appliance_name }}', appliance_name)
|
{{ tpl | replace('{appliance_name}', appliance_name)
|
||||||
| replace('{{ remaining }}', remaining)
|
| replace('{remaining}', remaining)
|
||||||
| replace('{{ estimated_end }}', est_end)
|
| replace('{estimated_end}', est_end)
|
||||||
| replace('{{ details }}', details) }}
|
| replace('{details}', details) }}
|
||||||
|
|
||||||
# Send start notification
|
# Send start notification
|
||||||
- service: notify.send_message
|
- service: notify.send_message
|
||||||
@@ -684,11 +684,11 @@ action:
|
|||||||
sequence:
|
sequence:
|
||||||
- service: persistent_notification.create
|
- service: persistent_notification.create
|
||||||
data:
|
data:
|
||||||
title: "{{ appliance_name }} - START"
|
title: "{appliance_name} - START"
|
||||||
message: >
|
message: >
|
||||||
Action: CYCLE STARTED
|
Action: CYCLE STARTED
|
||||||
Time: {{ now().strftime('%H:%M:%S') }}
|
Time: {{ now().strftime('%H:%M:%S') }}
|
||||||
Duration: {{ remaining }}
|
Duration: {remaining}
|
||||||
Estimated End: {{ estimated_end_time }}
|
Estimated End: {{ estimated_end_time }}
|
||||||
|
|
||||||
# -----------------------------------------------------------------------
|
# -----------------------------------------------------------------------
|
||||||
@@ -717,15 +717,16 @@ action:
|
|||||||
energy_report: >
|
energy_report: >
|
||||||
{% if power_sensor | length > 0 and energy_kwh > 0 %}
|
{% if power_sensor | length > 0 and energy_kwh > 0 %}
|
||||||
{% set tpl = message_energy_report_template %}
|
{% set tpl = message_energy_report_template %}
|
||||||
{{ tpl | replace('{{ energy_kwh }}', energy_kwh | string)
|
{{ tpl | replace('{energy_kwh}', energy_kwh | string)
|
||||||
| replace('{{ energy_cost }}', energy_cost | string) }}
|
| replace('{energy_cost}', energy_cost | string) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ '' }}
|
{{ '' }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
# Render the message template with available variables
|
# Render the message template with available variables
|
||||||
message: >
|
message: >
|
||||||
{% set tpl = message_completed_template %}
|
{% set tpl = message_completed_template %}
|
||||||
{{ tpl | replace('{{ appliance_name }}', appliance_name) }}{{ energy_report }}
|
{{ tpl | replace('{appliance_name}', appliance_name)
|
||||||
|
}}{{ energy_report }}
|
||||||
|
|
||||||
# Send completion notification
|
# Send completion notification
|
||||||
- service: notify.send_message
|
- service: notify.send_message
|
||||||
@@ -756,11 +757,11 @@ action:
|
|||||||
sequence:
|
sequence:
|
||||||
- service: persistent_notification.create
|
- service: persistent_notification.create
|
||||||
data:
|
data:
|
||||||
title: "{{ appliance_name }} - COMPLETE"
|
title: "{appliance_name} - COMPLETE"
|
||||||
message: >
|
message: >
|
||||||
Action: CYCLE COMPLETED
|
Action: CYCLE COMPLETED
|
||||||
Time: {{ now().strftime('%H:%M:%S') }}
|
Time: {{ now().strftime('%H:%M:%S') }}
|
||||||
Energy Used: {{ energy_kwh }} kWh
|
Energy Used: {energy_kwh} kWh
|
||||||
|
|
||||||
# -----------------------------------------------------------------------
|
# -----------------------------------------------------------------------
|
||||||
# CASE 3: Preparation Mode Started
|
# CASE 3: Preparation Mode Started
|
||||||
@@ -787,7 +788,8 @@ action:
|
|||||||
# Render the message template with available variables
|
# Render the message template with available variables
|
||||||
message: >
|
message: >
|
||||||
{% set tpl = message_preparation_template %}
|
{% set tpl = message_preparation_template %}
|
||||||
{{ tpl | replace('{{ appliance_name }}', appliance_name) }}
|
{{ tpl | replace('{appliance_name}', appliance_name)
|
||||||
|
}}
|
||||||
|
|
||||||
# Send preparation notification
|
# Send preparation notification
|
||||||
- service: notify.send_message
|
- service: notify.send_message
|
||||||
@@ -813,8 +815,8 @@ action:
|
|||||||
# Render the message template with available variables
|
# Render the message template with available variables
|
||||||
message: >
|
message: >
|
||||||
{% set tpl = message_error_template %}
|
{% set tpl = message_error_template %}
|
||||||
{{ tpl | replace('{{ appliance_name }}', appliance_name)
|
{{ tpl | replace('{appliance_name}', appliance_name)
|
||||||
| replace('{{ error }}', error) }}
|
| replace('{error}', error) }}
|
||||||
|
|
||||||
# Send error notification
|
# Send error notification
|
||||||
- service: notify.send_message
|
- service: notify.send_message
|
||||||
@@ -851,8 +853,8 @@ action:
|
|||||||
# Render the message template with available variables
|
# Render the message template with available variables
|
||||||
message: >
|
message: >
|
||||||
{% set tpl = message_almost_done_template %}
|
{% set tpl = message_almost_done_template %}
|
||||||
{{ tpl | replace('{{ appliance_name }}', appliance_name)
|
{{ tpl | replace('{appliance_name}', appliance_name)
|
||||||
| replace('{{ minutes }}', minutes | string) }}
|
| replace('{minutes}', minutes | string) }}
|
||||||
|
|
||||||
# Send "almost done" notification
|
# Send "almost done" notification
|
||||||
- service: notify.send_message
|
- service: notify.send_message
|
||||||
@@ -879,9 +881,9 @@ action:
|
|||||||
# Render the message template with available variables
|
# Render the message template with available variables
|
||||||
message: >
|
message: >
|
||||||
{% set tpl = message_tub_clean_template %}
|
{% set tpl = message_tub_clean_template %}
|
||||||
{{ tpl | replace('{{ appliance_name }}', appliance_name)
|
{{ tpl | replace('{appliance_name}', appliance_name)
|
||||||
| replace('{{ tub_count }}', tub_count | string)
|
| replace('{tub_count}', tub_count | string)
|
||||||
| replace('{{ tub_threshold }}', tub_threshold | string) }}
|
| replace('{tub_threshold}', tub_threshold | string) }}
|
||||||
|
|
||||||
# Send tub cleaning reminder
|
# Send tub cleaning reminder
|
||||||
- service: notify.send_message
|
- service: notify.send_message
|
||||||
@@ -916,10 +918,11 @@ action:
|
|||||||
{{ automation_state_global | combine({ automation_state_key: new_automation_state }) | tojson }}
|
{{ automation_state_global | combine({ automation_state_key: new_automation_state }) | tojson }}
|
||||||
|
|
||||||
- variables:
|
- variables:
|
||||||
|
# Render the message template with available variables
|
||||||
message: >
|
message: >
|
||||||
{% set tpl = message_paused_template %}
|
{% set tpl = message_paused_template %}
|
||||||
{{ tpl | replace('{{ appliance_name }}', appliance_name)
|
{{ tpl | replace('{appliance_name}', appliance_name)
|
||||||
| replace('{{ remaining }}', remaining) }}
|
| replace('{remaining}', remaining) }}
|
||||||
|
|
||||||
# Send pause notification
|
# Send pause notification
|
||||||
- service: notify.send_message
|
- service: notify.send_message
|
||||||
@@ -934,11 +937,11 @@ action:
|
|||||||
sequence:
|
sequence:
|
||||||
- service: persistent_notification.create
|
- service: persistent_notification.create
|
||||||
data:
|
data:
|
||||||
title: "{{ appliance_name }} - PAUSED"
|
title: "{appliance_name} - PAUSED"
|
||||||
message: >
|
message: >
|
||||||
Action: CYCLE PAUSED
|
Action: CYCLE PAUSED
|
||||||
Time: {{ now().strftime('%H:%M:%S') }}
|
Time: {{ now().strftime('%H:%M:%S') }}
|
||||||
Remaining: {{ remaining }}
|
Remaining: {remaining}
|
||||||
|
|
||||||
# -----------------------------------------------------------------------
|
# -----------------------------------------------------------------------
|
||||||
# CASE 8: Cycle Resumed
|
# CASE 8: Cycle Resumed
|
||||||
@@ -964,10 +967,11 @@ action:
|
|||||||
{{ automation_state_global | combine({ automation_state_key: new_automation_state }) | tojson }}
|
{{ automation_state_global | combine({ automation_state_key: new_automation_state }) | tojson }}
|
||||||
|
|
||||||
- variables:
|
- variables:
|
||||||
|
# Render the message template with available variables
|
||||||
message: >
|
message: >
|
||||||
{% set tpl = message_resumed_template %}
|
{% set tpl = message_resumed_template %}
|
||||||
{{ tpl | replace('{{ appliance_name }}', appliance_name)
|
{{ tpl | replace('{appliance_name}', appliance_name)
|
||||||
| replace('{{ remaining }}', remaining) }}
|
| replace('{remaining}', remaining) }}
|
||||||
|
|
||||||
# Send resume notification
|
# Send resume notification
|
||||||
- service: notify.send_message
|
- service: notify.send_message
|
||||||
@@ -982,11 +986,11 @@ action:
|
|||||||
sequence:
|
sequence:
|
||||||
- service: persistent_notification.create
|
- service: persistent_notification.create
|
||||||
data:
|
data:
|
||||||
title: "{{ appliance_name }} - RESUMED"
|
title: "{appliance_name} - RESUMED"
|
||||||
message: >
|
message: >
|
||||||
Action: CYCLE RESUMED
|
Action: CYCLE RESUMED
|
||||||
Time: {{ now().strftime('%H:%M:%S') }}
|
Time: {{ now().strftime('%H:%M:%S') }}
|
||||||
Remaining: {{ remaining }}
|
Remaining: {remaining}
|
||||||
|
|
||||||
# -----------------------------------------------------------------------
|
# -----------------------------------------------------------------------
|
||||||
# CASE 9: Power Sample (Accumulate Energy)
|
# CASE 9: Power Sample (Accumulate Energy)
|
||||||
|
|||||||
Reference in New Issue
Block a user