# SV08 connect Smart Filament Sensor

**URL:** <https://forum.sovol3d.com/t/sv08-connect-smart-filament-sensor/9949>\
**Category:** Sovol SV08\
**Created:** [May 1, 2026, 3:43pm UTC](https://forum.sovol3d.com/t/sv08-connect-smart-filament-sensor/9949 "2026-05-01T15:43:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Turbojoke](https://avatars.discourse-cdn.com/v4/letter/t/54ee81/32.png) [@Turbojoke](https://forum.sovol3d.com/u/Turbojoke)\
**Post date:** [May 1, 2026, 3:43pm UTC](https://forum.sovol3d.com/t/sv08-connect-smart-filament-sensor/9949/1 "2026-05-01T15:43:47Z")

</div>

Hello everyone!

I’m trying to install a Smart BTT Sensor on my Sovol SV08 printer. The sensor has 3 pins: S, V, G. It’s an optical endstop with a wheel that moves along with the filament during printing. If the wheel stops moving, it means there’s a clog, and the printer should pause for cleaning.

I connected this sensor instead of the standard `filament_switch_sensor filament_sensor`.

Here is the code I’m using:

> #[filament\_switch\_sensor filament\_sensor]  
> #pause\_on\_runout: True  
> #event\_delay: 3.0  
> #pause\_delay: 0.5  
> #switch\_pin: PE9
> 
> [filament\_motion\_sensor BTT\_Smart\_Filament\_Sensor]  
> switch\_pin: PE9  
> detection\_length: 7.0  
> extruder: extruder  
> pause\_on\_runout: True  
> event\_delay: 3.0  
> pause\_delay: 0.5
> 
> runout\_gcode:  
> #PAUSE # [pause\_resume] is required in printer.cfg  
> M117 Filament encoder runout  
> SET\_IDLE\_TIMEOUT TIMEOUT=600000
> 
> insert\_gcode:  
> M117 Filament encoder inserted

When I start a print, an error appears in the console and the printer stops with an error.

The error message is:

> 18:10  
> Error evaluating ‘gcode\_macro CANCEL\_PRINT:gcode’: jinja2.exceptions.UndefinedError: ‘extras.gcode\_macro.GetStatusWrapper object’ has no attribute ‘filament\_switch\_sensor filament\_sensor’  
> 18:10  
> Error evaluating ‘gcode\_macro START\_PRINT:gcode’: jinja2.exceptions.UndefinedError: ‘extras.gcode\_macro.GetStatusWrapper object’ has no attribute ‘filament\_switch\_sensor filament\_sensor’

I think the issue is caused by some kind of macro conflict, but I don’t have enough experience to fix it.

Could someone help me with this?

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/sovolforum/original/2X/0/037d1d3d1ddfef95c4eee9178351ef1d3f9a4193.jpeg)

---

<div class="post-metadata">

**Author:** ![Turbojoke](https://avatars.discourse-cdn.com/v4/letter/t/54ee81/32.png) [@Turbojoke](https://forum.sovol3d.com/u/Turbojoke)\
**Post date:** [May 1, 2026, 4:47pm UTC](https://forum.sovol3d.com/t/sv08-connect-smart-filament-sensor/9949/2 "2026-05-01T16:47:49Z")

</div>

Alright, I figured it out. This solution might not be the most correct one, but it works.

Here’s what to do:

> [filament\_switch\_sensor filament\_sensor]  
> pause\_on\_runout: True  
> event\_delay: 3.0  
> pause\_delay: 0.5  
> switch\_pin: extra\_mcu:PA9
> 
> [filament\_motion\_sensor encoder\_sensor]  
> switch\_pin: PE9  
> detection\_length: 7.0  
> extruder: extruder  
> pause\_on\_runout: True  
> event\_delay: 3.0  
> pause\_delay: 0.5
> 
> runout\_gcode:  
> #PAUSE # [pause\_resume] is required in printer.cfg  
> M117 Filament encoder runout
> 
> insert\_gcode:  
> M117 Filament encoder inserted

Now the printer thinks that `extra_mcu:PA9` always has filament inserted, and it only processes pause/runout errors from `PE9`.

Make sure to turn off the switch shown in the screenshot.

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/sovolforum/original/2X/9/9ebcf75e4cbacacfbd2382663bd86b26b69d0394.png)

---

<div class="post-metadata">

**Author:** ![cardoc](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@cardoc](https://forum.sovol3d.com/u/cardoc)\
**Post date:** [May 1, 2026, 6:06pm UTC](https://forum.sovol3d.com/t/sv08-connect-smart-filament-sensor/9949/3 "2026-05-01T18:06:08Z")

</div>

Welcome to the forum.

Your issue is the start\_print macro looks for the filament sensor by the name you commented out.

```auto

[gcode_macro START_PRINT]
description: 
variable_state: 'Prepare'
variable_record_extruder_temp:0
variable_max_record_extruder_temp:0
gcode:
    {% set mesh_name = "default" %}
    {% set mesh_calibrate_temp = printer['gcode_macro _global_var'].bed_mesh_calibrate_target_temp|int %}

    {% set extruder_target_temp = printer.extruder.target|int %}

    {% set bed_targer_temp = printer.heater_bed.target|int %}

    M400

    CLEAR_PAUSE

    G90
    {% if state == 'Prepare' %}

        {action_respond_info("Prepare!")}

        {% if printer.toolhead.homed_axes|lower != "xyz" %}
            G28
        {% endif %}

        {% if printer**['filament_switch_sensor filament_sensor']**.enable == True and
              printer**['filament_switch_sensor filament_sensor'].**filament_detected != True
        %}
            M117 No filament!!!
            {action_respond_info("Please Insert filament in Sensor!")}
            CANCEL_PRINT
        {% endif %}

        {action_respond_info("Check Heating!")}

        M140 S{bed_targer_temp}
        M104 S{extruder_target_temp}

        {% if printer.heater_bed.temperature < bed_targer_temp %}
            M117 Bed heating...
            {action_respond_info("Bed heating...")}
            M190 S{bed_targer_temp}
        {% endif %}

        {% if printer.extruder.temperature < extruder_target_temp %}
            M117 Nozzle heating...
            {action_respond_info("Nozzle heating...")}
            M109 S{extruder_target_temp} 
        {% endif %}

        {% if printer.quad_gantry_level.applied|lower != 'true' %}
            QUAD_GANTRY_LEVEL
        {% endif %}
        BED_MESH_CALIBRATE ADAPTIVE=1 
        
        SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=state VALUE='"Start"' 
        UPDATE_DELAYED_GCODE ID=_print_start_wait DURATION=0.5

    {% elif state == 'Start' %}
        M117 Printing now!!!
        {action_respond_info("Start!")}
    {% endif %}

```

Note under Klipper a [[filament\_switch\_sensor]](https://www.klipper3d.org/Config_Reference.html?h=runout#filament_switch_sensor)  
And a [[filament\_motion\_sensor]](https://www.klipper3d.org/Config_Reference.html?h=runout#filament_motion_sensor)

Are not the same thing.

Configure the new sensor correctly. Uncomment the [‘filament\_switch\_sensor filament\_sensor’] section and change the pin reference to an unused pin.

Add this near the top of your configuration.

```auto
[delayed_gcode startup_disable_filament_sensor]
initial_duration: 0.5
gcode:
  SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0

```

OR search every macro for [‘filament\_switch\_sensor filament\_sensor’] and edit it. Delete the check or point it at the new sensor. AFAIK Klipper sets the senor true at initialization. That would allow a print to start with no filament loaded but would stop when the sensor failed to toggle after 7mm of extruder moves.

---

<div class="post-metadata">

**Author:** ![cardoc](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@cardoc](https://forum.sovol3d.com/u/cardoc)\
**Post date:** [May 1, 2026, 6:07pm UTC](https://forum.sovol3d.com/t/sv08-connect-smart-filament-sensor/9949/4 "2026-05-01T18:07:06Z")

</div>

Oops, cross posted. Glad you got it sorted.
