I use the OctoPrint Plugin MultiColors. It allows OctoPrint to automatically pause the print at designated layers for filament/color swapping. I didn’t know how to create my own OctoPrint plugin, so I came up with this solution instead.