automations.yaml, zigbee2mqtt/state.json
This commit is contained in:
@@ -4128,3 +4128,88 @@
|
||||
target:
|
||||
entity_id: input_boolean.3d_printer_running
|
||||
mode: single
|
||||
- id: '1789900000001'
|
||||
alias: 3D Print - Safe to Remove
|
||||
description: After a successful SparkX i7 print, wait for the bed and nozzle to
|
||||
stay at or below 30 degrees for 5 minutes, then notify all existing print devices.
|
||||
triggers:
|
||||
- entity_id: sensor.sparkx_i7_print_status
|
||||
from: printing
|
||||
id: print_completed
|
||||
to: completed
|
||||
trigger: state
|
||||
- entity_id: sensor.sparkx_i7_print_status
|
||||
id: new_print
|
||||
to: printing
|
||||
trigger: state
|
||||
actions:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id: print_completed
|
||||
sequence:
|
||||
- variables:
|
||||
print_name: '{% set file = trigger.to_state.attributes.get(''file'', '''')
|
||||
%} {% if file in ['''', none, ''unknown'', ''unavailable''] %}The print
|
||||
{% else %}{{ file.split(''/'')[-1].replace(''.gcode'', '''') }} {% endif
|
||||
%}'
|
||||
- repeat:
|
||||
sequence:
|
||||
- continue_on_timeout: false
|
||||
timeout: 02:00:00
|
||||
wait_template: '{{ is_state(''sensor.sparkx_i7_print_status'', ''completed'')
|
||||
and states(''sensor.sparkx_i7_bed_temperature'') | float(100) <= 30
|
||||
and states(''sensor.sparkx_i7_nozzle_temperature'') | float(300) <=
|
||||
30 }}'
|
||||
- delay:
|
||||
minutes: 5
|
||||
- if:
|
||||
- condition: template
|
||||
value_template: '{{ is_state(''sensor.sparkx_i7_print_status'', ''completed'')
|
||||
and states(''sensor.sparkx_i7_bed_temperature'') | float(100) <= 30
|
||||
and states(''sensor.sparkx_i7_nozzle_temperature'') | float(300) <=
|
||||
30 }}'
|
||||
then:
|
||||
- variables:
|
||||
bed_temp: '{{ states(''sensor.sparkx_i7_bed_temperature'') | float(0)
|
||||
| round(1) }}'
|
||||
nozzle_temp: '{{ states(''sensor.sparkx_i7_nozzle_temperature'') |
|
||||
float(0) | round(1) }}'
|
||||
safe_message: '{{ print_name }} is cool enough to remove. Bed: {{
|
||||
bed_temp }} °C, nozzle: {{ nozzle_temp }} °C.'
|
||||
- action: notify.send_message
|
||||
data:
|
||||
message: '{{ safe_message }}'
|
||||
title: 3D print safe to remove
|
||||
target:
|
||||
entity_id: notify.sm_f956w
|
||||
- action: notify.send_message
|
||||
data:
|
||||
message: '{{ safe_message }}'
|
||||
title: 3D print safe to remove
|
||||
target:
|
||||
entity_id: notify.motorola_one_vision
|
||||
- action: notify.send_message
|
||||
data:
|
||||
message: '{{ safe_message }}'
|
||||
title: 3D print safe to remove
|
||||
target:
|
||||
entity_id: notify.francos_ipad
|
||||
- action: notify.send_message
|
||||
data:
|
||||
message: '{{ safe_message }}'
|
||||
title: 3D print safe to remove
|
||||
target:
|
||||
entity_id: notify.sm_t387w
|
||||
- action: notify.send_message
|
||||
data:
|
||||
message: '{{ safe_message }}'
|
||||
title: 3D print safe to remove
|
||||
target:
|
||||
entity_id: notify.franco
|
||||
- stop: Safe-to-remove notification sent.
|
||||
while:
|
||||
- condition: template
|
||||
value_template: '{{ is_state(''sensor.sparkx_i7_print_status'', ''completed'')
|
||||
}}'
|
||||
mode: restart
|
||||
|
||||
Reference in New Issue
Block a user