Skip to main content

PyPlumIO is a native ecoNET library for Plum ecoMAX controllers.

Project description

PyPlumIO is a native ecoNET library for Plum ecoMAX controllers.

PyPI version PyPI Supported Python Versions Code style: black PyPlumIO CI Maintainability Test Coverage

Overview

This package aims to provide complete and easy to use solution for communicating with climate devices by Plum Sp. z o.o.

Currently it supports reading and writing parameters of ecoMAX automatic pellet boiler controllers, getting service password and sending network information to display on regulator panel.

Devices can be connected directly via RS485 to USB converter or through network by using serial port server (for example Elfin EW11)

This project is considered to be in Pre-Alpha state and there will be breaking changes down the road and a lot of bugs, please use with care.

Usage

To interact with devices, you must pass async callback to EcoNET.run(callback: Callable, interval: int) method. Callback will receive pyplumio.DeviceCollection instance devices that will contain all found supported devices and pyplumio.EcoNET class instance econet that represents current connection.

Second optional parameter for EcoNET.run(callback: Callable, interval: int) method - interval defines how often the callback will be called in seconds. If unspecified, callback will be called every second.

You can find examples for each supported connection type below.

TCP

from pyplumio import econet_tcp_connection

async def my_callback(devices, econet):
	# do something
	...

with econet_tcp_connection(host="localhost", port=8899) as c:
    c.run(my_callback, interval=1)

Serial

from pyplumio import econet_serial_connection

async def my_callback(devices, econet):
	# do something
	...

with econet_serial_connection(device="/dev/ttyUSB0", baudrate=115200) as c:
    c.run(my_callback, interval=1)

Working with data

Data is separated into immutable data that you can't change and parameters that you can. Both can be accessed via instance attributes devices.ecomax.data['HEATING_TEMP'], devices.ecomax.parameters['HEATING_SET_TEMP'] or as shortcut devices.ecomax.heating_temp, devices.ecomax.heating_set_temp.

Each regulator supports different data attributes and parameters. You can check what your regulator supports by calling print() on regulator instance.

async def my_callback(devices, econet):
    if devices.ecomax:
        print(devices.ecomax)

Reading

Interaction with device is mainly done through device class instances inside your callback. For example you can read current feedwater temperature by reading heating_temp attribute.

This example, once passed to EcoNET.run(callback: Callable, interval: int) as demonstrated above, will print current feedwater temperature every second.

async def my_callback(devices, econet):
    if devices.ecomax:
        print(devices.ecomax.heating_temp)  # 61.923828125

Writing

You can easily set regulator parameter by changing respective class attribute. Example below will set target temperature to 65 degrees celsius and close connection.

async def my_callback(devices, econet):
    if devices.ecomax and devices.ecomax.heating_set_temp is not None:
    	devices.ecomax.heating_set_temp = 65  # This will set target temperature to 65 degrees Celsius.
        econet.close()

Please note that each parameter has range of acceptable values that you must check and honor by yourself. This package currently silently ignores out of range values. You can check allowed values by reading min_ and max_ attributes.

async def my_callback(devices, econet):
    if devices.ecomax and devices.ecomax.heating_set_temp is not None:
    	print(devices.ecomax.heating_set_temp.min_)  # Prints minimum allowed target temperature.
        print(devices.ecomax.heating_set_temp.max_)  # Prints maximum allowed target temperature.

Setting network and wifi information

You can send network information to the regulator to be displayed on regulator's LCD as illustrated below.

Currently it's used for informational purposes only and can be skipped altogether.

from pyplumio import econet_tcp_connection
from pyplumio.constants import WLAN_ENCRYPTION_WPA2

async def my_callback(devices, econet):
	# do something
	...

with econet_tcp_connection(host="localhost", port=8899) as c:
    c.set_eth(ip="10.10.1.100", netmask="255.255.255.0", gateway="10.10.1.1")
    c.set_wifi(
    	ip="10.10.2.100",
        netmask="255.255.255.0",
        gateway="10.10.2.1",
        ssid="My WIFI",
        encryption=WLAN_ENCRYPTION_WPA2,
        quality=100
    )
    c.run(my_callback)

Home Assistant Integration

There is companion Home Assistant integration that is being co-developed with this package and depends on it. You can find it here.

Attribution

Special thanks to econetanalyze project by twkrol for initial information about protocol.

License

This product is distributed under MIT license.

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

PyPlumIO-0.0.19.tar.gz (22.5 kB view hashes)

Uploaded Source

Built Distribution

PyPlumIO-0.0.19-py3-none-any.whl (33.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page