-
Notifications
You must be signed in to change notification settings - Fork 0
/
nevermore.cfg
108 lines (84 loc) · 4.1 KB
/
nevermore.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
[nevermore]
bt_address: 28:CD:C1:0C:23:B6
connection_initial_timeout: 30
fan_power_coefficient: 0.8
[temperature_sensor nevermore_intake]
sensor_type: NevermoreSensor # fixed, must be `NevermoreSensor`
# valid values: `intake`, `exhaust`
sensor_kind: intake
# Pretends the VOC index is a temperature, allowing it to be plotted in Mainsail/Fluidd.
# Setting this to `true` will suppress the all other readings for this sensor object.
# (e.g. temperature, pressure, etc)
plot_voc: true
[temperature_sensor nevermore_exhaust]
sensor_type: NevermoreSensor # fixed, must be `NevermoreSensor`
# valid values: `intake`, `exhaust`
sensor_kind: exhaust
# Pretends the VOC index is a temperature, allowing it to be plotted in Mainsail/Fluidd.
# Setting this to `true` will suppress the all other readings for this sensor object.
# (e.g. temperature, pressure, etc)
plot_voc: true
# Filter TIme
# A set of macros to remind you when to refresh your carbon filter
# The latest version of this file can always be found at https://github.com/MapleLeafMakers/KlipperMacros/
#
# Usage:
#
# NOTE: `[save_variables]` must be present in your configuration in order for this to work. for example:
#
# [save_variables]
# filename: ~/printer_data/config/saved_variables.cfg
#
# include this file in your main printer.cfg by adding `[include air_filter_timer.cfg]`
# check the Configuration section below, and update the variables if necessary. The default
# configuration is set up to work with a `fan_generic` called `air_filter`. if yours is set up
# differently, please update the `variable_fan` value.
#
# After your air filter has run for the configured amount of time, the replacement_gcode will be run
# every 1 second until `RESET_AIR_FILTER` is executed. by default this displays a message on the LCD.
#
# You may query the current time on the filter by running `QUERY_AIR_FILTER`
[gcode_macro _AIR_FILTER_VARIABLES]
## Configuration
variable_fan: 'fan_generic nevermore_fan' # The fan to track.
variable_hours_until_replacement: 10000# 50 # total hours the filter can run before media needs replacing
variable_replacement_gcode: 'M117 replace filter media' # gcode to run when the media needs to be replaced (will be repeated every second until reset)
## Do not edit below this line
variable_time: -1
gcode:
[gcode_macro RESET_AIR_FILTER]
description: Resets the air-filter replacement timer
gcode:
SET_GCODE_VARIABLE MACRO=_AIR_FILTER_VARIABLES VARIABLE=time VALUE=0
SAVE_VARIABLE VARIABLE=air_filter_time VALUE=0
{ action_respond_info("Air filter timer has been reset.") }
[gcode_macro QUERY_AIR_FILTER]
description: Displays the amount of time the air filter has run since it was last reset.
gcode:
{% set hours = "%.2f"|format(printer['gcode_macro _AIR_FILTER_VARIABLES'].time|int / 3600) %}
{ action_respond_info("Air Filter Hours: " + hours) }
[delayed_gcode _AIR_FILTER_TIMER]
initial_duration: 1
gcode:
{% set cached_time = printer['gcode_macro _AIR_FILTER_VARIABLES'].time|int %}
{% if cached_time == -1 %}
{% set cached_time = printer.save_variables.variables.air_filter_time|default(0) %}
SET_GCODE_VARIABLE MACRO=_AIR_FILTER_VARIABLES VARIABLE=time VALUE={ cached_time }
{% endif %}
{% if printer[printer['gcode_macro _AIR_FILTER_VARIABLES'].fan].speed|float > 0 %}
SET_GCODE_VARIABLE MACRO=_AIR_FILTER_VARIABLES VARIABLE=time VALUE={ cached_time + 1}
{% endif %}
{% set replacement_seconds = printer['gcode_macro _AIR_FILTER_VARIABLES'].hours_until_replacement|float * 3600 %}
{% if cached_time > replacement_seconds %}
{ printer['gcode_macro _AIR_FILTER_VARIABLES'].replacement_gcode }
{% endif %}
UPDATE_DELAYED_GCODE ID=_AIR_FILTER_TIMER DURATION=1
[delayed_gcode _AIR_FILTER_FLUSH_TIMER]
initial_duration: 300
gcode:
{% set saved_time = printer.save_variables.variables.air_filter_time|default(0)|float %}
{% set actual_time = printer['gcode_macro _AIR_FILTER_VARIABLES'].time|float %}
{% if saved_time != actual_time %}
SAVE_VARIABLE VARIABLE=air_filter_time VALUE={actual_time}
{% endif %}
UPDATE_DELAYED_GCODE ID=_AIR_FILTER_FLUSH_TIMER DURATION=300