Using J28 and J30
filament_switch_sensor filament_sensor]
event_delay: 0.1
pause_on_runout: True
runout_gcode: UNLOAD_FILAMENT
insert_gcode: LOAD_FILAMENT
switch_pin: PG12 # green wire
[gcode_button sensor_button]
pin: !PG13 # yellow wire
press_gcode: UNLOAD_FILAMENT