The HomePod doesn't support third-party Bluetooth direct control, which is an Apple limitation. But if you are using AppleTV 4K in 2021, and the TV supports the Arc function., you can set the HomePod as the TV's speaker, then turn on Arc. After completing the above settings, the TV remote control can control the volume of the HomePods.
Then create Apple TV and TV as Activity, when assigning buttons, remember to assign the volume button of X1-Remote to TV, and other buttons to control Apple TV, so that after all settings are completed, the volume button of X1 can control the volume of the HomePods (essentially, it controls the TV. volume, HomePods is used as a TV soundbar)