diff --git a/lovelace/03_camera_view.yaml b/lovelace/03_camera_view.yaml index f4455d4..876a5f8 100644 --- a/lovelace/03_camera_view.yaml +++ b/lovelace/03_camera_view.yaml @@ -1,7 +1,6 @@ title: Camera Live icon: mdi:cctv cards: - - type: horizontal-stack cards: - type: "custom:button-card" @@ -13,7 +12,7 @@ cards: - font-weight: bold - color: rgb(0, 0, 5) state: - - value: 'frontyard' + - value: "frontyard" color: var(--primary-color) action: service service: @@ -29,7 +28,7 @@ cards: - font-weight: bold - color: rgb(0, 0, 5) state: - - value: 'driveway' + - value: "driveway" color: var(--primary-color) action: service service: @@ -45,7 +44,7 @@ cards: - font-weight: bold - color: rgb(0, 0, 5) state: - - value: 'patio' + - value: "patio" color: var(--primary-color) action: service service: @@ -61,7 +60,7 @@ cards: - font-weight: bold - color: rgb(0, 0, 5) state: - - value: 'playarea' + - value: "playarea" color: var(--primary-color) action: service service: @@ -75,7 +74,7 @@ cards: camera_image: camera.frontdoor_camera camera_view: live show_info: true - tap_action: + tap_action: action: more-info entities: - switch.frontyard_light @@ -88,7 +87,7 @@ cards: entity: camera.patio_camera camera_image: camera.patio_camera show_info: true - tap_action: + tap_action: action: more-info entities: - switch.wemobackyardlightswitch @@ -101,7 +100,7 @@ cards: entity: camera.driveway_camera camera_image: camera.driveway_camera show_info: true - tap_action: + tap_action: action: more-info entities: - switch.frontyard_light @@ -115,7 +114,7 @@ cards: entity: camera.playarea_camera camera_image: camera.playarea_camera show_info: true - tap_action: + tap_action: action: more-info entities: - switch.wemobackyardlightswitch @@ -128,7 +127,7 @@ cards: entity: camera.garage_camera camera_image: camera.garage_camera show_info: true - tap_action: + tap_action: action: more-info entities: - switch.garage @@ -136,17 +135,29 @@ cards: - binary_sensor.two_car_garage_door_tilt_sensor_sensor - type: picture-glance - id: camera_kitchen_camera - title: Kitchen Camera - entity: camera.kitchen_camera - camera_image: camera.kitchen_camera + id: camera_3dprinter_camera + title: 3D Printer Camera + entity: camera.3d_printer_camera + camera_image: camera.3d_printer_camera show_info: true - tap_action: + tap_action: action: more-info entities: - - switch.kitchen - - binary_sensor.kitchen_camera_motion - - binary_sensor.back_door_sensor_sensor + - binary_sensor.motion_sensor_158d00016c2d0e + - binary_sensor.octoprint_printing + + # - type: picture-glance + # id: camera_kitchen_camera + # title: Kitchen Camera + # entity: camera.kitchen_camera + # camera_image: camera.kitchen_camera + # show_info: true + # tap_action: + # action: more-info + # entities: + # - switch.kitchen + # - binary_sensor.kitchen_camera_motion + # - binary_sensor.back_door_sensor_sensor # - type: picture-glance # id: camera_frontroom_camera @@ -154,7 +165,7 @@ cards: # entity: camera.frontroom_camera # camera_image: camera.frontroom_camera # show_info: true - # tap_action: + # tap_action: # action: more-info # entities: # - binary_sensor.frontdoor_camera_motion diff --git a/lovelace/15_3d_printer.yaml b/lovelace/15_3d_printer.yaml index 0f17abb..7e3107c 100644 --- a/lovelace/15_3d_printer.yaml +++ b/lovelace/15_3d_printer.yaml @@ -11,6 +11,7 @@ cards: action: more-info entities: - binary_sensor.motion_sensor_158d00016c2d0e + - binary_sensor.octoprint_printing - type: vertical-stack cards: @@ -26,24 +27,16 @@ cards: show_header_toggle: false entities: - binary_sensor.octoprint_printing - - binary_sensor.octoprint_printing_error - - sensor.octoprint_actual_bed_temp - - sensor.octoprint_actual_tool0_temp - sensor.octoprint_current_state - - sensor.octoprint_job_percentage - - sensor.octoprint_target_bed_temp - - sensor.octoprint_target_tool0_temp - - sensor.octoprint_time_elapsed - - sensor.octoprint_time_remaining - - - type: entities - title: Percentage Complete - show_header_toggle: false - entities: - - input_boolean.twenty_five_percent - - input_boolean.fifty_percent - - input_boolean.seventy_five_percent - - input_boolean.hundred_percent + - binary_sensor.octoprint_printing_error + - entity: sensor.octoprint_actual_bed_temp_c + name: Print Bed Temperature + - entity: sensor.octoprint_target_bed_temp_c + name: Target Bed Temperature + - entity: sensor.octoprint_actual_tool0_temp_c + name: Extruder Temperature + - entity: sensor.octoprint_target_tool0_temp_c + name: Extruder Target Temperature - type: entities title: Print Times @@ -53,10 +46,18 @@ cards: name: Elapsed - entity: sensor.time_estimated name: Estimated + - entity: sensor.print_completion + name: Print Completion - type: entities - title: 3D Printer + title: 3D Printer Settings + show_header_toggle: false + entities: + - input_boolean.power_off_when_complete + - input_boolean.send_progress_pictures + + - type: entities + title: 3D Printer Control show_header_toggle: false entities: - switch.3d_printer - - input_boolean.power_off_when_complete diff --git a/packages/3dprinting.yaml b/packages/3dprinting.yaml index bd40292..f316aa8 100644 --- a/packages/3dprinting.yaml +++ b/packages/3dprinting.yaml @@ -32,8 +32,12 @@ input_boolean: power_off_when_complete: name: Auto Shutoff When Done - initial: "off" icon: mdi:toggle-switch-off + + send_progress_pictures: + name: Send Telegram Pictures + icon: mdi:toggle-switch-off + # # Octoprint Camera URL in the format # still_image_url: "http://192.xxx.xxx.xxx/webcam/?action=snapshot" @@ -80,6 +84,56 @@ sensor: {% endmacro %} {{ secondsToReadableString(states('sensor.octoprint_time_remaining') |int) }} + - platform: template + sensors: + print_completion: + value_template: > + {{ (now().strftime('%s') |int + states('sensor.octoprint_time_remaining')|int ) | timestamp_custom("%A %D %H:%M %p") }} + + - platform: template + sensors: + octoprint_actual_bed_temp_c: + unit_of_measurement: "C" + value_template: > + {%- macro F2C(temperature) -%} + {% set tmp = (((temperature - 32) *5)/9) %} + {{- " %0.2f" % tmp }} + {%- endmacro -%} + {{ F2C(states('sensor.octoprint_actual_bed_temp') |int ) |int }} + + - platform: template + sensors: + octoprint_actual_tool0_temp_c: + unit_of_measurement: "C" + value_template: > + {%- macro F2C(temperature) -%} + {% set tmp = (((temperature - 32) *5)/9) %} + {{- " %0.2f" % tmp }} + {%- endmacro -%} + {{ F2C(states('sensor.octoprint_actual_tool0_temp') |int ) |int }} + + - platform: template + sensors: + octoprint_target_bed_temp_c: + unit_of_measurement: "C" + value_template: > + {%- macro F2C(temperature) -%} + {% set tmp = (((temperature - 32) *5)/9) %} + {{- " %0.2f" % tmp }} + {%- endmacro -%} + {{ F2C(states('sensor.octoprint_target_bed_temp') |int ) |int }} + + - platform: template + sensors: + octoprint_target_tool0_temp_c: + unit_of_measurement: "C" + value_template: > + {%- macro F2C(temperature) -%} + {% set tmp = (((temperature - 32) *5)/9) %} + {{- " %0.2f" % tmp }} + {%- endmacro -%} + {{ F2C(states('sensor.octoprint_target_tool0_temp') |int ) |int }} + automation: # # Notify when the printer status changed from "Prnting" to anything. @@ -189,3 +243,30 @@ automation: entity_id: input_boolean.seventy_five_percent - service_template: input_boolean.turn_off entity_id: input_boolean.hundred_percent + + # + # If the printer is ON and is "Printing", it will send a snapshot/picture every 30 minutes + # + - alias: "Send 3D Print Pictures" + trigger: + platform: time_pattern + minutes: "/30" + seconds: 00 + condition: + - condition: template + value_template: "{{ states('input_boolean.send_progress_pictures') == 'on' }}" + - condition: template + value_template: "{{ states('sensor.octoprint_current_state') | lower == 'printing' }}" + action: + - service: camera.snapshot + data: + entity_id: camera.3d_printer_camera + filename: "/home/homeassistant/.homeassistant/www/downloads/camera/3dprinter/print_latest.jpg" + - service: notify.telegram + data: + title: "3D Printer" + message: "Print Progress" + data: + photo: + - file: "/home/homeassistant/.homeassistant/www/downloads/camera/3dprinter/print_latest.jpg" + caption: "3D Print Progress" diff --git a/zwcfg_0xd89c4f0c.xml b/zwcfg_0xd89c4f0c.xml index f3f920c..6b6a3ea 100644 --- a/zwcfg_0xd89c4f0c.xml +++ b/zwcfg_0xd89c4f0c.xml @@ -48,7 +48,7 @@ - + @@ -289,9 +289,9 @@ - - - + + + @@ -575,11 +575,11 @@ - - - + + + - + @@ -749,7 +749,7 @@ - + @@ -758,8 +758,8 @@ - - + + @@ -794,7 +794,7 @@ - + @@ -1205,7 +1205,7 @@ - + @@ -1299,7 +1299,7 @@ - + @@ -1405,7 +1405,7 @@ - + @@ -1415,7 +1415,7 @@ - + @@ -1423,9 +1423,9 @@ - - - + + + @@ -1605,7 +1605,7 @@ - + @@ -1678,7 +1678,7 @@ - +