automations.yaml, zigbee2mqtt/state.json

This commit is contained in:
Home Assistant Version Control
2026-10-01 15:10:33 +00:00
parent 8961659a01
commit 4dee0a645f
2 changed files with 71 additions and 67 deletions
+51 -47
View File
@@ -3540,67 +3540,71 @@
mode: single mode: single
- id: '1787462157568' - id: '1787462157568'
alias: 3D Print Early Layers Snapshot alias: 3D Print Early Layers Snapshot
description: Sends a SparkX i7 camera snapshot once per print when Z crosses 1.0 description: Telegram-only snapshots from all 3 printer cameras. Fires when Z crosses
mm while printing. 1.0 mm, then again at 25%, 50% and 75% print progress. One set of photos per milestone,
sent as a Telegram album.
triggers: triggers:
- above: 1 - above: 1
entity_id: sensor.sparkx_i7_position_z entity_id: sensor.sparkx_i7_position_z
trigger: numeric_state 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: conditions:
- condition: state - condition: state
entity_id: sensor.sparkx_i7_print_status entity_id: sensor.sparkx_i7_print_status
state: printing state: printing
actions: actions:
- variables: - variables:
early_message: '{% set f = state_attr(''sensor.sparkx_i7_print_status'', ''file'') message: '{% set file = state_attr(''sensor.sparkx_i7_print_status'', ''file'')
or '''' %} {% set file = ''No file'' if f in ['''', none, ''unknown'', ''unavailable''] or '''' %} {% set name = ''Print'' if file in ['''', none, ''unknown'', ''unavailable'']
else f.split(''/'')[-1].replace(''.gcode'', '''') %} {% set pct = states(''sensor.sparkx_i7_print_progress'') else file.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 left = states(''sensor.sparkx_i7_print_time_left'') | int(0)
int(0) %} {% set remaining = states(''sensor.sparkx_i7_print_time_left'') %} 3D print · {{ milestone }} · {{ name }} at {{ pct }}%{% if left > 0 %}
| int(0) %} {% set finish = (now() + timedelta(seconds=remaining)).strftime(''%I:%M · {{ (left // 3600) }}h {{ ((left % 3600) // 60) }}m left{% endif %}'
%p'').lstrip(''0'') if remaining > 0 else ''unknown'' %} {{ file }} Progress: milestone: '{% if trigger.entity_id == ''sensor.sparkx_i7_position_z'' %} First
{{ pct }}% · Elapsed: {% if elapsed >= 3600 %}{{ elapsed // 3600 }}h {{ ((elapsed layers (Z {{ trigger.to_state.state | float(1) }} mm) {% elif trigger.to_state.state
% 3600) // 60) }}m{% else %}{{ ((elapsed % 3600) // 60) }}m{% endif %} · Left: | float(0) >= 75 %} 75% complete {% elif trigger.to_state.state | float(0)
{% if remaining > 0 %}{% if remaining >= 3600 %}{{ remaining // 3600 }}h {{ >= 50 %} 50% complete {% else %} 25% complete {% endif %}'
((remaining % 3600) // 60) }}m{% else %}{{ ((remaining % 3600) // 60) }}m{% tag: '{% if trigger.entity_id == ''sensor.sparkx_i7_position_z'' %} z1 {% else
endif %}{% else %}unknown{% endif %} Est. finish: {{ finish }}' %} p{{ trigger.above | int }} {% endif %}'
- action: camera.snapshot
data:
filename: /config/www/sparkx_i7_early_snapshot.jpg
target:
entity_id: camera.sparkx_i7_printer_camera
- parallel: - parallel:
- action: notify.mobile_app_sm_f956w - action: camera.snapshot
data: data:
data: filename: /config/www/sparkx_{{ tag }}.jpg
image: /local/sparkx_i7_early_snapshot.jpg target:
message: '{{ early_message }}' entity_id: camera.sparkx_i7_printer_camera
title: 3D print early check - action: camera.snapshot
- action: notify.mobile_app_motorola_one_vision
data: data:
data: filename: /config/www/ender5_{{ tag }}.jpg
image: /local/sparkx_i7_early_snapshot.jpg target:
message: '{{ early_message }}' entity_id: camera.endercamera_duckdns_org
title: 3D print early check - action: camera.snapshot
- action: notify.mobile_app_francos_ipad
data: data:
data: filename: /config/www/ender_cam2_{{ tag }}.jpg
image: /local/sparkx_i7_early_snapshot.jpg target:
message: '{{ early_message }}' entity_id: camera.endercamera2_duckdns_org
title: 3D print early check - action: telegram_bot.send_media_group
- action: notify.mobile_app_sm_t387w data:
data: caption: '{{ message }}'
data: media:
image: /local/sparkx_i7_early_snapshot.jpg - caption: SparkX i7
message: '{{ early_message }}' file: /config/www/sparkx_{{ tag }}.jpg
title: 3D print early check - caption: Ender 5 Pro
- action: telegram_bot.send_photo file: /config/www/ender5_{{ tag }}.jpg
data: - caption: Ender cam 2
caption: '{{ early_message }}' file: /config/www/ender_cam2_{{ tag }}.jpg
entity_id: notify.franco parse_mode: plain_text
file: /config/www/sparkx_i7_early_snapshot.jpg target:
parse_mode: plain_text entity_id: notify.franco
mode: single max: 4
mode: parallel
- id: '1787530101996' - id: '1787530101996'
alias: 'Alert: Thread node offline' alias: 'Alert: Thread node offline'
description: 'Early warning when a Matter-over-Thread device loses its mesh attachment description: 'Early warning when a Matter-over-Thread device loses its mesh attachment
+20 -20
View File
@@ -4,7 +4,7 @@
"state": "ON", "state": "ON",
"led_brightness": 100, "led_brightness": 100,
"countdown_to_turn_off": 0, "countdown_to_turn_off": 0,
"voltage": 120.5, "voltage": 120.3,
"countdown_to_turn_on": 0, "countdown_to_turn_on": 0,
"ac_frequency": 60, "ac_frequency": 60,
"power_factor": 0.14, "power_factor": 0.14,
@@ -22,15 +22,15 @@
}, },
"0xffffb40e0607af27": { "0xffffb40e0607af27": {
"state": "ON", "state": "ON",
"voltage": 120.3, "voltage": 120.1,
"ac_frequency": 60, "ac_frequency": 60,
"led_brightness": 100, "led_brightness": 100,
"countdown_to_turn_off": 0, "countdown_to_turn_off": 0,
"countdown_to_turn_on": 0, "countdown_to_turn_on": 0,
"power": 1.9, "power": 2,
"current": 0.09, "current": 0.09,
"energy": 50.9, "energy": 50.9,
"power_factor": 0.16, "power_factor": 0.17,
"update": { "update": {
"state": "idle", "state": "idle",
"installed_version": 268513381, "installed_version": 268513381,
@@ -47,8 +47,8 @@
"countdown_to_turn_off": 0, "countdown_to_turn_off": 0,
"voltage": 119.8, "voltage": 119.8,
"countdown_to_turn_on": 0, "countdown_to_turn_on": 0,
"energy": 96.36, "energy": 96.41,
"power_factor": 0.9, "power_factor": 0.2,
"ac_frequency": 60, "ac_frequency": 60,
"update": { "update": {
"state": "idle", "state": "idle",
@@ -58,8 +58,8 @@
"latest_release_notes": null "latest_release_notes": null
}, },
"linkquality": 145, "linkquality": 145,
"power": 85.7, "power": 0.2,
"current": 0.81, "current": 0.01,
"power_on_behavior": "on" "power_on_behavior": "on"
}, },
"0xb40e060fffe031e3": { "0xb40e060fffe031e3": {
@@ -74,12 +74,12 @@
"led_brightness": 100, "led_brightness": 100,
"countdown_to_turn_off": 0, "countdown_to_turn_off": 0,
"countdown_to_turn_on": 0, "countdown_to_turn_on": 0,
"voltage": 118.6, "voltage": 118.8,
"state": "ON", "state": "ON",
"ac_frequency": 60, "ac_frequency": 60,
"energy": 198.81, "energy": 198.89,
"power": 3.6, "power": 99.4,
"current": 0.05, "current": 0.9,
"power_factor": 0.94, "power_factor": 0.94,
"update": { "update": {
"state": "idle", "state": "idle",
@@ -96,12 +96,12 @@
"countdown_to_turn_off": 0, "countdown_to_turn_off": 0,
"countdown_to_turn_on": 0, "countdown_to_turn_on": 0,
"voltage": 120.1, "voltage": 120.1,
"energy": 96.06, "energy": 96.07,
"state": "ON", "state": "ON",
"power": 13.8, "power": 15.8,
"current": 0.21, "current": 0.25,
"ac_frequency": 60, "ac_frequency": 60,
"power_factor": 0.52, "power_factor": 0.5,
"update": { "update": {
"state": "idle", "state": "idle",
"installed_version": 268513381, "installed_version": 268513381,
@@ -114,10 +114,10 @@
}, },
"0xffffb40e060895b3": { "0xffffb40e060895b3": {
"state": "ON", "state": "ON",
"voltage": 120.3, "voltage": 120,
"ac_frequency": 60, "ac_frequency": 60,
"energy": 13.31, "energy": 13.31,
"current": 0.02, "current": 0.01,
"power": 0.1, "power": 0.1,
"power_factor": 0.11, "power_factor": 0.11,
"linkquality": 116, "linkquality": 116,
@@ -136,14 +136,14 @@
"0xffffb40e0608864e": { "0xffffb40e0608864e": {
"led_brightness": 100, "led_brightness": 100,
"countdown_to_turn_off": 0, "countdown_to_turn_off": 0,
"voltage": 120.6, "voltage": 120.4,
"energy": 31.69, "energy": 31.69,
"countdown_to_turn_on": 0, "countdown_to_turn_on": 0,
"state": "ON", "state": "ON",
"current": 0.02, "current": 0.02,
"ac_frequency": 60, "ac_frequency": 60,
"power": 0.4, "power": 0.4,
"power_factor": 0.19, "power_factor": 0.14,
"update": { "update": {
"state": "idle", "state": "idle",
"installed_version": 268513381, "installed_version": 268513381,