Metadata-Version: 2.4
Name: nwp500-python
Version: 9.5.1
Summary: A library for controlling Navien NWP500 Water Heaters via NaviLink
Home-page: https://github.com/eman/nwp500-python
Author: Emmanuel Levijarvi
Author-email: emansl@gmail.com
License: MIT
Project-URL: Documentation, https://nwp500-python.readthedocs.io/en/latest/
Project-URL: Source, https://github.com/eman/nwp500-python
Project-URL: Tracker, https://github.com/eman/nwp500-python/issues
Platform: any
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.14
Description-Content-Type: text/x-rst; charset=UTF-8
License-File: LICENSE.txt
Requires-Dist: aiohttp>=3.13.5
Requires-Dist: awsiotsdk>=1.29.0
Requires-Dist: pydantic>=2.0.0
Provides-Extra: cli
Requires-Dist: click>=8.3.0; extra == "cli"
Requires-Dist: rich>=14.3.0; extra == "cli"
Provides-Extra: ble
Requires-Dist: bleak>=0.22.0; extra == "ble"
Provides-Extra: sim
Requires-Dist: numpy>=1.24.0; extra == "sim"
Requires-Dist: pandas>=2.0.0; extra == "sim"
Requires-Dist: scipy>=1.11.0; extra == "sim"
Provides-Extra: testing
Requires-Dist: numpy>=1.24.0; extra == "testing"
Requires-Dist: pandas>=2.0.0; extra == "testing"
Requires-Dist: scipy>=1.11.0; extra == "testing"
Requires-Dist: setuptools; extra == "testing"
Requires-Dist: pytest; extra == "testing"
Requires-Dist: pytest-cov; extra == "testing"
Requires-Dist: pytest-asyncio; extra == "testing"
Requires-Dist: hypothesis; extra == "testing"
Provides-Extra: dev
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: pyright>=1.1.0; extra == "dev"
Requires-Dist: numpy>=1.24.0; extra == "dev"
Requires-Dist: pandas>=2.0.0; extra == "dev"
Requires-Dist: scipy>=1.11.0; extra == "dev"
Requires-Dist: setuptools; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: pytest-asyncio; extra == "dev"
Requires-Dist: hypothesis; extra == "dev"
Dynamic: license-file

=============
nwp500-python
=============

|PyPI-v| |Python-versions| |CI-status| |Docs-status| |Code-style| |License|

Python library for Navien NWP500 Heat Pump Water Heater
========================================================

A Python library for monitoring and controlling the Navien NWP500 Heat Pump Water Heater through the Navilink cloud service.

* **Documentation:** https://nwp500-python.readthedocs.io/
* **Source:** https://github.com/eman/nwp500-python

Features
========
* **REST and MQTT:** The REST API and real-time MQTT (AWS IoT).
* **Monitoring:** Real-time tracking of temperature, power usage, tank charge, and component status.
* **Control:** Remote control of target temperatures, operation modes, and vacation settings.
* **Scheduling:** Reservations, time-of-use (TOU) schedules and anti-legionella cycles.
* **Simulator (optional):** ``nwp500.sim``, a physics model of the heater. It estimates recovery time and available hot water, projects the effect of a change to the schedule or settings, and calibrates against a heater's own history. ``nwp-cli simulate`` runs it against the live heater or a scenario file. Install with ``pip install nwp500-python[sim]``.

Getting Started
===============

.. code-block:: bash

    pip install nwp500-python

Quick Example
-------------

.. code-block:: python

    import asyncio

    from nwp500 import NavienAPIClient, NavienAuthClient, NavienMqttClient


    async def main():
        async with NavienAuthClient("email@example.com", "password") as auth:
            api = NavienAPIClient(auth)
            device = await api.get_first_device()

            # Status and control go over MQTT.
            mqtt = NavienMqttClient(auth)
            await mqtt.connect()
            try:
                got = asyncio.Event()

                def on_status(status):
                    print(f"Tank: {status.dhw_temperature}°F, "
                          f"setpoint {status.dhw_target_temperature_setting}°F")
                    got.set()

                await mqtt.subscribe_device_status(device, on_status)
                await mqtt.request_device_status(device)
                await asyncio.wait_for(got.wait(), timeout=20)

                await mqtt.set_dhw_temperature(device, 130)
            finally:
                await mqtt.disconnect()


    asyncio.run(main())

Documentation
=============

* `Tutorials <https://nwp500-python.readthedocs.io/en/latest/tutorials/getting-started.html>`_: Start here if you're new to the library.
* `How-to Guides <https://nwp500-python.readthedocs.io/en/latest/how-to/index.html>`_: Practical step-by-step recipes for specific tasks.
* `Reference <https://nwp500-python.readthedocs.io/en/latest/reference/index.html>`_: Technical descriptions of the API, models, and protocol.
* `Explanation <https://nwp500-python.readthedocs.io/en/latest/explanation/index.html>`_: How the library and the device work.

Contributing
============

We welcome contributions! Please see our `Contributing Guide <https://nwp500-python.readthedocs.io/en/latest/project/contributing.html>`_ for more details.

License
=======

This project is licensed under the MIT License. See the `LICENSE.txt <https://github.com/eman/nwp500-python/blob/main/LICENSE.txt>`_ file for details.

.. |PyPI-v| image:: https://img.shields.io/pypi/v/nwp500-python.svg
   :target: https://pypi.org/project/nwp500-python/
.. |Python-versions| image:: https://img.shields.io/pypi/pyversions/nwp500-python.svg
   :target: https://pypi.org/project/nwp500-python/
.. |CI-status| image:: https://github.com/eman/nwp500-python/actions/workflows/ci.yml/badge.svg
   :target: https://github.com/eman/nwp500-python/actions/workflows/ci.yml
.. |Docs-status| image:: https://readthedocs.org/projects/nwp500-python/badge/?version=latest
   :target: https://nwp500-python.readthedocs.io/en/latest/?badge=latest
.. |Code-style| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
   :target: https://github.com/astral-sh/ruff
.. |License| image:: https://img.shields.io/pypi/l/nwp500-python.svg
   :target: https://opensource.org/licenses/MIT
