A library for controlling Navien NWP500 Water Heaters via NaviLink
Project description
Features
Monitor status (temperature, power, charge %)
Set target water temperature
Change operation mode
Optional scheduling (reservations)
Optional time-of-use settings
Periodic high-temp cycle info
Access detailed status fields
Async friendly
Quick Start
Installation
Basic Installation (Library Only)
For using the library as a Python package without the CLI:
pip install nwp500-python
This installs the core library with support for API and MQTT clients. No CLI framework is required.
Installation with CLI Support
To use the command-line interface with rich formatting and colors:
pip install nwp500-python[cli]
This includes both the click CLI framework and the rich formatting library for enhanced terminal output with formatted tables, progress bars, and colored output.
Basic Usage
from nwp500 import NavienAuthClient, NavienAPIClient
# Authentication happens automatically when entering the context
async with NavienAuthClient("your_email@example.com", "your_password") as auth_client:
# Create API client
api_client = NavienAPIClient(auth_client=auth_client)
# Get device data
devices = await api_client.list_devices()
device = devices[0] if devices else None
if device:
# Access status information
status = device.status
print(f"Water Temperature: {status.dhw_temperature}°F")
print(f"Tank Charge: {status.dhw_charge_per}%")
print(f"Power Consumption: {status.current_inst_power}W")
# Set temperature
await api_client.set_device_temperature(device, 130)
# Change operation mode
await api_client.set_device_mode(device, "heat_pump")
For more detailed authentication information, see the Authentication & Session Management guide.
MQTT Real-Time Monitoring
Monitor your device in real-time using MQTT:
from nwp500 import NavienAuthClient, NavienMqttClient
async with NavienAuthClient("your_email@example.com", "your_password") as auth_client:
# Create MQTT client
mqtt_client = NavienMqttClient(auth_client=auth_client)
await mqtt_client.connect()
# Subscribe to device status updates
def on_status(status):
print(f"Temperature: {status.dhw_temperature}°F")
print(f"Mode: {status.operation_mode}")
device = (await api_client.list_devices())[0]
await mqtt_client.subscribe_device_status(device, on_status)
# Keep the connection alive
await mqtt_client.wait()
Command Line Interface
The library includes a command line interface for monitoring and controlling your Navien water heater.
Installation Requirement: The CLI requires the cli extra:
pip install nwp500-python[cli]
Quick Reference
# Set credentials via environment variables
export NAVIEN_EMAIL="your_email@example.com"
export NAVIEN_PASSWORD="your_password"
# Get current device status
python3 -m nwp500.cli status
# Get device information and firmware (via MQTT - DeviceFeature)
python3 -m nwp500.cli info
# Get basic device info from REST API (DeviceInfo)
python3 -m nwp500.cli device-info
# Get controller serial number
python3 -m nwp500.cli serial
# Turn device on/off
python3 -m nwp500.cli power on
python3 -m nwp500.cli power off
# Set operation mode
python3 -m nwp500.cli mode heat-pump
python3 -m nwp500.cli mode energy-saver
python3 -m nwp500.cli mode high-demand
python3 -m nwp500.cli mode electric
python3 -m nwp500.cli mode vacation
python3 -m nwp500.cli mode standby
# Set target temperature
python3 -m nwp500.cli temp 140
# Set vacation days
python3 -m nwp500.cli vacation 7
# Trigger instant hot water
python3 -m nwp500.cli hot-button
# Set recirculation pump mode (1-4)
python3 -m nwp500.cli recirc 2
# Reset air filter timer
python3 -m nwp500.cli reset-filter
# Enable water program mode
python3 -m nwp500.cli water-program
# View and update schedules
python3 -m nwp500.cli reservations get
python3 -m nwp500.cli reservations set '[{"hour": 6, "min": 0, ...}]'
# Time-of-use settings
python3 -m nwp500.cli tou get
python3 -m nwp500.cli tou set on
# Energy usage data
python3 -m nwp500.cli energy --year 2024 --months 10,11,12
# Demand response
python3 -m nwp500.cli dr enable
python3 -m nwp500.cli dr disable
# Real-time monitoring (logs to CSV)
python3 -m nwp500.cli monitor
python3 -m nwp500.cli monitor -o my_data.csv
Global Options:
--email EMAIL: Navien account email (or use NAVIEN_EMAIL env var)
--password PASSWORD: Navien account password (or use NAVIEN_PASSWORD env var)
-v, --verbose: Enable debug logging
--version: Show version and exit
Available Commands:
status: Show current device status (temperature, mode, power)
info: Show device information (firmware, capabilities)
serial: Get controller serial number
power on|off: Turn device on or off
mode MODE: Set operation mode (heat-pump, electric, energy-saver, high-demand, vacation, standby)
temp TEMPERATURE: Set target water temperature in °F
vacation DAYS: Enable vacation mode for N days
recirc MODE: Set recirculation pump (1=always, 2=button, 3=schedule, 4=temperature)
hot-button: Trigger instant hot water
reset-filter: Reset air filter maintenance timer
water-program: Enable water program reservation mode
reservations get|set: View or update schedule
tou get|set STATE: View or configure time-of-use settings
energy: Query historical energy usage (requires --year and --months)
dr enable|disable: Enable or disable demand response
monitor: Monitor device status in real-time (logs to CSV with -o option)
Device Status Fields
The library provides access to comprehensive device status information:
- Temperature Sensors
Water temperature (current and target)
Tank upper/lower temperatures
Ambient temperature
Discharge, suction, and evaporator temperatures
Inlet temperature
- System Status
Operation mode (Heat Pump, Energy Saver, High Demand, Electric, Vacation)
Compressor status
Heat pump and electric heater status
Evaporator fan status
Tank charge percentage
- Power & Energy
Current power consumption (Watts)
Total energy capacity (Wh)
Available energy capacity (Wh)
- Diagnostics
WiFi signal strength
Error codes
Fault status
Cumulative operation time
Flow rates
Documentation
Full docs: https://nwp500-python.readthedocs.io/
Data Models
The library includes type-safe data models with automatic unit conversions:
DeviceStatus: Complete device status with 70+ fields
DeviceFeature: Device capabilities, firmware versions, and configuration limits
OperationMode: Enumeration of available operation modes
TemperatureUnit: Celsius/Fahrenheit handling
Requirements
Python 3.13+
aiohttp >= 3.8.0
pydantic >= 2.0.0
awsiotsdk >= 1.27.0
License
This project is licensed under the MIT License.
Acknowledgments
This project has been set up using PyScaffold 4.6. For details and usage information on PyScaffold see https://pyscaffold.org/.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nwp500_python-7.2.3.tar.gz.
File metadata
- Download URL: nwp500_python-7.2.3.tar.gz
- Upload date:
- Size: 361.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2386f2b8a8aac08af76149916788eca60bf9cc34723cd4d9cef3530f7f6beeea
|
|
| MD5 |
882bd7d519b2596c2e30d2ca4c592116
|
|
| BLAKE2b-256 |
2300de3dc3b4cf40b2ecb76522a48c01cf76c4fbf1297c28c6ed7adc1a967b79
|
Provenance
The following attestation bundles were made for nwp500_python-7.2.3.tar.gz:
Publisher:
release.yml on eman/nwp500-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nwp500_python-7.2.3.tar.gz -
Subject digest:
2386f2b8a8aac08af76149916788eca60bf9cc34723cd4d9cef3530f7f6beeea - Sigstore transparency entry: 829677002
- Sigstore integration time:
-
Permalink:
eman/nwp500-python@e7c2cc08bb36ecf14f0fb3301d49588f6cdd6d0b -
Branch / Tag:
refs/tags/v7.2.3 - Owner: https://github.com/eman
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e7c2cc08bb36ecf14f0fb3301d49588f6cdd6d0b -
Trigger Event:
push
-
Statement type:
File details
Details for the file nwp500_python-7.2.3-py3-none-any.whl.
File metadata
- Download URL: nwp500_python-7.2.3-py3-none-any.whl
- Upload date:
- Size: 116.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38d56a2a101315767ef8a917aadd1a22ac8c6e608bf6e160b5064374b6c0fa37
|
|
| MD5 |
7014ac171ca103b0f2e7398647a85c60
|
|
| BLAKE2b-256 |
9c2a2ae5ea4d13d5de6a4ea3e242121ea4cf65ce6f11b10deff684830c430e78
|
Provenance
The following attestation bundles were made for nwp500_python-7.2.3-py3-none-any.whl:
Publisher:
release.yml on eman/nwp500-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nwp500_python-7.2.3-py3-none-any.whl -
Subject digest:
38d56a2a101315767ef8a917aadd1a22ac8c6e608bf6e160b5064374b6c0fa37 - Sigstore transparency entry: 829677009
- Sigstore integration time:
-
Permalink:
eman/nwp500-python@e7c2cc08bb36ecf14f0fb3301d49588f6cdd6d0b -
Branch / Tag:
refs/tags/v7.2.3 - Owner: https://github.com/eman
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e7c2cc08bb36ecf14f0fb3301d49588f6cdd6d0b -
Trigger Event:
push
-
Statement type: