This commit is contained in:
Home Assistant Version Control committed 2026-10-03 15:17:10 +00:00
1 parent 820b1d20b0
commit 063b42da6f
3 files changed
+84 -5

No files matched your search

@@ -0,0 +1,78 @@
# ha_mcp_backup
schema_version: 1
domain: automation
entity_id: automation.3d_print_complete_snapshot
captured: '2026-10-03T15:17:03.603772+00:00'
tool: ha_config_set_automation
config:
id: '1787462132503'
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
to: completed
trigger: state
actions:
- variables:
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
- variables:
sparkx_needs_light: '{{ not is_state(''light.sparkx_i7_light'', ''on'') }}'
bedroom_needs_light: '{{ not is_state(''light.bedroom_lamp_2'', ''on'') }}'
- if:
- condition: template
value_template: '{{ sparkx_needs_light }}'
then:
- action: light.turn_on
continue_on_error: true
target:
entity_id: light.sparkx_i7_light
- if:
- condition: template
value_template: '{{ bedroom_needs_light }}'
then:
- action: light.turn_on
continue_on_error: true
target:
entity_id: light.bedroom_lamp_2
- delay:
seconds: 3
- delay:
seconds: 2
- if:
- condition: template
value_template: '{{ sparkx_needs_light }}'
then:
- action: light.turn_off
continue_on_error: true
target:
entity_id: light.sparkx_i7_light
- if:
- condition: template
value_template: '{{ bedroom_needs_light }}'
then:
- action: light.turn_off
continue_on_error: true
target:
entity_id: light.bedroom_lamp_2
- 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