Skip to content

Commit 5005c45

Browse files
committed
update README
1 parent 9c2f687 commit 5005c45

1 file changed

Lines changed: 37 additions & 33 deletions

File tree

README.md

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ This package can be installed from pip:
3030

3131
`pip install pye3dc`
3232

33-
## Local Connection
34-
35-
### Configuration
33+
## Configuration
3634

3735
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.
3836
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.
@@ -64,7 +62,9 @@ For any other configurations, there is an optional `configuration` object that c
6462

6563
> Note: Not all options need to be configured.
6664
67-
### Usage
65+
## Usage
66+
67+
### Local Connection
6868

6969
An example script using the library is the following:
7070

@@ -79,13 +79,34 @@ CONFIG = {}
7979
# CONFIG = {"powermeters": [{"index": 6}]}
8080

8181
print("local connection")
82-
e3dc = E3DC(E3DC.CONNECT_LOCAL, username=USERNAME, password=PASS, ipAddress = TCP_IP, key = KEY, configuration = CONFIG)
82+
e3dc_obj = E3DC(E3DC.CONNECT_LOCAL, username=USERNAME, password=PASS, ipAddress = TCP_IP, key = KEY, configuration = CONFIG)
8383
# The following connections are performed through the RSCP interface
84-
print(e3dc.poll())
85-
print(e3dc.get_pvi_data())
84+
print(e3dc_obj.poll(keepAlive=True))
85+
print(e3dc_obj.get_pvi_data(keepAlive=True))
86+
e3dc_obj.disconnect()
87+
```
88+
89+
### Web Connection
90+
91+
An example script using the library is the following:
92+
93+
```python
94+
from e3dc import E3DC
95+
96+
USERNAME = 'test@test.com'
97+
PASS = 'MySecurePassword'
98+
SERIALNUMBER = 'S10-012345678910'
99+
CONFIG = {}
100+
101+
print("web connection")
102+
e3dc_obj = E3DC(E3DC.CONNECT_WEB, username=USERNAME, password=PASS, serialNumber = SERIALNUMBER, isPasswordMd5=False, configuration = CONFIG)
103+
# connect to the portal and poll the status. This might raise an exception in case of failed login. This operation is performed with Ajax
104+
print(e3dc_obj.poll(keepAlive=True))
105+
print(e3dc_obj.get_pvi_data(keepAlive=True))
106+
e3dc_obj.disconnect()
86107
```
87108

88-
### poll() return values
109+
## Example: poll() return values
89110

90111
Poll returns a dictionary like the following:
91112

@@ -108,7 +129,7 @@ Poll returns a dictionary like the following:
108129
}
109130
```
110131

111-
### Available methods
132+
## Available methods
112133

113134
- `poll()`
114135
- `get_system_info()`
@@ -117,10 +138,13 @@ Poll returns a dictionary like the following:
117138
- `get_idle_periods()`
118139
- `set_idle_periods()`
119140
- `get_db_data()`
141+
- `get_batteries()`
120142
- `get_battery_data()`
121143
- `get_batteries_data()`
144+
- `get_pvis()`
122145
- `get_pvi_data()`
123146
- `get_pvis_data()`
147+
- `get_powermeters()`
124148
- `get_powermeter_data()`
125149
- `get_powermeters_data()`
126150
- `get_power_settings()`
@@ -130,34 +154,12 @@ Poll returns a dictionary like the following:
130154

131155
See the full documentation on [ReadTheDocs](https://python-e3dc.readthedocs.io/en/latest/)
132156

133-
### Note: The RSCP interface
157+
## Note: The RSCP interface
134158

135159
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.
136160

137161
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.
138162

139-
## Web connection
140-
141-
### Usage
142-
143-
An example script using the library is the following:
144-
145-
```python
146-
from e3dc import E3DC
147-
148-
TCP_IP = '192.168.1.57'
149-
USERNAME = 'test@test.com'
150-
PASS = 'MySecurePassword'
151-
SERIALNUMBER = '1234567890'
152-
153-
print("web connection")
154-
e3dc = E3DC(E3DC.CONNECT_WEB, username=USERNAME, password=PASS, serialNumber = SERIALNUMBER, isPasswordMd5=False)
155-
# connect to the portal and poll the status. This might raise an exception in case of failed login. This operation is performed with Ajax
156-
print(e3dc.poll())
157-
# Poll the status of the switches using a remote RSCP connection via websockets
158-
# return value is in the format {'id': switchID, 'type': switchType, 'name': switchName, 'status': switchStatus}
159-
print(e3dc.poll_switches())
160-
```
161163

162164
## Known limitations
163165

@@ -174,6 +176,8 @@ One limitation of the package concerns the implemented RSCP methods. This projec
174176

175177
- Open an issue before making a pull request
176178
- Note the E3/DC system you tested with and implementation details
177-
- Pull request checks will enforce code styling (black, flake8, flake8-docstrings, isort)
179+
- Pull request checks will enforce code styling
180+
- Install development dependencies `pip install -U --upgrade-strategy eager .[develop]`
181+
- Run `tools/validate.sh` before creating a commit.
178182
- Make sure to support Python versions >= 3.8
179183
- Consider adding yourself to `AUTHORS`

0 commit comments

Comments
 (0)