PF-WATCHDOG-001 MQTT topics, state payloads, commands, and Home Assistant auto-discovery entities.
Broker: any MQTT 3.1.1 broker on the LAN. No TLS. No authentication required (configurable).
For platform base MQTT topics (availability, relay, telemetry, power), see the Platform MQTT/HA Reference.
| Version | Date | Notes |
|---|---|---|
| 1.0 | 2026-02-11 | Initial release |
The Internet Watchdog adds 2 publish topics and 3 command topics on top of the platform's base MQTT surface. It also registers 8 Home Assistant discovery entities for automatic dashboard integration.
All topics use the device's configured MQTT base topic:
{mqtt_topic}/watchdog/...
Where {mqtt_topic} is set during provisioning (default: pumpfuse/<device_id>).
| Topic | Direction | Retained | Purpose |
|---|---|---|---|
{mqtt_topic}/watchdog/state | Device → Broker | Yes | State payload (14 fields) |
{mqtt_topic}/watchdog/event | Device → Broker | No | Event notifications |
{mqtt_topic}/watchdog/enabled/set | Broker → Device | — | Enable/disable monitoring |
{mqtt_topic}/watchdog/reboot/set | Broker → Device | — | Trigger manual reboot |
{mqtt_topic}/watchdog/stats/reset/set | Broker → Device | — | Reset cumulative statistics |
Topic: {mqtt_topic}/watchdog/state
Retained: Yes
QoS: 0
Cadence: On every state change and every 60 seconds (heartbeat)
{
"state": "monitoring",
"internet_up": true,
"enabled": true,
"relay": true,
"reboot_count": 0,
"total_reboots": 5,
"total_outages": 3,
"consecutive_fails": 0,
"scheduled_reboot": "04:00",
"uptime_percent": 99.7,
"last_check": "2026-02-11T10:30:00Z",
"last_outage": "2026-02-10T03:15:22Z",
"last_reboot": "2026-02-10T03:17:52Z"
}
| Field | Type | Description |
|---|---|---|
state | string | State machine state: "monitoring", "grace_period", "rebooting", "post_reboot_grace", "cooldown", "max_retries_exceeded", "disabled" |
internet_up | boolean | Whether the last ping round succeeded |
enabled | boolean | Master enable/disable switch |
relay | boolean | Relay state: true = closed (power on) |
reboot_count | integer | Reboots in current failure cycle (resets when internet restored) |
total_reboots | integer | Cumulative lifetime reboots |
total_outages | integer | Cumulative lifetime outages |
consecutive_fails | integer | Current streak of failed ping rounds |
scheduled_reboot | string | null | "HH:MM" if daily reboot configured, otherwise null |
uptime_percent | float | 100 × (1 − downtime / monitoring_time) |
last_check | string | null | ISO 8601 UTC of most recent ping check |
last_outage | string | null | ISO 8601 UTC of most recent outage |
last_reboot | string | null | ISO 8601 UTC of most recent router reboot |
Topic: {mqtt_topic}/watchdog/event
Retained: No
QoS: 0
Published at the moment an event occurs. Fire-and-forget.
{
"event": "outage_detected",
"reboot_count": 0
}
| Field | Type | Description |
|---|---|---|
event | string | Event type (see table below) |
reboot_count | integer | Reboots at the time of this event |
| Event | When published |
|---|---|
device_online | Device booted and started monitoring |
outage_detected | All ping targets failed for fail_threshold consecutive rounds |
reboot_started | Router power-cycle initiated (relay opened) |
internet_restored | Connectivity recovered after an outage |
max_retries_exceeded | All retry attempts exhausted |
scheduled_reboot | Daily scheduled reboot triggered |
manual_reboot | User-initiated reboot (any interface) |
enabled | Monitoring was enabled |
disabled | Monitoring was disabled |
Topic: {mqtt_topic}/watchdog/enabled/set
Payload: ON or OFF (case-insensitive)
| Payload | Effect |
|---|---|
ON | Enters monitoring state, resets consecutive_fails and reboot_count, pushes enabled event |
OFF | Enters disabled state, turns relay on (ensures router stays powered), pushes disabled event |
Publishes updated state immediately after.
Topic: {mqtt_topic}/watchdog/reboot/set
Payload: PRESS
Triggers a manual router power-cycle. Ignored if device is already in rebooting or post_reboot_grace state.
Publishes manual_reboot event and updated state.
Topic: {mqtt_topic}/watchdog/stats/reset/set
Payload: PRESS
Resets all cumulative statistics to zero (total_reboots, total_outages, uptime counters, timestamps). Persists to NVS.
Publishes updated state immediately after.
The device publishes HA discovery configs on MQTT connect. Discovery topics follow the standard pattern:
homeassistant/<component>/<unique_id>/config
All entities include:
unique_id derived from device identityavailability_topic pointing to {mqtt_topic}/availabilitydevice block with name, model, manufacturer, firmware version| Property | Value |
|---|---|
| Component | binary_sensor |
| ID | internet_up |
| Name | Internet |
| Icon | mdi:web |
| Device class | connectivity |
| State topic | {mqtt_topic}/watchdog/state |
| Value template | {{ 'ON' if value_json.internet_up else 'OFF' }} |
Shows as Connected / Disconnected in HA.
| Property | Value |
|---|---|
| Component | sensor |
| ID | watchdog_state |
| Name | Watchdog State |
| Icon | mdi:shield-check |
| State topic | {mqtt_topic}/watchdog/state |
| Value template | {{ value_json.state }} |
Displays the current state machine state as text.
| Property | Value |
|---|---|
| Component | sensor |
| ID | total_reboots |
| Name | Total Reboots |
| Icon | mdi:restart |
| State topic | {mqtt_topic}/watchdog/state |
| Value template | {{ value_json.total_reboots }} |
| Property | Value |
|---|---|
| Component | sensor |
| ID | uptime_percent |
| Name | Uptime |
| Icon | mdi:percent |
| Unit | % |
| State topic | {mqtt_topic}/watchdog/state |
| Value template | {{ value_json.uptime_percent | default(100) | round(1) }} |
| Property | Value |
|---|---|
| Component | sensor |
| ID | scheduled_reboot |
| Name | Scheduled Reboot |
| Icon | mdi:clock-outline |
| State topic | {mqtt_topic}/watchdog/state |
| Value template | {{ value_json.scheduled_reboot | default('Disabled', true) }} |
Displays "04:00" or "Disabled".
| Property | Value |
|---|---|
| Component | switch |
| ID | watchdog_enabled |
| Name | Monitoring |
| Icon | mdi:eye |
| State topic | {mqtt_topic}/watchdog/state |
| Command topic | {mqtt_topic}/watchdog/enabled/set |
| Value template | {{ 'ON' if value_json.enabled else 'OFF' }} |
| Payload on/off | ON / OFF |
Toggle switch in HA to enable/disable monitoring.
| Property | Value |
|---|---|
| Component | button |
| ID | trigger_reboot |
| Name | Reboot Router |
| Icon | mdi:restart-alert |
| Command topic | {mqtt_topic}/watchdog/reboot/set |
| Payload press | PRESS |
One-tap button in HA to trigger a manual router reboot.
| Property | Value |
|---|---|
| Component | button |
| ID | reset_stats |
| Name | Reset Statistics |
| Icon | mdi:chart-line-stacked |
| Command topic | {mqtt_topic}/watchdog/stats/reset/set |
| Payload press | PRESS |
One-tap button in HA to zero all cumulative stats.
This single automation covers all 9 watchdog event types. Each event sends a descriptive push notification to your phone via the Home Assistant Companion App.
Prerequisites:
notify.mobile_app_your_phone with your device's notify service (found in Developer Tools → Services)alias: PumpFuse Internet Watchdog Alerts
triggers:
- trigger: mqtt
topic: pumpfuse/+/watchdog/event
value_template: "{{ value_json.event }}"
payload: internet_restored
id: restored
- trigger: mqtt
topic: pumpfuse/+/watchdog/event
value_template: "{{ value_json.event }}"
payload: max_retries_exceeded
id: max_retries
- trigger: mqtt
topic: pumpfuse/+/watchdog/event
value_template: "{{ value_json.event }}"
payload: outage_detected
id: outage
- trigger: mqtt
topic: pumpfuse/+/watchdog/event
value_template: "{{ value_json.event }}"
payload: manual_reboot
id: manual
- trigger: mqtt
topic: pumpfuse/+/watchdog/event
value_template: "{{ value_json.event }}"
payload: scheduled_reboot
id: scheduled
- trigger: mqtt
topic: pumpfuse/+/watchdog/event
value_template: "{{ value_json.event }}"
payload: reboot_started
id: reboot_started
- trigger: mqtt
topic: pumpfuse/+/watchdog/event
value_template: "{{ value_json.event }}"
payload: enabled
id: enabled
- trigger: mqtt
topic: pumpfuse/+/watchdog/event
value_template: "{{ value_json.event }}"
payload: disabled
id: disabled
- trigger: mqtt
topic: pumpfuse/+/watchdog/event
value_template: "{{ value_json.event }}"
payload: device_online
id: device_online
conditions: []
actions:
- action: notify.mobile_app_your_phone
data:
title: Internet Watchdog
message: >-
{% if trigger.id == 'restored' %}
Internet restored after {{ trigger.payload_json.reboot_count }} reboot(s)
{% elif trigger.id == 'max_retries' %}
Internet still down after {{ trigger.payload_json.reboot_count }} reboots — needs attention
{% elif trigger.id == 'outage' %}
Internet outage detected — monitoring
{% elif trigger.id == 'manual' %}
Manual reboot triggered — router restarting
{% elif trigger.id == 'scheduled' %}
Scheduled reboot — router restarting
{% elif trigger.id == 'reboot_started' %}
Router power cycled (reboot #{{ trigger.payload_json.reboot_count }})
{% elif trigger.id == 'enabled' %}
Watchdog monitoring enabled
{% elif trigger.id == 'disabled' %}
Watchdog monitoring disabled
{% elif trigger.id == 'device_online' %}
PumpFuse device came online
{% endif %}
mode: parallel
max: 5
Notes:
+ wildcard in pumpfuse/+/watchdog/event matches any device ID, so one automation handles all PumpFuse devices.mode: parallel with max: 5 allows multiple events to fire simultaneously (e.g., outage_detected followed immediately by reboot_started).notify.mobile_app_* actions. You can also create a notify group to notify all phones with a single action.type: entities
title: Internet Watchdog
entities:
- entity: binary_sensor.<device>_internet_up
name: Internet Status
- entity: sensor.<device>_watchdog_state
name: State
- entity: sensor.<device>_uptime_percent
name: Uptime
- entity: sensor.<device>_total_reboots
name: Lifetime Reboots
- entity: sensor.<device>_scheduled_reboot
name: Scheduled Reboot
- entity: switch.<device>_watchdog_enabled
name: Monitoring
- entity: button.<device>_trigger_reboot
name: Reboot Router
- entity: button.<device>_reset_stats
name: Reset Stats
Replace <device> with the device's object ID prefix (derived from device name).
The platform publishes additional MQTT topics that are always available regardless of product:
| Topic | Purpose |
|---|---|
{mqtt_topic}/availability | online / offline (LWT) |
{mqtt_topic}/status | Platform status JSON (retained, 60s heartbeat) |
{mqtt_topic}/relay/state | Relay ON/OFF |
{mqtt_topic}/relay/set | Relay command |
{mqtt_topic}/telemetry/state | Telemetry config |
{mqtt_topic}/power | Power readings stream |
After OTA firmware update, the previous watchdog/state retained message persists until the device publishes a new one (within 60 seconds of boot, or immediately on first state change).
The MQTT broker host, port, username, and password are configured at the platform level via BLE provisioning or REST API (POST /api/v1/config). The watchdog product does not add any MQTT-specific configuration — it uses the platform's connection.