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