automations.yaml, zigbee2mqtt/state.json
This commit is contained in:
+51
-47
@@ -3540,67 +3540,71 @@
|
||||
mode: single
|
||||
- id: '1787462157568'
|
||||
alias: 3D Print Early Layers Snapshot
|
||||
description: Sends a SparkX i7 camera snapshot once per print when Z crosses 1.0
|
||||
mm while printing.
|
||||
description: Telegram-only snapshots from all 3 printer cameras. Fires when Z crosses
|
||||
1.0 mm, then again at 25%, 50% and 75% print progress. One set of photos per milestone,
|
||||
sent as a Telegram album.
|
||||
triggers:
|
||||
- above: 1
|
||||
entity_id: sensor.sparkx_i7_position_z
|
||||
trigger: numeric_state
|
||||
- above: 25
|
||||
entity_id: sensor.sparkx_i7_print_progress
|
||||
trigger: numeric_state
|
||||
- above: 50
|
||||
entity_id: sensor.sparkx_i7_print_progress
|
||||
trigger: numeric_state
|
||||
- above: 75
|
||||
entity_id: sensor.sparkx_i7_print_progress
|
||||
trigger: numeric_state
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: sensor.sparkx_i7_print_status
|
||||
state: printing
|
||||
actions:
|
||||
- variables:
|
||||
early_message: '{% set f = state_attr(''sensor.sparkx_i7_print_status'', ''file'')
|
||||
or '''' %} {% set file = ''No file'' if f in ['''', none, ''unknown'', ''unavailable'']
|
||||
else f.split(''/'')[-1].replace(''.gcode'', '''') %} {% set pct = states(''sensor.sparkx_i7_print_progress'')
|
||||
| int(0) %} {% set elapsed = states(''sensor.sparkx_i7_print_job_time'') |
|
||||
int(0) %} {% set remaining = states(''sensor.sparkx_i7_print_time_left'')
|
||||
| int(0) %} {% set finish = (now() + timedelta(seconds=remaining)).strftime(''%I:%M
|
||||
%p'').lstrip(''0'') if remaining > 0 else ''unknown'' %} {{ file }} Progress:
|
||||
{{ pct }}% · Elapsed: {% if elapsed >= 3600 %}{{ elapsed // 3600 }}h {{ ((elapsed
|
||||
% 3600) // 60) }}m{% else %}{{ ((elapsed % 3600) // 60) }}m{% endif %} · Left:
|
||||
{% if remaining > 0 %}{% if remaining >= 3600 %}{{ remaining // 3600 }}h {{
|
||||
((remaining % 3600) // 60) }}m{% else %}{{ ((remaining % 3600) // 60) }}m{%
|
||||
endif %}{% else %}unknown{% endif %} Est. finish: {{ finish }}'
|
||||
- action: camera.snapshot
|
||||
data:
|
||||
filename: /config/www/sparkx_i7_early_snapshot.jpg
|
||||
target:
|
||||
entity_id: camera.sparkx_i7_printer_camera
|
||||
message: '{% set file = state_attr(''sensor.sparkx_i7_print_status'', ''file'')
|
||||
or '''' %} {% set name = ''Print'' if file in ['''', none, ''unknown'', ''unavailable'']
|
||||
else file.split(''/'')[-1].replace(''.gcode'', '''') %} {% set pct = states(''sensor.sparkx_i7_print_progress'')
|
||||
| int(0) %} {% set left = states(''sensor.sparkx_i7_print_time_left'') | int(0)
|
||||
%} 3D print · {{ milestone }} · {{ name }} at {{ pct }}%{% if left > 0 %}
|
||||
· {{ (left // 3600) }}h {{ ((left % 3600) // 60) }}m left{% endif %}'
|
||||
milestone: '{% if trigger.entity_id == ''sensor.sparkx_i7_position_z'' %} First
|
||||
layers (Z {{ trigger.to_state.state | float(1) }} mm) {% elif trigger.to_state.state
|
||||
| float(0) >= 75 %} 75% complete {% elif trigger.to_state.state | float(0)
|
||||
>= 50 %} 50% complete {% else %} 25% complete {% endif %}'
|
||||
tag: '{% if trigger.entity_id == ''sensor.sparkx_i7_position_z'' %} z1 {% else
|
||||
%} p{{ trigger.above | int }} {% endif %}'
|
||||
- parallel:
|
||||
- action: notify.mobile_app_sm_f956w
|
||||
- action: camera.snapshot
|
||||
data:
|
||||
data:
|
||||
image: /local/sparkx_i7_early_snapshot.jpg
|
||||
message: '{{ early_message }}'
|
||||
title: 3D print early check
|
||||
- action: notify.mobile_app_motorola_one_vision
|
||||
filename: /config/www/sparkx_{{ tag }}.jpg
|
||||
target:
|
||||
entity_id: camera.sparkx_i7_printer_camera
|
||||
- action: camera.snapshot
|
||||
data:
|
||||
data:
|
||||
image: /local/sparkx_i7_early_snapshot.jpg
|
||||
message: '{{ early_message }}'
|
||||
title: 3D print early check
|
||||
- action: notify.mobile_app_francos_ipad
|
||||
filename: /config/www/ender5_{{ tag }}.jpg
|
||||
target:
|
||||
entity_id: camera.endercamera_duckdns_org
|
||||
- action: camera.snapshot
|
||||
data:
|
||||
data:
|
||||
image: /local/sparkx_i7_early_snapshot.jpg
|
||||
message: '{{ early_message }}'
|
||||
title: 3D print early check
|
||||
- action: notify.mobile_app_sm_t387w
|
||||
data:
|
||||
data:
|
||||
image: /local/sparkx_i7_early_snapshot.jpg
|
||||
message: '{{ early_message }}'
|
||||
title: 3D print early check
|
||||
- action: telegram_bot.send_photo
|
||||
data:
|
||||
caption: '{{ early_message }}'
|
||||
entity_id: notify.franco
|
||||
file: /config/www/sparkx_i7_early_snapshot.jpg
|
||||
parse_mode: plain_text
|
||||
mode: single
|
||||
filename: /config/www/ender_cam2_{{ tag }}.jpg
|
||||
target:
|
||||
entity_id: camera.endercamera2_duckdns_org
|
||||
- action: telegram_bot.send_media_group
|
||||
data:
|
||||
caption: '{{ message }}'
|
||||
media:
|
||||
- caption: SparkX i7
|
||||
file: /config/www/sparkx_{{ tag }}.jpg
|
||||
- caption: Ender 5 Pro
|
||||
file: /config/www/ender5_{{ tag }}.jpg
|
||||
- caption: Ender cam 2
|
||||
file: /config/www/ender_cam2_{{ tag }}.jpg
|
||||
parse_mode: plain_text
|
||||
target:
|
||||
entity_id: notify.franco
|
||||
max: 4
|
||||
mode: parallel
|
||||
- id: '1787530101996'
|
||||
alias: 'Alert: Thread node offline'
|
||||
description: 'Early warning when a Matter-over-Thread device loses its mesh attachment
|
||||
|
||||
Reference in New Issue
Block a user