Package: pye3dc
python-e3dcNOTE: With Release 0.8.0 at least Python 3.8 is requiredPython API for querying anE3/DCsystemsThis 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 nameYour passwordThe IP address of the E3/DC systemThe RSCP Password (encryption key), as set on the device under Main Page -> Personalize -> User profile -> RSCP passwordAlternatively, for a web connection, you need:Your user nameYour passwordThe serial number of the system, which can be found when logging into the E3/DC webpage.InstallationThis package can be installed from pip:pip install pye3dcConfigurationThere is a great variety of E3/DC implementation configurations, that can't automatically be detected. For example theindexof the root power meter can be either0or6, depending how the system was installed. Additional power meter can have an ID of1-4and there might be also multiple inverter.
This library assumes, that there is one inverter installed and the root power meter has an index of6for S10 mini and0for other systems.For any other configurations, there is an optionalconfigurationobject 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.UsageLocal ConnectionAn example script using the library is the following:frome3dcimportE3DCTCP_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 interfaceprint(e3dc_obj.poll(keepAlive=True))print(e3dc_obj.get_pvi_data(keepAlive=True))e3dc_obj.disconnect()Web ConnectionAn example script using the library is the following:frome3dcimportE3DCUSERNAME='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 Ajaxprint(e3dc_obj.poll(keepAlive=True))print(e3dc_obj.get_pvi_data(keepAlive=True))e3dc_obj.disconnect()Example: poll() return valuesPoll 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 methodspoll()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()set_power_limits()set_powersave()set_weather_regulated_charge()See the full documentation onReadTheDocsNote: The RSCP interfaceThe 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 limitationsOne 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 librarye3dc-rest: a simple REST API to access an E3/DC systeme3dc-to-mqtt: publish E3/DC data via MQTTweewx-photovoltaics: Extension to WeeWX for processing data of the photovoltaics system E3/DChacs-e3dc: HACS Version of the E3DC Home Assistant integrationContributionOpen an issue before making a pull requestNote the E3/DC system you tested with and implementation detailsPull request checks will enforce code stylingInstall development dependenciespip install -U --upgrade-strategy eager .[develop]Runtools/validate.shbefore creating a commit.Make sure to support Python versions >= 3.8Consider adding yourself toAUTHORS