Disable switch using automation

install Spook as an Integration and you can use a service called service: homeassistant.disable_device in your automation to disable the device you want