From c93d4cacfa7733b28d45ec314a180f3eb6516c61 Mon Sep 17 00:00:00 2001 From: pgrondek Date: Tue, 18 May 2021 09:37:48 +0200 Subject: [PATCH] Add 3D Printer button --- automations/files/automations/3d-printer.yaml | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/automations/files/automations/3d-printer.yaml b/automations/files/automations/3d-printer.yaml index 2d4a9cc..1f2b78c 100644 --- a/automations/files/automations/3d-printer.yaml +++ b/automations/files/automations/3d-printer.yaml @@ -30,3 +30,37 @@ for: '00:00:05' action: - service: rest_command.octoprint_connect + +- id: 3dprinter-button + alias: '[3D Printer] button' + mode: single + trigger: + - device_id: a2ac0fa69738b8e7c5c1b8b8bcf8cdc2 + domain: zha + platform: device + type: remote_button_short_press + subtype: remote_button_short_press + action: + - choose: + - conditions: + - condition: state + entity_id: switch.3d_printer_switch + state: 'off' + sequence: + - service: switch.turn_on + target: + entity_id: switch.3d_printer_switch + - conditions: + - condition: state + entity_id: switch.3d_printer_switch + state: 'on' + - condition: state + entity_id: binary_sensor.octoprint_printing + state: 'off' + - condition: numeric_state + entity_id: sensor.3d_printer_power + below: '30' + sequence: + - service: switch.turn_off + target: + entity_id: switch.3d_printer_switch \ No newline at end of file