Skip to content

Commit

Permalink
[fronius] Add new channels and fix documentation (#7247)
Browse files Browse the repository at this point in the history
* Added status code and error code channel
* Fix documentation

Signed-off-by: Peter Schraffl <[email protected]>
  • Loading branch information
hypetsch authored Apr 4, 2020
1 parent 286f4b6 commit 6b95a8b
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 24 deletions.
57 changes: 33 additions & 24 deletions bundles/org.openhab.binding.fronius/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,51 +5,58 @@ This binding uses the [Fronius Solar API V1](https://www.fronius.com/en/photovol

## Supported Things

Support Fronius Galvo, Fronius Symo inverters and other Fronius inverters in combination with the Fronius Datamanager 1.0 / 2.0 or Fronius Datalogger.
You can add multiple inverters that depend on the same datalogger with different device ids. ( Default 1 )
Support Fronius Galvo, Fronius Symo inverters and other Fronius inverters in combination with the Fronius Datamanager 1.0 / 2.0 or Fronius Datalogger.
You can add multiple inverters that depend on the same datalogger with different device ids. (Default 1)

## Discovery

There is no discovery implemented. You have to create your things manually and specify the IP of the Datalogger and the DeviceId.
There is no discovery implemented. You have to create your things manually and specify the hostname or IP address of the Datalogger and the device id.

## Binding Configuration

The binding has no configuration options, all configuration is done at Thing level.
The binding has no configuration options, all configuration is done at `bridge` or `powerinverter` level.

## Thing Configuration

The thing has a few configuration parameters:
### Bridge Thing Configuration

| Parameter | Description |
|-----------|------------------------------------------------------------------------- |
| Ip | the ip-address of your Fronius Datalogger |
| DeviceId | The identifier of your device ( Default: 1) |
| refresh | Refresh interval in seconds |
| Parameter | Description |
|-----------------|------------------------------------------------------ |
| hostname | The hostname or IP address of your Fronius Datalogger |
| refreshInterval | Refresh interval in seconds |

### Powerinverter Thing Configuration

| Parameter | Description |
|-----------------|------------------------------------------------------ |
| deviceId | The identifier of your device (Default: 1) |

## Channels

| Channel ID | Item Type | Description |
|------------|--------------|------------------------- |
| day_energy | Number | Energy generated on current day |
| pac | Number | AC powery |
| total_energy | Number | Energy generated overall |
| year_energy | Number | Energy generated in current year |
| fac | Number | AC frequency |
| iac | Number | AC current |
| idc | Number | DC current |
| uac | Number | AC voltage |
| udc | Number | DC voltage |
| pGrid | Number | Power + from grid, - to grid |
| pLoad | Number | Power + generator, - consumer |
| pAkku | Number | Power + charge, - discharge |
| inverterdatachanneldayenergy | Number | Energy generated on current day |
| inverterdatachannelpac | Number | AC powery |
| inverterdatachanneltotal | Number | Energy generated overall |
| inverterdatachannelyear | Number | Energy generated in current year |
| inverterdatachannelfac | Number | AC frequency |
| inverterdatachanneliac | Number | AC current |
| inverterdatachannelidc | Number | DC current |
| inverterdatachanneluac | Number | AC voltage |
| inverterdatachanneludc | Number | DC voltage |
| inverterdatadevicestatuserrorcode | Number | Device error code |
| inverterdatadevicestatusstatuscode | Number | Device status code<br />`0` - `6` Startup<br />`7` Running <br />`8` Standby<br />`9` Bootloading<br />`10` Error |
| powerflowchannelpgrid | Number | Power + from grid, - to grid |
| powerflowchannelpload | Number | Power + generator, - consumer |
| powerflowchannelpakku | Number | Power + charge, - discharge |

## Full Example

demo.things:

```
Bridge fronius:bridge:mybridge [hostname="192.168.66.148",refreshInterval=5] {
Thing powerinverter myinverter [ deviceId=1 ]
Bridge fronius:bridge:mybridge [hostname="192.168.66.148", refreshInterval=5] {
Thing powerinverter myinverter [deviceId=1]
}
```

Expand All @@ -65,6 +72,8 @@ Number IAC { channel="fronius:powerinverter:mybridge:myinverter:inverterdatachan
Number IDC { channel="fronius:powerinverter:mybridge:myinverter:inverterdatachannelidc" }
Number UAC { channel="fronius:powerinverter:mybridge:myinverter:inverterdatachanneluac" }
Number UDC { channel="fronius:powerinverter:mybridge:myinverter:inverterdatachanneludc" }
Number ErrorCode { channel="fronius:powerinverter:mybridge:myinverter:inverterdatadevicestatuserrorcode" }
Number StatusCode { channel="fronius:powerinverter:mybridge:myinverter:inverterdatadevicestatusstatuscode" }
Number Grid_Power { channel="fronius:powerinverter:mybridge:myinverter:powerflowchannelpgrid" }
Number Load_Power { channel="fronius:powerinverter:mybridge:myinverter:powerflowchannelpload" }
Number Battery_Power { channel="fronius:powerinverter:mybridge:myinverter:powerflowchannelpakku" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* used across the whole binding.
*
* @author Thomas Rokohl - Initial contribution
* @author Peter Schraffl - Added device status and error status channels
*/
@NonNullByDefault
public class FroniusBindingConstants {
Expand All @@ -40,6 +41,8 @@ public class FroniusBindingConstants {
public static final String InverterDataChannelIdc = "inverterdatachannelidc";
public static final String InverterDataChannelUac = "inverterdatachanneluac";
public static final String InverterDataChannelUdc = "inverterdatachanneludc";
public static final String InverterDataChannelDeviceStatusErrorCode = "inverterdatadevicestatuserrorcode";
public static final String InverterDataChannelDeviceStatusStatusCode = "inverterdatadevicestatusstatuscode";
public static final String PowerFlowpGrid = "powerflowchannelpgrid";
public static final String PowerFlowpLoad = "powerflowchannelpload";
public static final String PowerFlowpAkku = "powerflowchannelpakku";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
* sent to one of the channels.
*
* @author Thomas Rokohl - Initial contribution
* @author Peter Schraffl - Added device status and error status channels
*/
public class FroniusSymoInverterHandler extends FroniusBaseThingHandler {

Expand Down Expand Up @@ -115,6 +116,10 @@ protected Object getValue(String channelId) {
return inverterRealtimeResponse.getBody().getData().getUac();
case FroniusBindingConstants.InverterDataChannelUdc:
return inverterRealtimeResponse.getBody().getData().getUdc();
case FroniusBindingConstants.InverterDataChannelDeviceStatusErrorCode:
return inverterRealtimeResponse.getBody().getData().getDeviceStatus().getErrorCode();
case FroniusBindingConstants.InverterDataChannelDeviceStatusStatusCode:
return inverterRealtimeResponse.getBody().getData().getDeviceStatus().getStatusCode();
}
if (powerFlowResponse == null) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
<channel id="inverterdatachannelidc" typeId="idc" />
<channel id="inverterdatachanneluac" typeId="uac" />
<channel id="inverterdatachanneludc" typeId="udc" />
<channel id="inverterdatadevicestatuserrorcode" typeId="devicestatus_errorcode" />
<channel id="inverterdatadevicestatusstatuscode" typeId="devicestatus_statuscode" />
<channel id="powerflowchannelpgrid" typeId="pGrid" />
<channel id="powerflowchannelpload" typeId="pLoad" />
<channel id="powerflowchannelpakku" typeId="pAkku" />
Expand Down Expand Up @@ -93,6 +95,19 @@
<state pattern="%.1f V" readOnly="true"></state>
</channel-type>

<channel-type id="devicestatus_errorcode">
<item-type>Number</item-type>
<label>Error Code</label>
<description>Current device error code</description>
<state pattern="%d" readOnly="true"></state>
</channel-type>
<channel-type id="devicestatus_statuscode">
<item-type>Number</item-type>
<label>Status Code</label>
<description>Current device status code</description>
<state pattern="%d" readOnly="true"></state>
</channel-type>

<channel-type id="pGrid">
<item-type>Number</item-type>
<label>Grid Power</label>
Expand Down

0 comments on commit 6b95a8b

Please sign in to comment.