Skip to content

Commit

Permalink
Changes requested by lolodomo.
Browse files Browse the repository at this point in the history
Signed-off-by: urmet0 <hannes.spenger@gmail.com>
  • Loading branch information
urmet0 committed Feb 8, 2022
1 parent be14252 commit bcd5387
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 69 deletions.
33 changes: 20 additions & 13 deletions bundles/org.openhab.binding.fronius/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,29 @@ The binding has no configuration options, all configuration is done at `bridge`,

| Channel ID | Item Type | Description |
| ----------------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `ohmpilotenergyrealsumconsumed` | Number:Energy | Real Energy consumed |
| `ohmpilotpowerrealsum` | Number:Power | Real Power |
| `ohmpilottemperaturechannel1` | Number:Temperature | Temperature |
| `ohmpiloterrorcode` | Number | Device error code |
| `ohmpilotstatecode` | Number | Device state code<br />`0` up and running <br />`1` keep minimum temperature <br />`2` legionella protection <br />`3` critical fault<br />`4` fault<br />`5` boost mode |
| `energyrealsumconsumed` | Number:Energy | Real Energy consumed |
| `powerrealsum` | Number:Power | Real Power |
| `temperaturechannel1` | Number:Temperature | Temperature |
| `errorcode` | Number | Device error code |
| `statecode` | Number | Device state code<br />`0` up and running <br />`1` keep minimum temperature <br />`2` legionella protection <br />`3` critical fault<br />`4` fault<br />`5` boost mode |
| |


## Properties

The `meter` thing has the following properties:
### The `meter` thing has the following properties:

| Property | Description |
| -------- | ------------------------------ |
| `modelId` | The model name of the meter |
| `serialNumber` | The serial number of the meter |

### The `ohmpilot` thing has the following property:

| Property | Description |
| -------- | ------------------------------ |
| `model` | The model name of the meter |
| `serial` | The serial number of the meter |
| `modelId` | The model name of the ohmpilot |
| `serialNumber` | The serial number of the ohmpilot |

## Full Example

