Skip to main content

E3/DC client for python

Project description

python-e3dc

PyPI version GitHub license Codestyle Documentation Status

NOTE: With Release 0.10.0 at least Python 3.10 is required

Python API for querying an E3/DC systems

This is supported either directly via RSCP connection or through the manufacturer's portal. The RSCP implementation has currently the most capabilities.

In order to use it you need:

  • Your user name
  • Your password
  • The IP address of the E3/DC system
  • The RSCP Password (encryption key), as set on the device under Main Page -> Personalize -> User profile -> RSCP password

Alternatively, for a web connection, you need:

  • Your user name
  • Your password
  • The serial number of the system, which can be found when logging into the E3/DC webpage.

Installation

This package can be installed from pip:

pip install pye3dc

Configuration

There is a great variety of E3/DC implementation configurations, that can't automatically be detected. For example the index of the root power meter can be either 0 or 6, depending how the system was installed. Additional power meter can have an ID of 1-4 and there might be also multiple inverter. This library assumes, that there is one inverter installed and the root power meter has an index of 6 for S10 mini and 0 for other systems.

For any other configurations, there is an optional configuration object that can be used to alter the defaults:

{
  "pvis": [
    {
      "index": 0,
      "strings": 2,
      "phases": 3
    }
  ],
  "powermeters": [
    {
      "index": 6
    }
  ],
  "batteries": [
    {
      "index": 0,
      "dcbs": 2
    }
  ]
}

Note: Not all options need to be configured.

Usage

Local Connection

An example script using the library is the following:

from e3dc import E3DC

TCP_IP = '192.168.1.57'
USERNAME = 'test@test.com'
PASS = 'MySecurePassword'
KEY = 'abc123'
CONFIG = {}
# CONFIG = {"powermeters": [{"index": 6}]}

print("local connection")
e3dc_obj = E3DC(E3DC.CONNECT_LOCAL, username=USERNAME, password=PASS, ipAddress = TCP_IP, key = KEY, configuration = CONFIG)
# The following connections are performed through the RSCP interface
print(e3dc_obj.poll(keepAlive=True))
print(e3dc_obj.get_pvi_data(keepAlive=True))
e3dc_obj.disconnect()

Web Connection

An example script using the library is the following:

from e3dc import E3DC

USERNAME = 'test@test.com'
PASS = 'MySecurePassword'
SERIALNUMBER = 'S10-012345678910'
CONFIG = {}

print("web connection")
e3dc_obj = E3DC(E3DC.CONNECT_WEB, username=USERNAME, password=PASS, serialNumber = SERIALNUMBER, isPasswordMd5=False, configuration = CONFIG)
# connect to the portal and poll the status. This might raise an exception in case of failed login. This operation is performed with Ajax
print(e3dc_obj.poll(keepAlive=True))
print(e3dc_obj.get_pvi_data(keepAlive=True))
e3dc_obj.disconnect()

Example: poll() return values

Poll returns a dictionary like the following:

{
    'autarky': 100,
    'consumption': {
        'battery': 470,
        'house': 477,
        'wallbox': 0
    },
    'production': {
        'solar' : 951,
        'add' : 0,
        'grid' : -4
    },
    'stateOfCharge': 77,
    'selfConsumption': 100,
    'time': datetime.datetime(2021, 8, 14, 7, 6, 13)
}

Available methods

  • poll()

  • get_system_info()

  • get_system_status()

  • poll_switches()

  • get_idle_periods()

  • set_idle_periods()

  • get_db_data()

  • get_batteries()

  • get_battery_data()

  • get_batteries_data()

  • get_pvis()

  • get_pvi_data()

  • get_pvis_data()

  • get_powermeters()

  • get_powermeter_data()

  • get_powermeters_data()

  • get_power_settings()

  • get_wallbox_data()

  • set_battery_to_car_mode()

  • set_power_limits()

  • set_powersave()

  • set_wallbox_max_charge_current()

  • set_wallbox_schuko()

  • set_wallbox_sunmode()

  • set_weather_regulated_charge()

  • toggle_wallbox_charging()

  • toggle_wallbox_phases()

  • sendWallboxRequest()

  • sendWallboxSetRequest()

See the full documentation on ReadTheDocs

Note: The RSCP interface

The communication to an E3/DC system has to be implemented via a rather complicated protocol, called by E3/DC RSCP. This protocol is binary and based on websockets. The documentation provided by E3/DC is limited and outdated. It can be found in the E3/DC download portal.

If keepAlive is false, the websocket connection is closed after the command. This makes sense because these requests are not meant to be made as often as the status requests, however, if keepAlive is True, the connection is left open and kept alive in the background in a separate thread.

Known limitations

One limitation of the package concerns the implemented RSCP methods. This project also lacks the hardware to test different configurations. However, the RSCP protocol is fully implemented and it should be easy to extend the requests to other use cases.

Projects using this library

  • e3dc-rest: a simple REST API to access an E3/DC system
  • e3dc-to-mqtt: publish E3/DC data via MQTT
  • weewx-photovoltaics: Extension to WeeWX for processing data of the photovoltaics system E3/DC
  • hacs-e3dc: HACS Version of the E3DC Home Assistant integration
  • e3dc-cli: a simple command line interface for interaction with an E3/DC system

Contribution

  • Open an issue before making a pull request
  • Note the E3/DC system you tested with and implementation details
  • Pull request checks will enforce code styling
    • Install development dependencies pip install -U --upgrade-strategy eager .[develop]
    • Run tools/validate.sh before creating a commit.
  • Make sure to support Python versions >= 3.8
  • Consider adding yourself to AUTHORS

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pye3dc-0.10.0.tar.gz (60.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pye3dc-0.10.0-py3-none-any.whl (60.7 kB view details)

Uploaded Python 3

File details

Details for the file pye3dc-0.10.0.tar.gz.

File metadata

  • Download URL: pye3dc-0.10.0.tar.gz
  • Upload date:
  • Size: 60.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pye3dc-0.10.0.tar.gz
Algorithm Hash digest
SHA256 5c594788aeb85d2b4f3696d0242fa0bd1ec67883cf68d1253cc8e25e7e219a3b
MD5 24119f6864d4ba31d952d9e7e72c9d49
BLAKE2b-256 e5a29984840deb8c23023ccc058c8d3adef3ab8105a553b7631333fdc3b1c044

See more details on using hashes here.

Provenance

The following attestation bundles were made for pye3dc-0.10.0.tar.gz:

Publisher: make_wheel.yml on fsantini/python-e3dc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pye3dc-0.10.0-py3-none-any.whl.

File metadata

  • Download URL: pye3dc-0.10.0-py3-none-any.whl
  • Upload date:
  • Size: 60.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pye3dc-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e2f5e16cba6989d5e501b4e5cae1f066214672504cce6fc67dc4bdd45d26e76
MD5 ef6893ffea03bce5477f3a1ee3a16ab1
BLAKE2b-256 6f9f2bf030e5d549010041332550ab1bfd4b4df3ca7aa2e043bfa1940f6a5db0

See more details on using hashes here.

Provenance

The following attestation bundles were made for pye3dc-0.10.0-py3-none-any.whl:

Publisher: make_wheel.yml on fsantini/python-e3dc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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