Python interface for Rinnai Control-R API
Project description
aiorinnai - Python interface for the Rinnai Control-R API
Python library for communicating with the Rinnai Control-R Water Heaters and control devices via the Rinnai Control-R cloud API.
WARNING
- This library only works if you have migrated to the Rinnai 2.0 app. This will require a firmware update to your Control-R module.
- IOS
- Android
NOTE:
- This library is community supported, please submit changes and improvements.
- This is a very basic interface, not well thought out at this point, but works for the use cases that initially prompted spitting this out from.
Supports
- starting/stop recirculation
- setting temperature
Installation
pip install aiorinnai==0.3.0
Examples
import asyncio
from aiohttp import ClientSession
from aiorinnai import async_get_api
async def main() -> None:
"""Run!"""
api = await async_get_api("<EMAIL>", "<PASSWORD>")
# Get user account information:
user_info = await api.user.get_info()
# Get device information
first_device_id = user_info["devices"]["items"][0]["id"]
device_info = await api.device.get_info(first_device_id)
#Start Recirculation
#Last variable is duration in minutes
start_recirculation = await api.device.start_recirculation(device_info['data']['getDevices'], 5)
#Stop Recirculation
stop_recirculation = await api.device.stop_recirculation(device_info['data']['getDevices'])
#Set Temperature
#Last variable is the temperature in increments of 5
set_temperature = await api.device.set_temperature(device_info['data']['getDevices'], 130)
asyncio.run(main())
By default, the library creates a new connection to Rinnai with each coroutine. If you are calling a large number of coroutines (or merely want to squeeze out every second of runtime savings possible), an aiohttp ClientSession can be used for connection pooling:
import asyncio
from aiohttp import ClientSession
from aiorinnai import async_get_api
async def main() -> None:
"""Create the aiohttp session and run the example."""
async with ClientSession() as websession:
api = await async_get_api("<EMAIL>", "<PASSWORD>", session=websession)
# Get user account information:
user_info = await api.user.get_info()
# Get device information
first_device_id = user_info["devices"]["items"][0]["id"]
device_info = await api.device.get_info(first_device_id)
#Start Recirculation
#Last variable is duration in minutes
start_recirculation = await api.device.start_recirculation(user_info["id"], first_device_id, 5)
print(start_recirculation)
#Stop Recirculation
stop_recirculation = await api.device.stop_recirculation(user_info["id"], first_device_id)
print(stop_recirculation)
#Set Temperature
#Last variable is the temperature in increments of 5
set_temperature = await api.device.set_temperature(user_info["id"], first_device_id, 130)
asyncio.run(main())
Known Issues
- not all APIs supported
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
aiorinnai-0.3.4.tar.gz
(21.6 kB
view details)
Built Distribution
aiorinnai-0.3.4-py3-none-any.whl
(21.9 kB
view details)
File details
Details for the file aiorinnai-0.3.4.tar.gz
.
File metadata
- Download URL: aiorinnai-0.3.4.tar.gz
- Upload date:
- Size: 21.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e27af1e7662c72e6cccc5e0238a49c5267a105500304a46a6f9478a2bd2742d0 |
|
MD5 | 82a41b231ebac3195e009c6092748589 |
|
BLAKE2b-256 | 9c721546cdb88cd6fafc7a705ad095021b395c86acac37aa386f3897ed25f89e |
File details
Details for the file aiorinnai-0.3.4-py3-none-any.whl
.
File metadata
- Download URL: aiorinnai-0.3.4-py3-none-any.whl
- Upload date:
- Size: 21.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf661e208f14214ebb6ad79a2e876e5500b11ada02e34e5024785f8a2b6103a3 |
|
MD5 | eef2690f55a314e49788e35f56fded2f |
|
BLAKE2b-256 | 7b8ba4f2f79fb9f51cd335659f4a4cc6fc301d72049a4dff26395eb864ebe5f7 |