When you use the actual tv remote did that adjust the volume of the sound bar? I’m not 100% sure but I didn’t think an optical cable set up had the ability to respond with volume controls from a tv remote.
‘Does your soundbar have an option for a hdmi cable? And does your tv have an hdmi port on it that says hdmi “arc”? If yes to both of them link a hdmi cable from the soundbar to the tv hdmi arc input then the remote should control the soundbar volume. You can then remove the optical cable as well.