1
0
ansible-home-assistant/configuration/automations/3d-printer-mini.yaml

99 lines
2.5 KiB
YAML

- id: prusa_mini_button
alias: '[Prusa MINI] button'
mode: single
trigger:
- device_id: e233cdffb05076ad7bb049581ffa8c9c
domain: zha
platform: device
type: remote_button_short_press
subtype: remote_button_short_press
action:
- choose:
- conditions:
- condition: state
entity_id: switch.prusa_mini_switch
state: 'off'
sequence:
- service: switch.turn_on
target:
entity_id: switch.prusa_mini_switch
- conditions:
- condition: state
entity_id: switch.prusa_mini_switch
state: 'on'
- condition: state
entity_id: sensor.prusa_mini
state: idle
- condition: numeric_state
entity_id: sensor.prusa_mini_outlet_power
below: '10'
sequence:
- service: switch.turn_off
target:
entity_id:
- switch.prusa_mini_switch
- id: prusa_mini_door_open
alias: '[Prusa Mini] Door open'
mode: single
trigger:
- platform: state
entity_id:
- binary_sensor.prusa_mini_door_window_door_is_open
from: "off"
to: "on"
action:
- service: light.turn_on
target:
entity_id: light.prusa_mini_light_light
- id: prusa_mini_door_close
alias: '[Prusa Mini] Door close'
mode: single
trigger:
- platform: state
entity_id:
- binary_sensor.prusa_mini_door_window_door_is_open
from: "on"
to: "off"
action:
- service: light.turn_off
target:
entity_id: light.prusa_mini_light_light
- id: prusa_mini_notify
alias: '[Prusa Mini] Notify finished'
mode: single
trigger:
- platform: state
entity_id: sensor.prusamini
from: printing
to: idle
- platform: state
entity_id: sensor.prusamini
from: printing
to: finished
action:
- service: notify.mobile_app_iphone
data:
message: 3D printer has finished
title: Prusa Mini
data:
url: "/lovelace-tablet/3d-printer"
- id: prusa_mini_pause_notify
alias: '[Prusa Mini] Notify paused print'
mode: single
trigger:
- platform: state
entity_id: sensor.prusamini
from: printing
to: paused
action:
- service: notify.mobile_app_iphone
data:
title: Prusa Mini
message: 3D Print has been paused
data:
url: "/lovelace-tablet/3d-printer"