Skip to main content

xcom-232i

Python library to access Studer-Innotec Xcom-232i device through RS-232 over a serial port.

NOTE: This lib is still WiP, so functionality is still limited, but feel free to create a pull request if you want to contribute ;)

DISCLAIMER: This library is NOT officially made by Studer-Innotec.

The complete official documentation is available on:
Studer-Innotec Download Center -> Software and Updates -> Communication protocol Xcom-232i

Getting Started

Requirements

Hardware

  • Xcom-232i connected to your installation
  • Xcom-232i connected to PC using USB to RS-232 adapter (1)
  • PC with at least USB2.0 or faster (works on Raspberry Pi 3/4 as well)

(1) I personally am successfully using an adapter with the PL2303 chipset like this one

Software

  • any Linux based OS (x86 / ARM)
  • python3 >= 3.6
  • python3-pip

Installation

pip3 install xcom-232i

important: make sure you select the USB to RS-232 adapter as the socket_device, usually on Linux it is /dev/ttyUSB[0-9]

Examples

Reading values

from xcom_232i import XcomRS232
from xcom_232i import XcomC as c

IO = XcomRS232(socket_device='/dev/ttyUSB0', baudrate=115200)

lademodus = IO.get_value(c.OPERATION_MODE)
batt_phase = IO.get_value(c.BAT_CYCLE_PHASE)
solarleistung = IO.get_value(c.PV_POWER) * 1000 # convert from kW to W
sonnenstunden = IO.get_value(c.NUM_SUN_HOURS_CURR_DAY)
ladestand = IO.get_value(c.STATE_OF_CHARGE) # in %
stromprod = IO.get_value(c.PROD_ENERGY_CURR_DAY)
batt_strom = IO.get_value(c.BATT_CURRENT)
batt_spann = IO.get_value(c.BATT_VOLTAGE)

print(f"LModus: {lademodus} | Batt_Phase: {batt_phase} | Solar_P: {solarleistung} | SonnenH: {sonnenstunden} | Batt_V: {batt_spann} | SOC: {ladestand}")

Writing values

from xcom_232i import XcomRS232
from xcom_232i import XcomC as c

IO = XcomRS232(socket_device='/dev/ttyUSB0', baudrate=115200)

# write into RAM
IO.set_value(c.SMART_BOOST_LIMIT, 100) # set smart boost limit
IO.set_value(c.FORCE_NEW_CYCLE, 1, property_id=c.VALUE_QSP) # force new charge cycle

# explanation for property_id:
c.VALUE_QSP # write into Flash memory (important: you should write into flash only if you *really* need it!)
c.UNSAVED_VALUE_QSP # write into RAM (default)

Release files for xcom-232i 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xcom-232i 0.1.4
File Size Uploaded
xcom_232i-0.1.4.tar.gz 17.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xcom-232i 0.1.4
File Interpreter ABI Platform
xcom_232i-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 36.3 kB

Release files / xcom_232i-0.1.4.tar.gz

Download URL xcom_232i-0.1.4.tar.gz
Size 17.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d9655d82ee7248eff058b6e8c46ecd9b0d76920062631d852f99b501515e685d
BLAKE2b-256 checksum
How to use checksums
1998792a1133ce64c66fde0bda7080a8d8fa0ea16b3db8d67a6b434ebe20f12a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.7 CPython/3.8.10 Linux/5.8.18-050818-generic

Release files / xcom_232i-0.1.4-py3-none-any.whl

Download URL xcom_232i-0.1.4-py3-none-any.whl
Size 18.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e86e21c50a381e5abd115486471e3cd52b1c593abdd225363d7e4a5f115dbffa
BLAKE2b-256 checksum
How to use checksums
1a75bce6c4d3624c479133648387cf69ce4536bc331484702208a8ea8a1f7022
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.7 CPython/3.8.10 Linux/5.8.18-050818-generic

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page