2020-11-06 15:00:01 +03:00
|
|
|
# Example Home Assistant configuration file for a Voron V0.
|
2021-08-31 13:52:55 +03:00
|
|
|
# Credit to GitHub users @Kruppes and @pedrolamas
|
2020-11-06 15:00:01 +03:00
|
|
|
#
|
|
|
|
sensor:
|
|
|
|
- platform: rest
|
|
|
|
name: Voron_V0_sensor
|
|
|
|
resource: "http://192.168.178.56:7125/printer/objects/query?heater_bed&extruder&print_stats&toolhead&display_status&virtual_sdcard"
|
|
|
|
json_attributes_path: "$.result.status"
|
|
|
|
json_attributes:
|
|
|
|
- heater_bed
|
|
|
|
- extruder
|
|
|
|
- print_stats
|
|
|
|
- toolhead
|
|
|
|
- display_status
|
|
|
|
- virtual_sdcard
|
2021-09-01 12:50:20 +03:00
|
|
|
value_template: >-
|
|
|
|
{{ 'OK' if ('result' in value_json) else None }}
|
2021-07-28 12:15:31 +03:00
|
|
|
|
2020-11-06 15:00:01 +03:00
|
|
|
- platform: template
|
|
|
|
sensors:
|
2021-07-28 12:15:31 +03:00
|
|
|
|
2020-11-06 15:00:01 +03:00
|
|
|
vzero_hotend_target:
|
|
|
|
friendly_name: 'V0.126 Hotend Target'
|
|
|
|
device_class: temperature
|
|
|
|
unit_of_measurement: '°C'
|
2021-07-28 12:15:31 +03:00
|
|
|
value_template: >-
|
2021-09-01 12:50:20 +03:00
|
|
|
{{ states.sensor.voron_v0_sensor.attributes['extruder']['target'] | float | round(1) if is_state('sensor.voron_v0_sensor', 'OK') else None }}
|
2021-07-28 12:15:31 +03:00
|
|
|
|
2020-11-06 15:00:01 +03:00
|
|
|
vzero_hotend_actual:
|
|
|
|
device_class: temperature
|
|
|
|
unit_of_measurement: '°C'
|
2021-07-28 12:15:31 +03:00
|
|
|
value_template: >-
|
2021-09-01 12:50:20 +03:00
|
|
|
{{ states.sensor.voron_v0_sensor.attributes['extruder']['temperature'] | float | round(1) if is_state('sensor.voron_v0_sensor', 'OK') else None }}
|
2021-07-28 12:15:31 +03:00
|
|
|
|
2020-11-06 15:00:01 +03:00
|
|
|
vzero_bed_target:
|
|
|
|
device_class: temperature
|
|
|
|
unit_of_measurement: '°C'
|
2021-07-28 12:15:31 +03:00
|
|
|
value_template: >-
|
2021-09-01 12:50:20 +03:00
|
|
|
{{ states.sensor.voron_v0_sensor.attributes['heater_bed']['target'] | float | round(1) if is_state('sensor.voron_v0_sensor', 'OK') else None }}
|
2021-07-28 12:15:31 +03:00
|
|
|
|
2020-11-06 15:00:01 +03:00
|
|
|
vzero_bed_actual:
|
|
|
|
device_class: temperature
|
|
|
|
unit_of_measurement: '°C'
|
2021-07-28 12:15:31 +03:00
|
|
|
value_template: >-
|
2021-09-01 12:50:20 +03:00
|
|
|
{{ states.sensor.voron_v0_sensor.attributes['heater_bed']['temperature'] | float | round(1) if is_state('sensor.voron_v0_sensor', 'OK') else None }}
|
2021-07-28 12:15:31 +03:00
|
|
|
|
2020-11-06 15:00:01 +03:00
|
|
|
vzero_state:
|
2021-07-28 12:15:31 +03:00
|
|
|
icon_template: mdi:printer-3d
|
|
|
|
value_template: >-
|
2021-09-01 12:50:20 +03:00
|
|
|
{{ states.sensor.voron_v0_sensor.attributes['print_stats']['state'] if is_state('sensor.voron_v0_sensor', 'OK') else None }}
|
2021-07-28 12:15:31 +03:00
|
|
|
|
2020-11-06 15:00:01 +03:00
|
|
|
vzero_current_print:
|
2021-07-28 12:15:31 +03:00
|
|
|
value_template: >-
|
2021-09-01 12:50:20 +03:00
|
|
|
{{ states.sensor.voron_v0_sensor.attributes['print_stats']['filename'] if is_state('sensor.voron_v0_sensor', 'OK') else None }}
|
2021-07-28 12:15:31 +03:00
|
|
|
|
2020-11-06 15:00:01 +03:00
|
|
|
vzero_current_progress:
|
|
|
|
unit_of_measurement: '%'
|
2021-07-28 12:15:31 +03:00
|
|
|
icon_template: mdi:file-percent
|
|
|
|
value_template: >-
|
2021-09-01 12:50:20 +03:00
|
|
|
{{ (states.sensor.voron_v0_sensor.attributes['display_status']['progress'] * 100) | round(1) if is_state('sensor.voron_v0_sensor', 'OK') else None }}
|
2021-07-28 12:15:31 +03:00
|
|
|
|
2020-11-06 15:00:01 +03:00
|
|
|
vzero_print_time:
|
2021-07-28 12:15:31 +03:00
|
|
|
icon_template: mdi:clock-start
|
|
|
|
value_template: >-
|
2021-09-01 12:50:20 +03:00
|
|
|
{{ states.sensor.voron_v0_sensor.attributes['print_stats']['print_duration'] | timestamp_custom("%H:%M:%S", 0) if is_state('sensor.voron_v0_sensor', 'OK') else None }}
|
2021-07-28 12:15:31 +03:00
|
|
|
|
2020-11-06 15:00:01 +03:00
|
|
|
vzero_time_remaining:
|
2021-07-28 12:15:31 +03:00
|
|
|
icon_template: mdi:clock-end
|
|
|
|
value_template: >-
|
2021-09-01 12:50:20 +03:00
|
|
|
{{ (((states.sensor.voron_v0_sensor.attributes['print_stats']['print_duration'] / states.sensor.voron_v0_sensor.attributes['display_status']['progress'] - states.sensor.voron_v0_sensor.attributes['print_stats']['print_duration']) if states.sensor.voron_v0_sensor.attributes['display_status']['progress'] > 0 else 0) | timestamp_custom('%H:%M:%S', 0)) if is_state('sensor.voron_v0_sensor', 'OK') else None }}
|
2021-07-28 12:15:31 +03:00
|
|
|
|
2020-11-06 15:00:01 +03:00
|
|
|
vzero_eta:
|
2021-07-28 12:15:31 +03:00
|
|
|
icon_template: mdi:clock-outline
|
|
|
|
value_template: >-
|
2021-09-01 12:50:20 +03:00
|
|
|
{{ (as_timestamp(now()) + 2 * 60 * 60 + ((states.sensor.voron_v0_sensor.attributes['print_stats']['print_duration'] / states.sensor.voron_v0_sensor.attributes['display_status']['progress'] - states.sensor.voron_v0_sensor.attributes['print_stats']['print_duration']) if states.sensor.voron_v0_sensor.attributes['display_status']['progress'] > 0 else 0)) | timestamp_custom("%H:%M:%S", 0) if is_state('sensor.voron_v0_sensor', 'OK') else None }}
|
2021-07-28 12:15:31 +03:00
|
|
|
|
2020-11-06 15:00:01 +03:00
|
|
|
vzero_nozzletemp:
|
2021-07-28 12:15:31 +03:00
|
|
|
icon_template: mdi:thermometer
|
|
|
|
value_template: >-
|
2021-09-01 12:50:20 +03:00
|
|
|
{{ [(states.sensor.voron_v0_sensor.attributes['extruder']['temperature'] | float | round(1) | string), " / ", (states.sensor.voron_v0_sensor.attributes['extruder']['target'] | float | round(1) | string)] | join if is_state('sensor.voron_v0_sensor', 'OK') else None }}
|
2021-07-28 12:15:31 +03:00
|
|
|
|
2020-11-06 15:00:01 +03:00
|
|
|
vzero_bedtemp:
|
2021-07-28 12:15:31 +03:00
|
|
|
icon_template: mdi:thermometer
|
|
|
|
value_template: >-
|
2021-09-01 12:50:20 +03:00
|
|
|
{{ [(states.sensor.voron_v0_sensor.attributes['heater_bed']['temperature'] | float | round(1) | string), " / ", (states.sensor.voron_v0_sensor.attributes['heater_bed']['target'] | float | round(1) | string)] | join if is_state('sensor.voron_v0_sensor', 'OK') else None }}
|
2021-08-31 13:52:55 +03:00
|
|
|
|
|
|
|
# The following will allow you to control the power of devices configured in the "[power]" sections of moonraker
|
|
|
|
# Make sure to change the `Printer` name below to the device name on your configuration
|
|
|
|
#
|
|
|
|
switch:
|
|
|
|
- platform: rest
|
|
|
|
name: Voron_V0_power
|
|
|
|
resource: "http://192.168.178.56:7125/machine/device_power/device?device=Printer"
|
|
|
|
body_on: '{"action": "on"}'
|
|
|
|
body_off: '{"action": "off"}'
|
|
|
|
headers:
|
|
|
|
Content-Type: 'application/json'
|
|
|
|
is_on_template: >-
|
2021-09-01 12:50:20 +03:00
|
|
|
{{ 'result' in value_json and (value_json.result.values() | list | first == "on") }}
|