Skip to content

Commit

Permalink
[studer] Initial contribution (openhab#8163)
Browse files Browse the repository at this point in the history
Signed-off-by: Giovanni Mirulla <[email protected]>
  • Loading branch information
giovannimirulla authored and andrewfg committed Oct 8, 2020
1 parent cd728b8 commit 400687a
Show file tree
Hide file tree
Showing 24 changed files with 1,722 additions and 0 deletions.
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
/bundles/org.openhab.binding.minecraft/ @ibaton
/bundles/org.openhab.binding.modbus/ @ssalonen
/bundles/org.openhab.binding.modbus.e3dc/ @weymann
/bundles/org.openhab.binding.modbus.studer/ @giovannimirulla
/bundles/org.openhab.binding.modbus.sunspec/ @mrbig
/bundles/org.openhab.binding.modbus.stiebeleltron/ @pail23
/bundles/org.openhab.binding.monopriceaudio/ @mlobstein
Expand Down
5 changes: 5 additions & 0 deletions bom/openhab-addons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1046,6 +1046,11 @@
<artifactId>org.openhab.binding.squeezebox</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.modbus.studer</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.modbus.sunspec</artifactId>
Expand Down
60 changes: 60 additions & 0 deletions bundles/org.openhab.binding.modbus.studer/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".apt_generated">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path=".apt_generated_tests">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
23 changes: 23 additions & 0 deletions bundles/org.openhab.binding.modbus.studer/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.openhab.binding.modbus.studer</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
13 changes: 13 additions & 0 deletions bundles/org.openhab.binding.modbus.studer/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
This content is produced and maintained by the openHAB project.

* Project home: https://www.openhab.org

== Declared Project Licenses

This program and the accompanying materials are made available under the terms
of the Eclipse Public License 2.0 which is available at
https://www.eclipse.org/legal/epl-2.0/.

== Source Code

https://github.com/openhab/openhab-addons
142 changes: 142 additions & 0 deletions bundles/org.openhab.binding.modbus.studer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# Studer

This extension adds support for the Studer protocol.

Studer Innotec, founded in 1987 by Roland Studer, is an ISO certified company that develops and manufactures inverters, inverter/chargers and MPPT solar charge controllers to communicate over the Modbus protocol entirely in Switzerland

For a list of certified products see this page: https://www.studer-innotec.com/

## Supported Things

This bundle adds the following thing type to the Modbus binding.
Note, that the things will show up under the Modbus binding.

| Thing Type IDs | Description | Picture |
|----------------|----------------------------------------------------------------------------------------------------------------------|-------------------------------------|
| bsp | For BSP that offer a highly precise measuring for Xtender, VarioTrack and VarioString systems | ![BSP](doc/bsp.png) |
| xtender | For the Xtender models for system capacities from 0.5kVA to 72kVA that allow for the optimal use of available energy | ![Xtender](doc/xtender.png) |
| variotrack | For the VarioTrack models of MPPT solar charge controllers for systems with solar PV capacity from 1 - 75kWp | ![VarioTrack](doc/variotrack.png) |
| variostring | For the VarioString models of MPPT solar charge controllers for systems with solar PV capacity from 4 | ![VarioString](doc/variostring.png) |


## Thing Configuration

You need first to set up a Serial Modbus bridge according to the Modbus documentation.
Things in this extension will use the selected bridge to connect to the device.

For defining a thing textually, you have to find out the start address of the model block and the length of it.
While the length is usually fixed, the address is not.
Please refer to your device's vendor documentation how model blocks are laid for your equipment.

The following parameters are valid for all thing types:

| Parameter | Type | Required | Default if omitted | Description |
|-----------|---------|----------|-------------------------|----------------------------------------------------------------------------|
| address | integer | yes | `first slave of device` | Address of slave |
| refresh | integer | yes | 5 | Poll interval in seconds. Increase this if you encounter connection errors |

## Channels

The following Channels, and their associated channel types are shown below divided by device.

#### BSP

All channels read for a BSP device

| Channel | Type | Description |
| ------------------ | ------------------------ | --------------------- |
| power | Number:Power | Power |
| batteryVoltage | Number:ElectricPotential | Battery voltage |
| batteryCurrent | Number:ElectricCurrent | Battery current |
| stateOfCharge | Number:Dimensionless | State of Charge |
| batteryTemperature | Number:Temperature | Battery temperature |

#### Xtender

All channels read for a Xtender device

| Channel | Type | Description |
| ----------------- | ------------------------ | ----------------------- |
| inputVoltage | Number:ElectricPotential | Input voltage |
| inputCurrent | Number:ElectricCurrent | Input current |
| inputActivePower | Number:Power | Input active power |
| inputFrequency | Number:Frequency | Input frequency |
| outputVoltage | Number:ElectricPotential | Output voltage |
| outputCurrent | Number:ElectricCurrent | Output current |
| outputActivePower | Number:Power | Output active power |
| outputFrequency | Number:Frequency | Output frequency |
| operatingState | String | Operating state |
| stateInverter | String | State of the inverter |

#### VarioTrack

All channels read for a VarioTrack device

| Channel | Type | Description |
| -------------------- | ------------------------ | ----------------------------------------- |
| modelVarioTrack | String | Model of VarioTrack |
| voltagePVGenerator | Number:ElectricPotential | Voltage of the PV generator |
| powerPVGenerator | Number:Power | Power of the PV generator |
| productionCurrentDay | Number:Energy | Production in (kWh) for the current day |
| batteryVoltage | Number:ElectricPotential | Battery voltage |
| batteryCurrent | Number:ElectricCurrent | Battery current |
| operatingMode | String | Operating mode |
| stateVarioTrack | String | State of the VarioTrack |

#### VarioString

All channels read for a VarioString device

| Channel | Type | Description |
| ----------------------- | ------------------------ | --------------------------------------------- |
| PVVoltage | Number:ElectricPotential | PV voltage |
| PVCurrent | Number:ElectricCurrent | PV current |
| PVPower | Number:Power | PV power |
| ProductionPVCurrentDay | Number:Energy | Production PV in (kWh) for the current day |
| PV1Voltage | Number:ElectricPotential | PV1 voltage |
| PV1Current | Number:ElectricCurrent | PV1 current |
| PV1Power | Number:Power | PV1 power |
| ProductionPV1CurrentDay | Number:Energy | Production PV1 in (kWh) for the current day |
| PV2Voltage | Number:ElectricPotential | PV2 voltage |
| PV2Current | Number:ElectricCurrent | PV2 current |
| PV2Power | Number:Power | PV2 power |
| ProductionPV2CurrentDay | Number:Energy | Production PV2 in (kWh) for the current day |
| batteryVoltage | Number:ElectricPotential | Battery voltage |
| batteryCurrent | Number:ElectricCurrent | Battery current |
| PVMode | String | PV operating mode |
| PV1Mode | String | PV1 operating mode |
| PV2Mode | String | PV2 operating mode |
| stateVarioString | String | State of the VarioString |

## Example

### Thing Configuration

```
Bridge modbus:serial:bridge [port="/dev/ttyUSB0",baud=9600,dataBits=8,parity="even",stopBits="1.0",encoding="rtu"]
Thing modbus:xtender:bridge:xtenderdevice "Xtender" (modbus:serial:modbusbridge) [ slaveAddress=10, refresh=5 ]
```

Note: Make sure that refresh and slave address are numerical, without quotes.

### Item Configuration

```
Number XtenderStuderThing_InputVoltage "Input Voltage [%.2f %unit%]"
{channel="modbus:xtender:bridge:xtenderdevice:inputVoltage"}
Number XtenderStuderThing_InputCurrent "Input Current [%.2f %unit%]" {channel="modbus:xtender:bridge:xtenderdevice:inputCurrent"}
String XtenderStuderThing_StateInverter "State: [%s]" {channel="modbus:xtender:bridge:xtenderdevice:stateInverter"}
```

### Sitemap Configuration

```
Text item=XtenderStuderThing_InputVoltage
Text item=XtenderStuderThing_InputCurrent
Text item=XtenderStuderThing_StateInverter
Chart item=XtenderStuderThing_InputVoltage period=D refresh=600000
Chart item=XtenderStuderThing_InputCurrent period=D refresh=30000
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions bundles/org.openhab.binding.modbus.studer/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>2.5.9-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.modbus.studer</artifactId>

<name>openHAB Add-ons :: Bundles :: Studer Binding</name>
<dependencies>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.modbus</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.io.transport.modbus</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<features name="org.openhab.binding.modbus.studer-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
<repository>file:${basedirRoot}/bundles/org.openhab.io.transport.modbus/target/feature/feature.xml</repository>
<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository>

<feature name="openhab-bindings-modbus-studer" description="Studer Binding" version="${project.version}">
<feature>openhab-runtime-base</feature>
<feature>openhab-transport-modbus</feature>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.modbus/${project.version}</bundle>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.modbus.studer/${project.version}</bundle>
</feature>
</features>
Loading

0 comments on commit 400687a

Please sign in to comment.