Updated README from original plugin and created some base code

This commit is contained in:
2021-05-06 16:09:06 +02:00
parent 2300f37f76
commit 6ddd268ade
2 changed files with 32 additions and 74 deletions

View File

@ -1,12 +1,14 @@
# Domoticz SolarEdge_ModbusTCP plugin
# Domoticz DS238-2 ModbusTCP plugin
A Domoticz plugin to collect data from SolarEdge power inverters over ModbusTCP.
The plugin uses the `solaredge_modbus` library (<https://github.com/nmakel/solaredge_modbus>) to communicate with the inverter.
A Domoticz plugin to collect data from Hiking DS238-2 D/ZN power meter ModbusTCP.
## Requirements
The inverter needs to be connected to the network (either wired or wireless) and Modbus must be enabled on the device. Please consult the documentation of your inverter to find out how to enable Modbus.
You need the DS238 to be connected over modbus over TCP. Wired or wireless.
Setup that use this on this plugin is using PW21
You need also to find the address of the DS238. You can find it using the
push button. Per default the address is 1.
## Installation of the plugin
@ -30,13 +32,13 @@ Install the plugin:
``` shell
cd domoticz/plugins
git clone https://github.com/addiejanssen/domoticz-solaredge-modbustcp-plugin.git
git clone https://github.com/xbeaudouin/domoticz-ds238-modbus-tcp.git
```
Go to the plugin folder and install all required addons:
``` shell
cd domoticz/plugins/domoticz-solaredge-modbustcp-plugin
cd domoticz/plugins/domoticz-ds238-modbus-tcp
sudo pip3 install -r requirements.txt
```
@ -48,19 +50,19 @@ sudo service domoticz.sh restart
## Configuration in Domoticz
Once the plugin is installed, a new hardware type will be available: `SolarEdge ModbusTCP`.
Once the plugin is installed, a new hardware type will be available: `DS238-2 D/ZN ModbusTCP`.
To add the inverter, go to `Setup` -> `Hardware` and add the inverter:
To add the inverter, go to `Setup` -> `Hardware` and add the counter:
- Enter a `name` for the inverter.
- Select `SolarEdge ModbusTCP` from the `type` dropdown list.
- Enter the IP address of the inverter in the `Inverter IP Address` field.
- Enter a `name` for the counter.
- Select `DS238-2 D/ZN ModbusTCP` from the `type` dropdown list.
- Enter the IP address of the PW21 in the `Inverter IP Address` field.
- Enter the port number (default: 502) of the inverter in the `Inverter Port Number` field.
- Select `Yes` in the `Add missing devices` to create the devices when the inverter is added. Select `No` after deleting unwanted devices. Leaving the option set to `Yes` will recreate the deleted devices once Domoticz is restarted.
- Select an `Interval` (default: 5 seconds); this defines how often the plugin will collect the data from the inverter. Short intervals will result in more accurate values and graphs, but also result in more network traffic and a higher workload for both Domoticz and the inverter.
- Optionally change the `Log level`; this defaults to `Normal`. When selecting `Extra`, the plugin will print all the information it received from the inverter in the log.
- Select `Yes` in the `Add missing devices` to create the devices when the counter is added. Select `No` after deleting unwanted devices. Leaving the option set to `Yes` will recreate the deleted devices once Domoticz is restarted.
- Select an `Interval` (default: 10 seconds); this defines how often the plugin will collect the data from the counter. Short intervals will result in more accurate values and graphs, but also result in more network traffic and a higher workload for both Domoticz and the counter.
- Optionally change the `Log level`; this defaults to `Normal`. When selecting `Extra`, the plugin will print all the information it received from the counter in the log.
- Optionally turn on `Debug`; be aware: this will generate a lot of entries in the Domoticz log!
- `Add` the inverter.
- `Add` the counter.
This should result in a lot of new devices in the `Setup` -> `Devices` menu.
@ -69,7 +71,7 @@ This should result in a lot of new devices in the `Setup` -> `Devices` menu.
Go to the plugin folder and get the new verion:
``` shell
cd domoticz/plugins/domoticz-solaredge-modbustcp-plugin
cd domoticz/plugins/domoticz-ds238-modbus-tcp
git pull
```
@ -79,54 +81,3 @@ Once that is done, restart domoticz:
sudo service domoticz.sh restart
```
## Example
Here's an example of information returned by an inverter (in this case a SE7000 3 phase inverter):
| Name | Value | Symbol |
|-------------------|-----------------------|--------|
| Model | SE7K | |
| Version | 0003.2251 | |
| Serial | 7E2AB053 | |
| Modbus ID | 1 | |
| SunSpec DID | Three Phase Inverter | |
| Status | Producing | |
| Vendor Status | 0 | |
| Current | 3.59 | A |
| P1 Current | 1.21 | A |
| P2 Current | 1.17 | A |
| P3 Current | 1.20 | A |
| P1 Voltage | 401.4 | V |
| P2 Voltage | 401.2 | V |
| P3 Voltage | 402.8 | V |
| P1-N Voltage | 230.1 | V |
| P2-N Voltage | 232.7 | V |
| P3-N Voltage | 230.4 | V |
| Power | 784.0 | W |
| Frequency | 50.01 | Hz |
| Power (Apparent) | 829.1 | VA |
| Power (Reactive) | -270.00 | VAr |
| Power Factor | -94.46 | % |
| Total Energy | 10773388 | Wh |
| DC Current | 1.0647 | A |
| DC Voltage | 747.5 | V |
| DC Power | 795.9 | W |
| Temperature | 43.53 | °C |
## Screenshots
Hardware page showing a configured inverter.
![](screenshots/Hardware.png)
The devices page shows all Domotics devices that were created for the inverter.
![](screenshots/Devices.png)
The Domoticz Temperature page shows the inverters temperature data.
![](screenshots/Temperature.png)
All the other information is visible in the Domoticz Utility page.
![](screenshots/Utility.png)

View File

@ -1,18 +1,23 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# SolarEdge ModbusTCP
# DS238-2 D/ZN ModbusTCP
#
# Source: https://github.com/xbeaudouin/domoticz-ds238-modbus-tcp
# Author: Xavier Beaudouin (https://oav.net/)
# License: MIT
#
# Based on the work of :
# Source: https://github.com/addiejanssen/domoticz-solaredge-modbustcp-plugin
# Author: Addie Janssen (https://addiejanssen.com)
# License: MIT
#
"""
<plugin key="SolarEdge_ModbusTCP" name="SolarEdge ModbusTCP" author="Addie Janssen" version="1.0.6" externallink="https://github.com/addiejanssen/domoticz-solaredge-modbustcp-plugin">
<plugin key="DS238_ModbusTCP" name="DS238-2 D/ZN ModbusTCP" author="Xavier Beaudouin" version="0.0.1" externallink="https://github.com/xbeaudouin/domoticz-ds238-modbus-tcp">
<params>
<param field="Address" label="Inverter IP Address" width="150px" required="true" />
<param field="Port" label="Inverter Port Number" width="100px" required="true" default="502" />
<param field="Address" label="IP Address" width="150px" required="true" />
<param field="Port" label="Port Number" width="100px" required="true" default="502" />
<param field="Mode1" label="Add missing devices" width="100px" required="true" default="Yes" >
<options>
<option label="Yes" value="Yes" default="true" />
@ -21,13 +26,15 @@
</param>
<param field="Mode2" label="Interval" width="100px" required="true" default="5" >
<options>
<option label="5 seconds" value="5" default="true" />
<option label="10 seconds" value="10" />
<option label="5 seconds" value="5" />
<option label="10 seconds" value="10" default="true" />
<option label="20 seconds" value="20" />
<option label="30 seconds" value="30" />
<option label="60 seconds" value="60" />
</options>
</param>
<param field="Mode3" label="Modbus address" width="100px" required="true" default="1" />
</param>
<param field="Mode5" label="Log level" width="100px">
<options>
<option label="Normal" value="Normal" default="true" />