Expand Down Expand Up @@ -163,10 +170,10 @@ Number Meter_PowerFactorPhase3 { channel="fronius:meter:mybridge:mymeter:powerfa
Number:Energy Meter_EnergyConsumed { channel="fronius:meter:mybridge:mymeter:energyrealsumconsumed" }
Number:Energy Meter_EnergyProduced { channel="fronius:meter:mybridge:mymeter:energyrealsumproduced" }
Number:Energy Ohmpilot_EnergyConsumed { channel="fronius:ohmpilot:mybridge:myohmpilot:ohmpilotenergyrealsumconsumed" }
Number:Power Ohmpilot_PowerSum { channel="fronius:ohmpilot:mybridge:myohmpilot:ohmpilotpowerrealsum" }
Number:Temperature Ohmpilot_Temperature { channel="fronius:ohmpilot:mybridge:myohmpilot:ohmpilottemperaturechannel1" }
Number Ohmpilot_State { channel="fronius:ohmpilot:mybridge:myohmpilot:ohmpilotstatecode" }
Number Ohmpilot_Errorcode { channel="fronius:ohmpilot:mybridge:myohmpilot:ohmpiloterrorcode" }
Number:Energy Ohmpilot_EnergyConsumed { channel="fronius:ohmpilot:mybridge:myohmpilot:energyrealsumconsumed" }
Number:Power Ohmpilot_PowerSum { channel="fronius:ohmpilot:mybridge:myohmpilot:powerrealsum" }
Number:Temperature Ohmpilot_Temperature { channel="fronius:ohmpilot:mybridge:myohmpilot:temperaturechannel1" }
Number Ohmpilot_State { channel="fronius:ohmpilot:mybridge:myohmpilot:statecode" }
Number Ohmpilot_Errorcode { channel="fronius:ohmpilot:mybridge:myohmpilot:errorcode" }
```
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ public class FroniusBindingConstants {
public static final String POWER_FLOW_P_LOAD = "powerflowchannelpload";
public static final String POWER_FLOW_P_AKKU = "powerflowchannelpakku";
public static final String POWER_FLOW_P_PV = "powerflowchannelppv";
public static final String METER_MODEL = "model";
public static final String METER_SERIAL = "serial";
public static final String METER_ENABLE = "enable";
public static final String METER_LOCATION = "location";
public static final String METER_CURRENT_AC_PHASE_1 = "currentacphase1";
Expand All @@ -70,13 +68,11 @@ public class FroniusBindingConstants {
public static final String METER_POWER_FACTOR_PHASE_3 = "powerfactorphase3";
public static final String METER_ENERGY_REAL_SUM_CONSUMED = "energyrealsumconsumed";
public static final String METER_ENERGY_REAL_SUM_PRODUCED = "energyrealsumproduced";
public static final String OHMPILOT_MODEL = "model";
public static final String OHMPILOT_SERIAL = "serial";
public static final String OHMPILOT_POWER_REAL_SUM = "ohmpilotpowerrealsum";
public static final String OHMPILOT_ENERGY_REAL_SUM_CONSUMED = "ohmpilotenergyrealsumconsumed";
public static final String OHMPILOT_ENERGY_SENSOR_TEMPERATURE_CHANNEL_1 = "ohmpilottemperaturechannel1";
public static final String OHMPILOT_ERROR_CODE = "ohmpiloterrorcode";
public static final String OHMPILOT_STATE_CODE = "ohmpilotstatecode";
public static final String OHMPILOT_POWER_REAL_SUM = "powerrealsum";
public static final String OHMPILOT_ENERGY_REAL_SUM_CONSUMED = "energyrealsumconsumed";
public static final String OHMPILOT_ENERGY_SENSOR_TEMPERATURE_CHANNEL_1 = "temperaturechannel1";
public static final String OHMPILOT_ERROR_CODE = "errorcode";
public static final String OHMPILOT_STATE_CODE = "statecode";

/*
* part of POWERFLOW_REALTIME_DATA using Symo Gen24
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ private void updateProperties() {

Map<String, String> properties = editProperties();

properties.put(FroniusBindingConstants.METER_MODEL, meterRealtimeBodyData.getDetails().getModel());
properties.put(FroniusBindingConstants.METER_SERIAL, meterRealtimeBodyData.getDetails().getSerial());
properties.put(Thing.PROPERTY_MODEL_ID, meterRealtimeBodyData.getDetails().getModel());
properties.put(Thing.PROPERTY_SERIAL_NUMBER, meterRealtimeBodyData.getDetails().getSerial());

updateProperties(properties);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.openhab.binding.fronius.internal.FroniusBridgeConfiguration;
import org.openhab.binding.fronius.internal.api.OhmpilotRealtimeBodyDataDTO;
import org.openhab.binding.fronius.internal.api.OhmpilotRealtimeResponseDTO;
import org.openhab.core.library.types.DecimalType;
import org.openhab.core.library.types.QuantityType;
import org.openhab.core.library.unit.Units;
import org.openhab.core.thing.Thing;
Expand Down Expand Up @@ -83,9 +84,9 @@ protected Object getValue(String channelId) {
case FroniusBindingConstants.OHMPILOT_ENERGY_SENSOR_TEMPERATURE_CHANNEL_1:
return new QuantityType<>(ohmpilotRealtimeBodyData.getTemperatureChannel1(), Units.KELVIN);
case FroniusBindingConstants.OHMPILOT_STATE_CODE:
return new QuantityType<>(ohmpilotRealtimeBodyData.getStateCode(), Units.ONE);
return new DecimalType(ohmpilotRealtimeBodyData.getStateCode());
case FroniusBindingConstants.OHMPILOT_ERROR_CODE:
return new QuantityType<>(ohmpilotRealtimeBodyData.getErrorCode(), Units.ONE);
return new DecimalType(ohmpilotRealtimeBodyData.getErrorCode());

default:
break;
Expand All @@ -101,8 +102,8 @@ private void updateProperties() {

Map<String, String> properties = editProperties();

properties.put(FroniusBindingConstants.OHMPILOT_MODEL, ohmpilotRealtimeBodyData.getDetails().getModel());
properties.put(FroniusBindingConstants.OHMPILOT_SERIAL, ohmpilotRealtimeBodyData.getDetails().getSerial());
properties.put(Thing.PROPERTY_MODEL_ID, ohmpilotRealtimeBodyData.getDetails().getModel());
properties.put(Thing.PROPERTY_SERIAL_NUMBER, ohmpilotRealtimeBodyData.getDetails().getSerial());

updateProperties(properties);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,6 @@
</channel>
</channels>

<properties>
<property name="model"/>
<property name="serial"/>
</properties>

<config-description>
<parameter name="deviceId" type="integer">
<label>Device ID</label>
Expand All @@ -132,28 +127,13 @@
<description>Fronius Ohmpilot</description>

<channels>
<channel id="ohmpilotpowerrealsum" typeId="ohmpilot_powerreal">
<label>Real Power Sum</label>
</channel>
<channel id="ohmpilotenergyrealsumconsumed" typeId="ohmpilot_energy">
<label>Real Energy Consumed</label>
</channel>
<channel id="ohmpilottemperaturechannel1" typeId="ohmpilot_temperature">
<label>Temperature</label>
</channel>
<channel id="ohmpilotstatecode" typeId="ohmpilot_state">
<label>State</label>
</channel>
<channel id="ohmpiloterrorcode" typeId="devicestatus_errorcode">
<label>Error Code</label>
</channel>
<channel id="powerrealsum" typeId="ohmpilot_powerreal"/>
<channel id="energyrealsumconsumed" typeId="ohmpilot_energy"/>
<channel id="temperaturechannel1" typeId="ohmpilot_temperature"/>
<channel id="statecode" typeId="devicestatus_statuscode"/>
<channel id="errorcode" typeId="devicestatus_errorcode"/>
</channels>

<properties>
<property name="model"/>
<property name="serial"/>
</properties>

<config-description>
<parameter name="deviceId" type="integer">
<label>Device ID</label>
Expand Down Expand Up @@ -287,58 +267,47 @@
<channel-type id="meter_ac_current">
<item-type>Number:ElectricCurrent</item-type>
<label>AC Current</label>
<description></description>
<state pattern="%.2f %unit%" readOnly="true"></state>
</channel-type>
<channel-type id="meter_ac_voltage">
<item-type>Number:ElectricPotential</item-type>
<label>AC Voltage</label>
<description></description>
<state pattern="%.2f %unit%" readOnly="true"></state>
</channel-type>
<channel-type id="meter_powerreal">
<item-type>Number:Power</item-type>
<label>Power</label>
<description></description>
<state pattern="%.2f %unit%" readOnly="true"></state>
</channel-type>
<channel-type id="meter_powerfactor">
<item-type>Number</item-type>
<label>Power Factor</label>
<description></description>
<state pattern="%.2f" readOnly="true"></state>
</channel-type>
<channel-type id="meter_energy">
<item-type>Number:Energy</item-type>
<label>Energy</label>
<description></description>
<state pattern="%.2f %unit%" readOnly="true"></state>
</channel-type>

<channel-type id="ohmpilot_powerreal">
<item-type>Number:Power</item-type>
<label>Power</label>
<description></description>
<label>Real Power Sum</label>
<description>Actual power consumption [W]</description>
<state pattern="%.2f %unit%" readOnly="true"></state>
</channel-type>
<channel-type id="ohmpilot_energy">
<item-type>Number:Energy</item-type>
<label>Energy</label>
<description></description>
<label>Real Energy Consumed</label>
<description>Total consumed energy [Wh]</description>
<state pattern="%.2f %unit%" readOnly="true"></state>
</channel-type>
<channel-type id="ohmpilot_temperature">
<item-type>Number:Temperature</item-type>
<label>Temperature</label>
<description></description>
<description>Temperature of the PT1000</description>
<state pattern="%.2f %unit%" readOnly="true"></state>
</channel-type>
<channel-type id="ohmpilot_state">
<item-type>Number</item-type>
<label>State</label>
<description></description>
<state pattern="%d" readOnly="true"></state>
</channel-type>



Expand Down

0 comments on commit bcd5387

Please sign in to comment.