Press "Enter" to skip to content

Controlling the Elecraft K4 and KPA1500 with Home Assistant

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

switch:
– platform: wake_on_lan
name: Elecraft KPA1500 Amplifier
mac: 54:10:01:02:0A:0B
turn_off:
service: shell_command.turn_off_kpa1500shell_command:
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)

Now for the K4…
Since the K4 does not yet support Wake_On_LAN, you have to resort to the old ways to remotely turn on the radio. But once the radio is on, then HA can check the status and allow you to turn it off. So for my use case, I can send a command to the radio to turn off as part of my ham shack off scene (goodnight).
In the switch section of the configuration.yaml, add the following:
– platform: telnet
    switches:
      k4:
        name: “Elecraft K4 Transceiver”
        resource: “192.168.1.108”
        port: 9200
        command_off: “PS0;”
        command_on: “PS1;”
        command_state: “PS;”
        value_template: “{{ ‘PS1’ in value }}”
        timeout: 0.9

Be First to Comment

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.