You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -10,140 +10,109 @@ have a Mate3s which is connected to your local network using its ethernet port.
10
10
11
11
Tested on Python 3.7. May work on 3.6.
12
12
13
-
## Installation
14
-
15
-
The recommended installation is as follows:
16
-
17
-
```
18
-
pip install mate3
19
-
```
13
+
## Warnings
20
14
21
-
After this you should be able to run the `mate3` command.
15
+
First, the big one:
22
16
23
-
---
24
-
25
-
If you wish to edit the mate3 source (contributions are gladly received!),
26
-
then you can get the project directly from GitHub:
27
-
28
-
```
29
-
# Install poetry if you don't have it already (if you're unsure, you don't have it)
30
-
pip install poetry
17
+
> **WARNING!** Please make sure you read [the license](https://github.com/adamcharnock/mate3/blob/master/LICENSE) before using any of the `write` functionality. You could easily damage your equipment by setting incorrect values (directly or indirectly).
In addition, there are other edges cases that may cause problems, mostly related to if a device is re-assigned a new port. For example, you have two inverters, read some values, then switch their ports over in the Hub before writing some values - which may now go to the 'wrong' one. For now, it's safest not to do that, unless you restart the `Mate3Client` each time. On that note, the recommended approach if you need to poll over time is:
35
20
36
-
# Install mate3 and its dependencies. This also makes the mate3 command available.
37
-
poetry install
21
+
```python
22
+
whileTrue:
23
+
with Mate3Client(...) as client:
24
+
client...
25
+
sleep(1)
38
26
```
39
27
40
-
After this you should be able to run the `mate3` command and edit the
41
-
project's source code.
42
-
43
-
## Enabling the Modbus interface on your Mate 3
44
-
45
-
TBA. System -> opticsre -> Modbus?
46
-
47
-
## Using the library
48
-
49
-
Example use:
28
+
As opposed to
50
29
51
30
```python
52
-
from mate3 import mate3_connection
53
-
from mate3.parsers import ChargeControllerParser, ChargeControllerConfigurationParser
54
-
from mate3.base_structures import Device
55
-
56
-
# IP address of your Mate3s
57
-
host ='192.168.0.123'
58
-
# The Modbus port on the Mate3s. The default (502) will be
59
-
# fine unless you have configured your Mate3s differently
Why? It means you're getting point-in-time values, and don't have to worry about changes (such as ports being switched). There are exceptions, but you should know why you're doing it.
95
38
96
-
### Reading data
39
+
##Installation
97
40
98
-
A simple CLI is available which will read all available values from the Mate3:
41
+
The recommended installation is as follows:
99
42
43
+
```sh
44
+
pip install mate3
100
45
```
101
-
$ mate3 -h
102
-
usage: mate3 [-h] [--host HOST] [--port PORT]
103
-
[--format {text,prettyjson,json}]
104
46
105
-
Read all available data from the Mate3 controller
47
+
After this you should be able to run the `mate3` command.
106
48
107
-
optional arguments:
108
-
-h, --help show this help message and exit
109
-
--host HOST, -H HOST The host name or IP address of the Mate3
110
-
--port PORT, -p PORT The port number address of the Mate3
More documentation is needed, but you can get a pretty code idea from [./examples/getting_started.py](./examples/getting_started.py), copied (somewhat) below.
This was originally a heavily refactored version of
209
+
[basrijn's Outback_Mate3 library](https://github.com/basrijn/Outback_Mate3), though has largely been completely rewritten since. Thanks anyway basrijn!
0 commit comments