For awhile now I have wanted to be able to have my “Goodnight” scene in HomeAssistant turn off my network attached ham gear. I finally had a chance to do some experimenting and created this config to turn on and off the KPA1500.This sends a command via UDP to the amp to turn it off and uses Wake_On_LAN to turn it on. A similar thing could be added for other device types. This is added to the configuration.yaml file.
Put your real MAC address of the amp next to mac. If you mac address is 54:10:01:02:0A:0B, then the line will read mac: 54:10:01:02:0A:0B
– platform: wake_on_lan
name: Elecraft KPA1500 Amplifier
turn_off_kpa1500: “echo ‘^ON0;’ | nc -u 192.168.1.2 1500”
It assumed the IP address of your amp is 192.168.1.2 and it is listening on the default port 1500. Note this is a UDP connection so the command is sent with netcat (nc). ^ON0; turns off the amp. Reference to wake_on_LAN in HomeAssistant is here: https://www.home-assistant.io/integrations/wake_on_lan/. This also assumes you are on the same network as the amplifier.
If you are doing this from a script on a Raspberry PI for example, you can use etherwake (sudo apt-get install etherwake)