https://github.com/elupus/nibeuplink
Nibe Uplink asyncronous python interface
https://github.com/elupus/nibeuplink
home-assistant home-automation nibe-uplink
Last synced: 3 months ago
JSON representation
Nibe Uplink asyncronous python interface
- Host: GitHub
- URL: https://github.com/elupus/nibeuplink
- Owner: elupus
- License: mit
- Archived: true
- Created: 2017-11-09T20:55:14.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-12-03T15:36:24.000Z (6 months ago)
- Last Synced: 2025-02-03T22:42:05.468Z (4 months ago)
- Topics: home-assistant, home-automation, nibe-uplink
- Language: Python
- Size: 156 KB
- Stars: 23
- Watchers: 6
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE.txt
Awesome Lists containing this project
README
********************************
Nibe Uplink Communciation Module
********************************Deprecation
===========.. warning::
Nibe is shutting down nibeuplink.com which this integration is dependent upon. This project is therefor deprecated. Upgrade your heatpump and swith to myuplink solution, use built in modbus server on S-series pumps or add a nibegw device like https://github.com/elupus/esphome-nibe to use the native support inside home assistant instead.
Module
======The module is an asyncio driven interface to nibe uplink public API. It is throttled to one http request every 4 seconds so
try to make the most of your requests by batching requests.Status
______
.. image:: https://github.com/elupus/nibeuplink/actions/workflows/python-package.yml/badge.svg
:target: https://github.com/elupus/nibeuplink/actions/workflows/python-package.yml.. image:: https://codecov.io/gh/elupus/nibeuplink/branch/master/graph/badge.svg?token=WZy5CcdYom
:target: https://codecov.io/gh/elupus/nibeuplink
Example
_______.. code-block:: python
def token_read():
return Nonedef token_write(token):
passasync def run():
async with nibeuplink.Uplink(client_id = 'XXX',
client_secret = 'YYY',
redirect_uri = 'ZZZ',
access_data = token_read(),
access_data_write = token_write,
scope = 'READSYSTEM') as uplink:if not uplink.access_data:
auth_uri = uplink.get_authorize_url()
print(auth_uri)
result = input('Enter full redirect url: ')
await uplink.get_access_token(uplink.get_code_from_url(result))# Request all systems
print(uplink.get_systems())# Request data for specific system
print(uplink.get_system(12345))# Request data for parameters. Note request them in paralell using gather semantics
# that way, the module with batch up the requests into a single request to api
print(await asyncio.gather(uplink.get_parameter(12345, 11111),
uplink.get_parameter(12345, 22222)))loop = asyncio.get_event_loop()
loop.run_until_complete (run())Console
=======The module contains a commandline utility to test and request data from Nibe Uplink called ``nibeuplink``, it will store token information in a file in the current directory called nibeuplink.json
Example
_______Help for utility
.. code-block:: bash
nibeuplink -h
Request all systems
.. code-block:: bash
nibeuplink --client_id 'XXX' --client_secret 'YYY' --redirect_uri 'ZZZ'
Request data for specific system
.. code-block:: bash
nibeuplink --client_id 'XXX' --client_secret 'YYY' --redirect_uri 'ZZZ' --system 12345
Request data for parameters
.. code-block:: bash
nibeuplink --client_id 'XXX' --client_secret 'YYY' --redirect_uri 'ZZZ' --system 12345 --parameter 11111 22222