Automating APRS Station Restarts with Zwave and Home Assistant
Article Draft in Progress
Introduction
My daughter's APRS station provides iGate coverage for our local area. We set the system up about four years ago using an ICOM 2730 and a Raspberry Pi. The other day, I noticed my Jeep wasn't appearing on the APRS map despite being close to home and upon checking, found the station was off-line for more than two weeks.
This wasn't the usual case of just requiring a restart of the Direwolf service. Rather, the Raspberry Pi itself just seemed to be in a bad state and unresponsive to SSH attempts. So I rebooted the unit and looked at the syslog. The last entry was from August 16th and showed errors that halted the overall system ... though the reboot seemed to fix that.
I needed a solution that would keep the Raspberry Pi up even when I wasn't paying attention to it. The easy way would simply be scheduling a recurring reboot with a cron job or having an Amazon Plug toggle itself on a schedule. Neither solution is elegant and the latter can even introduce unnecessary potential data corruption. Fortunately, if you are willing to deal the nuances of an overly flexible system, Home Assistant can handle this.
How will this work? The Raspberry Pi will beacon to the Home Assistant every five minutes as a digital "proof of life." That beacon will be used by Home Assistant to save a timestamp. Simultaneously, the Home Assistant will keep a running time delta between the current time and the last beacon timestamp. Also simultaneously, the Home Assistant will periodically tell a wireless plug using a Zwave mesh to toggle itself but only if the last seen beacon was longer ago than a predefined threshold. This prevents unnecessary power cycling as it will only happen if the Raspberry Pi enters a bad state that internal scripting cannot recover from.
That said ... configuring all that is a pain in the ass.
Schedule a Heartbeat
In order to let the Home Assistant know the Raspberry Pi is alive, it needs to send a heartbeat of sorts. Fortunately, within Home Assistant, you can create what is called a webhook. This is simply a URL that can be called on the Home Assistant's web server API that will perform an action. Accessing that URL can be as simple as using a command-line tool like curl or wget and doing it on a defined interval. Since the Raspberry Pi is a little Linux box, this can easily be done with a crontab and shell script.
Save the following one liner as send_heartbeat.sh and set it's executable bit.
#!/bin/bash
/usr/bin/curl -X POST http://192.168.1.200:8123/api/webhook/heartbeat_aprs
Edit the user's crontab to periodically execute the heartbeat shell script. Calling it every five minutes is an easy way to make sure the Home Assistant is aware the Raspberry Pi is on-line.
*/5 * * * * /home/aprs/send_heartbeat.sh
Configure a Date/Time Helper
The rest of the configurations will take place on Home Assistant through it's web page. At the time of this article, Home Assistant versions are Core 2026.9.1, Supervisor 2026.09.0, Operating System 18.2 and Frontend 20260826.6.
Although setting up the webhook seems to be the next logical step, it's not. In order the webhook to work, a date/time helper needs to exist for it to act on. Thus, setting up the helper is next. The following sequence of steps will navigate the system to set that up.
- Click the "Settings" icon from the left pane
- Click "Devices & Services" from the presented options
- Click the "Helpers" tab from the top pane
- Click the blue "+Create Helper" button at the bottom right
- Scroll the helpers and select "Date and/or Time"
- Name the helper "Heartbeat - APRS"
- Choose an icon ... I recommend typing "heart" and selecting one
- Check the radio button for "Date and Time"
- Click the blue "Create" button
Configure a Webhook
Now that a date/time helper exists, the webhook will have something to modify when it is activated. Creating a webhook basically establishes a named URL in the Home Assistant's API that can be tied to an action. When this webhook is accessed, it will update the previously created date/time helper.
- Click the "Settings" icon from the left pane
- Click "Automations & Scenes" from the presented options
- Click the blue "Create Automation" button at the bottom right
- Click the "Create New Automation" option
- Click the blue "Add Trigger" button
- Either type "webhook" in the search bar or click "By Type" and scroll the left menu to "Webhook"
- A single trigger option is presented, click it.
- A pane opens on the right that is pre-populated with a random string in the "Webhook ID" field. Replace the text with "heartbeat_aprs"
- Click the blue "Add Action" button
- Either type "input datetime" in the search bar or click "By Type" and scroll the left menu to "Input Datetime"
- Two options are presented, click "Input Datetime: Set Input Datetime Value"
- A pane opens on the right side.
- Click the blue "Add Target" button
- Type "Heartbeat - APRS" in the search bar and click that entity
- Check the "Date & Time" box
- Enter
{{ now().strftime('%Y-%m-%d %H:%M:%S') }}into the text box - Click the blue "Save" button
- A popup will appear asking to name the automation - call it "Heartbeat Hook - APRS"


