Device Maintenance¶
Maintenance commands let you handle firmware updates, connectivity recovery, freeze protection, and onboard diagnostics from MQTT.
Before You Start¶
Many maintenance operations are device-specific. Request device features first so you can inspect capability flags and supported temperature ranges.
await mqtt.subscribe_device_feature(device, lambda feature: print(feature))
await mqtt.request_device_info(device)
Firmware OTA Updates¶
Use firmware OTA when the device has already downloaded or advertised an update. The workflow is asynchronous:
Call
nwp500.mqtt.client.NavienMqttClient.check_firmware_update()Wait for the device’s response on its control response topic
If an update is available, call
nwp500.mqtt.client.NavienMqttClient.commit_firmware_update()with anOtaCommitPayload
Warning
Committing firmware reboots the device. Heating and MQTT connectivity will be interrupted until the upgrade completes.
from nwp500 import OtaCommitPayload
def on_message(topic, message):
print(topic)
print(message)
await mqtt.subscribe_device(device, on_message)
await mqtt.check_firmware_update(device)
# After confirming the component code/version from the async response:
payload = OtaCommitPayload(swCode=1, swVersion=1234)
await mqtt.commit_firmware_update(device, payload)
WiFi Management¶
Two commands cover WiFi recovery:
nwp500.mqtt.client.NavienMqttClient.reconnect_wifi()performs a soft reconnect using the currently stored credentials.nwp500.mqtt.client.NavienMqttClient.reset_wifi()clears WiFi settings and returns the device to an unprovisioned state.
Warning
reset_wifi() is effectively a factory reset for network settings. You will
need to reconfigure the device in the Navien app afterward.
# Try this first when the device drops off WiFi
await mqtt.reconnect_wifi(device)
# Use only when credentials or provisioning are broken
await mqtt.reset_wifi(device)
Freeze Protection¶
Freeze protection is available on devices that expose the
freeze_protection_use capability. The threshold is specified in the user’s
preferred temperature unit and converted automatically.
The implementation documentation describes a typical supported range of
35-45 °F (about 1.7-7.2 °C). You can also inspect
DeviceFeature.freeze_protection_temp_min and
DeviceFeature.freeze_protection_temp_max after requesting device info.
# Fahrenheit example
await mqtt.set_freeze_protection_temperature(device, 40.0)
Smart Diagnostics¶
Smart diagnostics are available on devices that expose the
smart_diagnostic_use capability. Triggering the diagnostic tells the device
to run its onboard self-check routine.
The result is reflected in the next
DeviceStatus update via the smart_diagnostic field.
def on_status(status):
print(f"Diagnostic status: {status.smart_diagnostic}")
await mqtt.subscribe_device_status(device, on_status)
await mqtt.run_smart_diagnostic(device)
await mqtt.request_device_status(device)