What is it that you want to accomplish by turning on and off wifi or bluetooth? For both I have a hard time to understand what you want to achieve, and/or what would be the effect of doing that:
It is recommended not to use wifi for HA but use Ethernet instead. If you use ethernet, wifi would be advised to keep off (I believe it is off for me) and there would be no reason to turn it on. If you are using wifi for HA and not Ethernet, turning off wifi would cut you off from accessing HA, and unable to turn wifi back on. It would be like a Home Assistant suicide button. People who do use wifi would be in trouble turning it off.
Turning wifi on and off does not change anything for wifi connected devices that are connected to HA (assuming you did not disconnect HA from local lan). They would still work. If it is your goal to disconnect wifi IOT devices, disabeling the corresponding integration or specific entities would be the way to go.
For bluetooth I can understand a tiny bit more. But if you want to break connections to bluetooth devices that connect directly to HA, you can just disable the bluetooth integration. But Also there: if you also use bluetooth proxies, like a lot of us do because internal bluetooth is limited, that does not accomplish anything, because the proxies will still work. Again, if your goal is to stop connections to bluetooth devices, disabling the integration or specific entities involved will accomplish more.
And then: 99.5% of my time on HA is used to get devices online and keep them that way, not to disconnect any of them.
What exactly is your use case for this? It would likely require an integration by the way: only HAOS would be able to access the host on this level, and it is platform specific. Maybe there’s an integration out there that foes what you need on the platform you use for HA (you did not name it)?
The platform I use is Raspberry 4. Sorry, forgot to mention.
Ok, here is why I would find it useful:
Short version:
Turn off, what you don’t use … as a basic rule.
Long version:
My Raspi 4 is mounted in an aluminum case for thermal reasons and is connected via ethernet.
Due to the shielding effect of the case, Bluetooth range is less than one meter for me and the build-in Bluetooth circuit is useless.
WiFi is not used, nevertheless it connects with my router.
Both transmitters are probably working hard to get their signals out of the aluminum case, thereby uselessly consuming power and creating extra, useless heat.
Additionally the HA-Raspi is located close to its Zonoff Zigbee dongle and a Hue bridge.
Turning off any useless radio signals can only be beneficial for that Zigbee traffic.
That explains why you want them off. That is indeed a logical move. It sounded like you needed to turn them on/off on a regular basis.
I was under the impression that you should not set wifi parameters for the pi when you create the image, and that when you don’t the wifi would be off. But I did read it is a pain to thur off once it is configured. My point about the suicide button for people who use wifi remains though.
Because it affects the host and because it is one time thing, I’d rather see this in the cli than the gui.