automations.yaml

This commit is contained in:
Home Assistant Version Control
2026-09-27 03:40:23 +00:00
parent eea1f9151d
commit da33f0499d
+18 -40
View File
@@ -3507,9 +3507,10 @@
entity_id: counter.octoprint_failed_prints entity_id: counter.octoprint_failed_prints
mode: single mode: single
- id: '1787462132503' - id: '1787462132503'
alias: 3D Print Complete Snapshot alias: 3D Print Complete Snapshot - Telegram
description: Sends a notification with a SparkX i7 camera snapshot when a print description: Sends a Telegram photo with a SparkX i7 camera snapshot when a print
finishes successfully. finishes successfully. Mobile completion notifications are handled by the Creality
integration.
triggers: triggers:
- entity_id: sensor.sparkx_i7_print_status - entity_id: sensor.sparkx_i7_print_status
from: printing from: printing
@@ -3517,48 +3518,25 @@
trigger: state trigger: state
actions: actions:
- variables: - variables:
completion_message: '{% set f = trigger.to_state.attributes.get(''file'', '''') completion_message: '{% set file = trigger.to_state.attributes.get(''file'',
%} {% set file = ''Print'' if f in ['''', none, ''unknown'', ''unavailable''] '''') %} {% set name = ''Print'' if file in ['''', none, ''unknown'', ''unavailable'']
else f.split(''/'')[-1].replace(''.gcode'', '''') %} {% set s = trigger.to_state.attributes.get(''job_time_s'', else file.split(''/'')[-1].replace(''.gcode'', '''') %} {% set seconds = trigger.to_state.attributes.get(''job_time_s'',
0) | int(0) %} {{ file }} finished successfully at {{ now().strftime(''%I:%M 0) | int(0) %} {{ name }} finished successfully at {{ now().strftime(''%I:%M
%p'').lstrip(''0'') }}. Total time: {% if s >= 3600 %}{{ s // 3600 }}h {{ %p'').lstrip(''0'') }}. Total time: {% if seconds >= 3600 %}{{ seconds //
((s % 3600) // 60) }}m{% else %}{{ ((s % 3600) // 60) }}m{% endif %}' 3600 }}h {{ ((seconds % 3600) // 60) }}m {% else %}{{ ((seconds % 3600) //
60) }}m{% endif %}'
- action: camera.snapshot - action: camera.snapshot
data: data:
filename: /config/www/sparkx_i7_complete_snapshot.jpg filename: /config/www/sparkx_i7_complete_snapshot.jpg
target: target:
entity_id: camera.sparkx_i7_printer_camera entity_id: camera.sparkx_i7_printer_camera
- parallel: - action: telegram_bot.send_photo
- action: notify.mobile_app_sm_f956w data:
data: caption: '{{ completion_message }}'
data: file: /config/www/sparkx_i7_complete_snapshot.jpg
image: /local/sparkx_i7_complete_snapshot.jpg parse_mode: plain_text
message: '{{ completion_message }}' target:
title: 3D print complete entity_id: notify.franco
- action: notify.mobile_app_motorola_one_vision
data:
data:
image: /local/sparkx_i7_complete_snapshot.jpg
message: '{{ completion_message }}'
title: 3D print complete
- action: notify.mobile_app_francos_ipad
data:
data:
image: /local/sparkx_i7_complete_snapshot.jpg
message: '{{ completion_message }}'
title: 3D print complete
- action: notify.mobile_app_sm_t387w
data:
data:
image: /local/sparkx_i7_complete_snapshot.jpg
message: '{{ completion_message }}'
title: 3D print complete
- action: telegram_bot.send_photo
data:
caption: '{{ completion_message }}'
entity_id: notify.franco
file: /config/www/sparkx_i7_complete_snapshot.jpg
parse_mode: plain_text
mode: single mode: single
- id: '1787462157568' - id: '1787462157568'
alias: 3D Print Early Layers Snapshot alias: 3D Print Early Layers Snapshot