I think if you have recent (not sure how recent?) HDMI ports, you can do this via a HDMI cable, which you might already use for displaying purposes? Never encountered it myself until I recently got a PS5 and noticed it and the TV shared both control and power state, so turning on the TV turned on the PS5 before I disabled HDMI CEC.
Alternatively, maybe there are adapters for HDMI that could add/emulate it/something similar?