Availability_Template option in other switch types

I have a Pioneer receiver in my house that I use in the occasional automation around playing music. It works fine generally except one issue - the only way to tell it to turn on and off is via telnet. Once it is on I can just use the spotify integration to start music on it but I need to use telnet to turn it on which is annoying.

HA does actually have what I need here in the Telnet Switch which is definitely convenient. But using it fills up my logs with noise due to the command_state option. This is because my receiver and my TV are both connected to a power strip that I turn off when I’m not home. My TV has all these smart features that are convenient when I’m home but just drain power when I’m away so I prefer to just unpower the whole setup when no one is around.

The problem is that by doing this HA is constantly trying to do the command_state command and getting a no host available response. It doesn’t actually break anything that it does this but it does make my logs virtually useless since they are filled up with a stream of these cannot connect messages that I just ignore.

I know the command_state option is optional and you can have HA just work off of assumed_state. This is probably what I will do for now but when browsing for an answer I noticed that the Template Switch has an option called availability_template. It appears to be a way to conditionally mark a template switch as available or unavailable based on some other state in HA.

This is perfect for me, its exactly what I was looking for. I could use this to mark my receiver switch as unavailable when the outlet behind it is powered off and available when it is powered on so it only tries its command_state when it is available. Can this option be added to the Telnet Switch? Or alternatively can the Telnet Switch have an option to mark itself as unavailable when the host is unavailable for command_state instead of just throwing an error? That would work as well. It’s similar to how the MQTT Switch works since it has an availability option that matches the switch technology (topic-based).

Personally I think it would be great to have an availability option in all switches, it seems like a pretty universal option. RESTful Switch for instance is one I could see easily having the same problem if you’ve got a device with a REST API or integrating with a service that isn’t always available for whatever reason. Commandline Switch is another if you’ve got something that may or may not be running based on some other automation. I could keep going but I’m sure you get the point.