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.
NOTICE
- 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.2.1a9
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(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())
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.2.1a10.tar.gz
(20.5 kB
view hashes)
Built Distribution
Close
Hashes for aiorinnai-0.2.1a10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a0ce36fc148f1d65249c0e752e989b528d022d82d4bdf29ae9235d6c6e78503 |
|
MD5 | 52547d133811e5f5ce0d778b37c695b5 |
|
BLAKE2b-256 | b1206528cf99df8935ed71d94ef0edd21df1b3fb1d3430ff7a08b95545039f85 |