From 449f9e6f14aa625128a663ece1e55bd74fec8060 Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Wed, 31 Jul 2024 20:15:40 +0200 Subject: [PATCH] Fix & updaate 3d printer automations --- .../automations/3d-printer-mini.yaml | 37 ++++++++++++++-- configuration/automations/3d-printer.yaml | 43 +------------------ 2 files changed, 36 insertions(+), 44 deletions(-) diff --git a/configuration/automations/3d-printer-mini.yaml b/configuration/automations/3d-printer-mini.yaml index 87c5631..6195bd1 100644 --- a/configuration/automations/3d-printer-mini.yaml +++ b/configuration/automations/3d-printer-mini.yaml @@ -1,3 +1,29 @@ +- id: prusa_mini_nevermore_on + alias: '[Prusa MINI] Nevermore on' + mode: single + trigger: + - platform: state + entity_id: + - sensor.prusa_mini + to: printing + action: + - service: fan.turn_on + target: + entity_id: fan.esp_3dprinter_controller_mini_nevermore + +- id: prusa_mini_nevermore_off + alias: '[Prusa MINI] Nevermore off' + mode: single + trigger: + - platform: state + entity_id: + - switch.prusa_mini_switch + to: 'off' + action: + - service: fan.turn_on + target: + entity_id: fan.esp_3dprinter_controller_mini_nevermore + - id: prusa_mini_button alias: '[Prusa MINI] button' mode: single @@ -32,6 +58,9 @@ target: entity_id: - switch.prusa_mini_switch + - service: fan.turn_off + target: + entity_id: fan.esp_3dprinter_controller_mini_nevermore - id: prusa_mini_door_open alias: '[Prusa Mini] Door open' @@ -66,11 +95,11 @@ mode: single trigger: - platform: state - entity_id: sensor.prusamini + entity_id: sensor.prusa_mini from: printing to: idle - platform: state - entity_id: sensor.prusamini + entity_id: sensor.prusa_mini from: printing to: finished action: @@ -79,6 +108,7 @@ message: 3D printer has finished title: Prusa Mini data: + entity_id: camera.3d_printer url: "/lovelace-tablet/3d-printer" - id: prusa_mini_pause_notify @@ -86,7 +116,7 @@ mode: single trigger: - platform: state - entity_id: sensor.prusamini + entity_id: sensor.prusa_mini from: printing to: paused action: @@ -95,4 +125,5 @@ title: Prusa Mini message: 3D Print has been paused data: + entity_id: camera.3d_printer url: "/lovelace-tablet/3d-printer" diff --git a/configuration/automations/3d-printer.yaml b/configuration/automations/3d-printer.yaml index ec723b7..fc26747 100644 --- a/configuration/automations/3d-printer.yaml +++ b/configuration/automations/3d-printer.yaml @@ -26,32 +26,9 @@ - fan.esp_3dprinter_controller_mk4_exhaust - service: light.turn_off entity_id: light.3d_printer_light - -- id: prusa_mk39_first_layer - alias: '[Prusa MK3.9] First layer' - mode: single - trigger: - - platform: numeric_state - entity_id: - - sensor.prusa_mk39_z_height - above: 0.25 - condition: - - condition: state - entity_id: sensor.prusa_mk39 - state: printing - action: - - service: camera.snapshot - data: - filename: /config/www/cctv/3d_printer.jpg + - service: fan.turn_off target: - entity_id: camera.3d_printer - - service: notify.home_assistant - data: - message: "Prusa MK3.9 First Layer" - target: [ "1070521797688180796" ] - data: - images: - - "/config/www/cctv/3d_printer.jpg" + entity_id: fan.esp_3dprinter_controller_mk4_nevermore - id: prusa_mk39_notify_finished alias: '[Prusa MK3.9] Notify Finished' @@ -154,26 +131,10 @@ entity_id: - sensor.prusa_mk39 to: printing - condition: - - condition: or - conditions: - - condition: state - entity_id: sensor.prusa_mk39_material - state: ABS - - condition: state - entity_id: sensor.prusa_mk39_material - state: ASA - - condition: state - entity_id: sensor.prusa_mk39_material - state: PC - - condition: state - entity_id: sensor.prusa_mk39_material - state: PCTG action: - service: fan.turn_on target: entity_id: fan.esp_3dprinter_controller_mk4_nevermore - data: - id: prusa_mk39_fan_off alias: '[Prusa MK3.9] Fan off'