Send the value from a slider to a script .py

Setup scripted automation and Jython, then you can read use your existing code in a script or module, and directly read the value of the slider or trigger a rule when it’s state changes.