Solved! sound bar Yamaha YSP-CU4300

Solution
If CEC is turned on in the TV that would automatically turn the soundbar on when you turn the TV on. Then pressing the power button on the remote would turn it off and you would have to press it again turn it on again.
The button on the remote could be intermittent due to wear or a defect.
If CEC is turned on in the TV that would automatically turn the soundbar on when you turn the TV on. Then pressing the power button on the remote would turn it off and you would have to press it again turn it on again.
The button on the remote could be intermittent due to wear or a defect.
 
Solution