initial commit
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
# ------------------------------------------------------------
|
||||
# ELEGOO: Printney Spears (Centauri Carbon)
|
||||
# Note: Uses current_status + file_name sensors (Elegoo integration)
|
||||
# No weight, length, or filament data available
|
||||
# Status values: "printing" / "complete" / "failed" — verify in Dev Tools
|
||||
# ------------------------------------------------------------
|
||||
- alias: "Print Log - Printney Spears - Start"
|
||||
id: print_log_printney_spears_start
|
||||
description: "Creates Notion entry when Printney Spears begins printing"
|
||||
initial_state: false
|
||||
mode: single
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: sensor.saturn_iv_print_status
|
||||
from:
|
||||
- "idle"
|
||||
- "stopped"
|
||||
- "complete"
|
||||
to: "printing"
|
||||
condition:
|
||||
- condition: template
|
||||
value_template: "{{ states('input_text.notion_page_id_centauri_carbon') | length < 10 }}"
|
||||
action:
|
||||
- delay: "00:00:05"
|
||||
- action: rest_command.notion_create_print
|
||||
data:
|
||||
file_name: "{{ states('sensor.centauri_carbon_file_name') }}"
|
||||
printer_name: "Printney Spears"
|
||||
filament_type: "Unknown"
|
||||
filament_color: "Unknown"
|
||||
started: "{{ now().strftime('%Y-%m-%dT%H:%M:%S') }}"
|
||||
response_variable: notion_response
|
||||
- action: input_text.set_value
|
||||
target:
|
||||
entity_id: input_text.notion_page_id_centauri_carbon
|
||||
data:
|
||||
value: "{{ notion_response.content.id | default('') }}"
|
||||
|
||||
- alias: "Print Log - Printney Spears - Finish"
|
||||
id: print_log_printney_spears_finish
|
||||
description: "Updates Notion entry when Printney Spears finishes or fails"
|
||||
initial_state: false
|
||||
mode: single
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: sensor.saturn_iv_print_status
|
||||
to: "complete"
|
||||
id: completed
|
||||
- platform: state
|
||||
entity_id: sensor.saturn_iv_print_status
|
||||
to: "failed"
|
||||
id: failed
|
||||
condition:
|
||||
- condition: template
|
||||
value_template: "{{ states('input_text.notion_page_id_centauri_carbon') | length > 10 }}"
|
||||
action:
|
||||
- delay: "00:00:05"
|
||||
- variables:
|
||||
page_id: "{{ states('input_text.notion_page_id_centauri_carbon') }}"
|
||||
- condition: template
|
||||
value_template: "{{ page_id | length > 10 }}"
|
||||
- action: rest_command.notion_update_print
|
||||
data:
|
||||
page_id: "{{ page_id }}"
|
||||
status: >
|
||||
{% if trigger.id == 'completed' %}Completed
|
||||
{% else %}Failed{% endif %}
|
||||
weight: 0
|
||||
length: 0
|
||||
completed: "{{ now().strftime('%Y-%m-%dT%H:%M:%S') }}"
|
||||
- action: input_text.set_value
|
||||
target:
|
||||
entity_id: input_text.notion_page_id_centauri_carbon
|
||||
data:
|
||||
value: ""
|
||||
Reference in New Issue
Block a user