3 files
This commit is contained in:
1 parent
818daf9788
commit
0c886ae0d3
3 files changed
+113
-3
No files matched your search
+57
@@ -0,0 +1,57 @@
|
|||||||
|
# ha_mcp_backup
|
||||||
|
schema_version: 1
|
||||||
|
domain: automation
|
||||||
|
entity_id: automation.sparkx_i7_deduct_filament_in_spoolman_on_print_complete
|
||||||
|
captured: '2026-10-08T16:34:45.914807+00:00'
|
||||||
|
tool: ha_config_set_automation
|
||||||
|
config:
|
||||||
|
id: '1791477238729'
|
||||||
|
alias: SparkX i7 - Deduct filament in Spoolman on print complete
|
||||||
|
triggers:
|
||||||
|
- trigger: state
|
||||||
|
entity_id: sensor.sparkx_i7_print_status
|
||||||
|
from: printing
|
||||||
|
to: completed
|
||||||
|
conditions:
|
||||||
|
- condition: template
|
||||||
|
value_template: '{{ states(''sensor.sparkx_i7_filament_weight_estimated'') | float(0)
|
||||||
|
> 0 }}'
|
||||||
|
actions:
|
||||||
|
- variables:
|
||||||
|
weight: '{{ states(''sensor.sparkx_i7_filament_weight_estimated'') | float(0)
|
||||||
|
}}'
|
||||||
|
spool_id: '{{ states(''input_text.sparkx_i7_print_spool_latch'') | int(0) }}'
|
||||||
|
- choose:
|
||||||
|
- conditions:
|
||||||
|
condition: template
|
||||||
|
value_template: '{{ spool_id > 0 }}'
|
||||||
|
sequence:
|
||||||
|
- action: spoolman.use_spool_filament
|
||||||
|
data:
|
||||||
|
id: '{{ spool_id | int(0) }}'
|
||||||
|
use_weight: '{{ weight | float(0) }}'
|
||||||
|
- action: input_text.set_value
|
||||||
|
target:
|
||||||
|
entity_id: input_text.sparkx_i7_print_spool_latch
|
||||||
|
data:
|
||||||
|
value: ''
|
||||||
|
- conditions:
|
||||||
|
condition: template
|
||||||
|
value_template: '{{ spool_id <= 0 }}'
|
||||||
|
sequence:
|
||||||
|
- action: notify.persistent_notification
|
||||||
|
data:
|
||||||
|
title: Spoolman deduction skipped
|
||||||
|
message: "Print completed: {{ weight }} g used, but no Spoolman spool was\
|
||||||
|
\ latched for this print \u2014 nothing deducted."
|
||||||
|
- action: notify.mobile_app_francos_ipad
|
||||||
|
data:
|
||||||
|
title: Spoolman deduction skipped
|
||||||
|
message: "Print completed: {{ weight }} g used, but no Spoolman spool was\
|
||||||
|
\ latched for this print \u2014 nothing deducted."
|
||||||
|
- action: notify.mobile_app_sm_f956w
|
||||||
|
data:
|
||||||
|
title: Spoolman deduction skipped
|
||||||
|
message: "Print completed: {{ weight }} g used, but no Spoolman spool was\
|
||||||
|
\ latched for this print \u2014 nothing deducted."
|
||||||
|
mode: single
|
||||||
+53
@@ -0,0 +1,53 @@
|
|||||||
|
# ha_mcp_backup
|
||||||
|
schema_version: 1
|
||||||
|
domain: automation
|
||||||
|
entity_id: automation.sparkx_i7_latch_print_spool_for_spoolman
|
||||||
|
captured: '2026-10-08T16:34:46.060135+00:00'
|
||||||
|
tool: ha_config_set_automation
|
||||||
|
config:
|
||||||
|
id: '1791477238762'
|
||||||
|
alias: SparkX i7 - Latch print spool for Spoolman
|
||||||
|
triggers:
|
||||||
|
- trigger: state
|
||||||
|
entity_id: sensor.sparkx_i7_print_status
|
||||||
|
to: printing
|
||||||
|
- trigger: state
|
||||||
|
entity_id: sensor.sparkx_i7_active_filament_slot
|
||||||
|
- trigger: state
|
||||||
|
entity_id:
|
||||||
|
- sensor.sparkx_i7_cfs_box_1_slot_1_color
|
||||||
|
- sensor.sparkx_i7_cfs_box_1_slot_2_color
|
||||||
|
- sensor.sparkx_i7_cfs_box_1_slot_3_color
|
||||||
|
- sensor.sparkx_i7_cfs_box_1_slot_4_color
|
||||||
|
conditions:
|
||||||
|
- condition: state
|
||||||
|
entity_id: sensor.sparkx_i7_print_status
|
||||||
|
state: printing
|
||||||
|
actions:
|
||||||
|
- choose:
|
||||||
|
- conditions:
|
||||||
|
condition: template
|
||||||
|
value_template: '{{ trigger.entity_id == ''sensor.sparkx_i7_print_status''
|
||||||
|
}}'
|
||||||
|
sequence:
|
||||||
|
- action: input_text.set_value
|
||||||
|
target:
|
||||||
|
entity_id: input_text.sparkx_i7_print_spool_latch
|
||||||
|
data:
|
||||||
|
value: ''
|
||||||
|
- variables:
|
||||||
|
spool_id: "{%- set slot = states('sensor.sparkx_i7_active_filament_slot') -%}\n\
|
||||||
|
{%- set ce = 'sensor.sparkx_i7_cfs_' ~ (slot | lower | replace(' ', '_'))\
|
||||||
|
\ ~ '_color' -%}\n{%- set color = states(ce) | replace('#', '') | lower -%}\n\
|
||||||
|
{%- set ns = namespace(id = '') -%}\n{%- for e in integration_entities('spoolman')\
|
||||||
|
\ -%}\n {%- if e.endswith('_color_hex') and (states(e) | lower) == color\
|
||||||
|
\ -%}\n {%- set ns.id = states(e[:-10] ~ '_id') -%}\n {%- endif -%}\n\
|
||||||
|
{%- endfor -%}\n{{ ns.id }}"
|
||||||
|
- condition: template
|
||||||
|
value_template: '{{ spool_id not in ['''', ''unknown'', ''unavailable''] }}'
|
||||||
|
- action: input_text.set_value
|
||||||
|
target:
|
||||||
|
entity_id: input_text.sparkx_i7_print_spool_latch
|
||||||
|
data:
|
||||||
|
value: '{{ spool_id }}'
|
||||||
|
mode: single
|
||||||
+3
-3
@@ -4382,9 +4382,9 @@
|
|||||||
from: printing
|
from: printing
|
||||||
to: completed
|
to: completed
|
||||||
conditions:
|
conditions:
|
||||||
- condition: template
|
- condition: numeric_state
|
||||||
value_template: '{{ states(''sensor.sparkx_i7_filament_weight_estimated'') | float(0)
|
entity_id: sensor.sparkx_i7_filament_weight_estimated
|
||||||
> 0 }}'
|
above: 0
|
||||||
actions:
|
actions:
|
||||||
- variables:
|
- variables:
|
||||||
weight: '{{ states(''sensor.sparkx_i7_filament_weight_estimated'') | float(0)
|
weight: '{{ states(''sensor.sparkx_i7_filament_weight_estimated'') | float(0)
|
||||||
|
|||||||
Reference in new issue
Block a user