the soundbar connected via optical can only be controlled by remote using IR commands, that is not a Roku remote. Roku remotes can only be programmed for Tv IR commands. And than if the soundbar was connected via hdmi cable, the tv could possibly control it via cec. With optical you will need a third party universal remote, sorry.
Edmund
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.