Best answer by jjfleurat
My One Connect box is inside a closed cabinet and the Sonos Playbar receives the IR commands directly from the One Control.
It is working for me at every input, tested on tv, hdmi 1 Nintendo switch HDMI2 (PlayStation 4) and Apps (Netflix, Amazon Prime, etc).
Instructions on Samsung TV:
Go to Settings -> Universal Remote -> New Device
Select Device Type: Home Theatre System
Select Brand: Samsung
Select Home Cinema Configuration: Optical
Start "Power Test" and always hit "No" (unsuccessful) until the 4th power test, there select Yes (home theatre system turned on/off).
After this the Sonos Playbar can understand the IR commands emitted by the One Remote, without the One Connect box needing to be in line-of-sight.
Change remote on Sonos Playbar:
Start the Sonos App
Go to More -> Settings -> Room Settings-> Room with TV/Playbar -> TV -> Remote control setup
Follow on-screen instructions, you will have to learn Volume Up/Down and Mute.
Congrats, you will have now a flawless working Samsung One Remote + Sonos Playbar setup.
At least it works at me perfectly.
None of the other "workarounds" that I found by other users worked for me.
Props to the guy who found this and I am sharing for.