diff --git a/automations.yaml b/automations.yaml index a3d99adc..c5fc758f 100644 --- a/automations.yaml +++ b/automations.yaml @@ -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 diff --git a/zigbee2mqtt/state.json b/zigbee2mqtt/state.json index e6b20ba0..f832794a 100644 --- a/zigbee2mqtt/state.json +++ b/zigbee2mqtt/state.json @@ -4,7 +4,7 @@ "state": "ON", "led_brightness": 100, "countdown_to_turn_off": 0, - "voltage": 120.5, + "voltage": 120.3, "countdown_to_turn_on": 0, "ac_frequency": 60, "power_factor": 0.14, @@ -22,15 +22,15 @@ }, "0xffffb40e0607af27": { "state": "ON", - "voltage": 120.3, + "voltage": 120.1, "ac_frequency": 60, "led_brightness": 100, "countdown_to_turn_off": 0, "countdown_to_turn_on": 0, - "power": 1.9, + "power": 2, "current": 0.09, "energy": 50.9, - "power_factor": 0.16, + "power_factor": 0.17, "update": { "state": "idle", "installed_version": 268513381, @@ -47,8 +47,8 @@ "countdown_to_turn_off": 0, "voltage": 119.8, "countdown_to_turn_on": 0, - "energy": 96.36, - "power_factor": 0.9, + "energy": 96.41, + "power_factor": 0.2, "ac_frequency": 60, "update": { "state": "idle", @@ -58,8 +58,8 @@ "latest_release_notes": null }, "linkquality": 145, - "power": 85.7, - "current": 0.81, + "power": 0.2, + "current": 0.01, "power_on_behavior": "on" }, "0xb40e060fffe031e3": { @@ -74,12 +74,12 @@ "led_brightness": 100, "countdown_to_turn_off": 0, "countdown_to_turn_on": 0, - "voltage": 118.6, + "voltage": 118.8, "state": "ON", "ac_frequency": 60, - "energy": 198.81, - "power": 3.6, - "current": 0.05, + "energy": 198.89, + "power": 99.4, + "current": 0.9, "power_factor": 0.94, "update": { "state": "idle", @@ -96,12 +96,12 @@ "countdown_to_turn_off": 0, "countdown_to_turn_on": 0, "voltage": 120.1, - "energy": 96.06, + "energy": 96.07, "state": "ON", - "power": 13.8, - "current": 0.21, + "power": 15.8, + "current": 0.25, "ac_frequency": 60, - "power_factor": 0.52, + "power_factor": 0.5, "update": { "state": "idle", "installed_version": 268513381, @@ -114,10 +114,10 @@ }, "0xffffb40e060895b3": { "state": "ON", - "voltage": 120.3, + "voltage": 120, "ac_frequency": 60, "energy": 13.31, - "current": 0.02, + "current": 0.01, "power": 0.1, "power_factor": 0.11, "linkquality": 116, @@ -136,14 +136,14 @@ "0xffffb40e0608864e": { "led_brightness": 100, "countdown_to_turn_off": 0, - "voltage": 120.6, + "voltage": 120.4, "energy": 31.69, "countdown_to_turn_on": 0, "state": "ON", "current": 0.02, "ac_frequency": 60, "power": 0.4, - "power_factor": 0.19, + "power_factor": 0.14, "update": { "state": "idle", "installed_version": 268513381,