diff --git a/bundles/org.openhab.binding.fronius/README.md b/bundles/org.openhab.binding.fronius/README.md index eb08a7dd435..a5628481100 100644 --- a/bundles/org.openhab.binding.fronius/README.md +++ b/bundles/org.openhab.binding.fronius/README.md @@ -63,17 +63,17 @@ The binding has no configuration options, all configuration is done at `bridge`, | ------------------------------------ | ------------------------ | ----------------------------------------------------------------------------------------------------------------- | | `inverterdatachannelpac` | Number:Power | AC Power generated | | `inverterdatachannelpdc` | Number:Power | DC Power calculated from DC voltage * DC current | -| `inverterdatachannelpdc2` | Number:Power | DC Power 2 calculated from DC voltage 2 * DC current 2 | -| `inverterdatachannelpdc3` | Number:Power | DC Power 3 calculated from DC voltage 3 * DC current 3 | +| `inverterdatachannelpdc2` | Number:Power | DC Power generated by MPPT tracker 2 | +| `inverterdatachannelpdc3` | Number:Power | DC Power generated by MPPT tracker 3 | | `inverterdatachannelfac` | Number:Frequency | AC frequency | | `inverterdatachanneliac` | Number:ElectricCurrent | AC current | | `inverterdatachannelidc` | Number:ElectricCurrent | DC current | -| `inverterdatachannelidc2` | Number:ElectricCurrent | DC current 2 | -| `inverterdatachannelidc3` | Number:ElectricCurrent | DC current 3 | +| `inverterdatachannelidc2` | Number:ElectricCurrent | DC current of MPPT tracker 2 | +| `inverterdatachannelidc3` | Number:ElectricCurrent | DC current of MPPT tracker 3 | | `inverterdatachanneluac` | Number:ElectricPotential | AC voltage | | `inverterdatachanneludc` | Number:ElectricPotential | DC voltage | -| `inverterdatachanneludc2` | Number:ElectricPotential | DC voltage 2 | -| `inverterdatachanneludc3` | Number:ElectricPotential | DC voltage 3 | +| `inverterdatachanneludc2` | Number:ElectricPotential | DC voltage of MPPT tracker 2 | +| `inverterdatachanneludc3` | Number:ElectricPotential | DC voltage of MPPT tracker 3 | | `inverterdatachanneldayenergy` | Number:Energy | Energy generated on current day | | `inverterdatachannelyear` | Number:Energy | Energy generated in current year | | `inverterdatachanneltotal` | Number:Energy | Energy generated overall | @@ -85,8 +85,10 @@ The binding has no configuration options, all configuration is done at `bridge`, | `powerflowchannelppv` | Number:Power | Solar Power (+ production) | | `powerflowautonomy` | Number:Dimensionless | The current relative autonomy in % | | `powerflowselfconsumption` | Number:Dimensionless | The current relative self consumption in % | -| `powerflowinverter1power` | Number:Power | Current power of inverter 1, null if not running (+ produce/export, - consume/import) | -| `powerflowinverter1soc` | Number:Dimensionless | Current state of charge of inverter 1 in percent | +| `powerflowinverterpower` | Number:Power | Current power of the inverter, null if not running (+ produce/export, - consume/import) | +| `powerflowinvertersoc` | Number:Dimensionless | Current state of charge of the battery connected to the inverter in percent. | +| `powerflowinverter1power` | Number:Power | Current power of inverter 1, null if not running (+ produce/export, - consume/import) - DEPRECATED | +| `powerflowinverter1soc` | Number:Dimensionless | Current state of charge of inverter 1 in percent - DEPRECATED | ### Channels for `meter` Thing diff --git a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/FroniusBindingConstants.java b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/FroniusBindingConstants.java index d307ba0e1ab..46c2380145b 100644 --- a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/FroniusBindingConstants.java +++ b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/FroniusBindingConstants.java @@ -64,6 +64,10 @@ public class FroniusBindingConstants { public static final String POWER_FLOW_AUTONOMY = "powerflowautonomy"; public static final String POWER_FLOW_SELF_CONSUMPTION = "powerflowselfconsumption"; + public static final String POWER_FLOW_INVERTER_POWER = "powerflowinverterpower"; + public static final String POWER_FLOW_INVERTER_SOC = "powerflowinvertersoc"; + + // For backwards compatibility public static final String POWER_FLOW_INVERTER_1_POWER = "powerflowinverter1power"; public static final String POWER_FLOW_INVERTER_1_SOC = "powerflowinverter1soc"; diff --git a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/handler/FroniusSymoInverterHandler.java b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/handler/FroniusSymoInverterHandler.java index 56cc8c25e90..1ffdddb502e 100644 --- a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/handler/FroniusSymoInverterHandler.java +++ b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/handler/FroniusSymoInverterHandler.java @@ -147,10 +147,16 @@ public class FroniusSymoInverterHandler extends FroniusBaseThingHandler { return new QuantityType<>(site.getRelAutonomy(), Units.PERCENT); case FroniusBindingConstants.POWER_FLOW_SELF_CONSUMPTION: return new QuantityType<>(site.getRelSelfConsumption(), Units.PERCENT); + case FroniusBindingConstants.POWER_FLOW_INVERTER_POWER: + return new QuantityType<>(getInverter(config.deviceId).getP(), Units.WATT); + case FroniusBindingConstants.POWER_FLOW_INVERTER_SOC: + return new QuantityType<>(getInverter(config.deviceId).getSoc(), Units.PERCENT); + + // Kept for backwards compatibility case FroniusBindingConstants.POWER_FLOW_INVERTER_1_POWER: - return new QuantityType<>(getInverter("1").getP(), Units.WATT); + return new QuantityType<>(getInverter(1).getP(), Units.WATT); case FroniusBindingConstants.POWER_FLOW_INVERTER_1_SOC: - return new QuantityType<>(getInverter("1").getSoc(), Units.PERCENT); + return new QuantityType<>(getInverter(1).getSoc(), Units.PERCENT); default: break; } @@ -165,8 +171,8 @@ public class FroniusSymoInverterHandler extends FroniusBaseThingHandler { * @param number The inverter object of the given index * @return a PowerFlowRealtimeInverter object. */ - private PowerFlowRealtimeInverter getInverter(final String number) { - return powerFlowResponse.getBody().getData().getInverters().get(number); + private PowerFlowRealtimeInverter getInverter(final int number) { + return powerFlowResponse.getBody().getData().getInverters().get(Integer.toString(number)); } /** diff --git a/bundles/org.openhab.binding.fronius/src/main/resources/OH-INF/i18n/fronius.properties b/bundles/org.openhab.binding.fronius/src/main/resources/OH-INF/i18n/fronius.properties index 30f6ae966c9..a35ced3a738 100644 --- a/bundles/org.openhab.binding.fronius/src/main/resources/OH-INF/i18n/fronius.properties +++ b/bundles/org.openhab.binding.fronius/src/main/resources/OH-INF/i18n/fronius.properties @@ -28,11 +28,6 @@ thing-type.fronius.ohmpilot.label = Fronius Ohmpilot thing-type.fronius.ohmpilot.description = Fronius Ohmpilot thing-type.fronius.powerinverter.label = Fronius Symo Inverter thing-type.fronius.powerinverter.description = Fronius Symo power inverter -thing-type.fronius.powerinverter.channel.powerflowchannelpakku.label = Charge / Discharge of Battery -thing-type.fronius.powerinverter.channel.powerflowchannelpgrid.label = Grid Power -thing-type.fronius.powerinverter.channel.powerflowchannelppv.label = Current Solar Yield -thing-type.fronius.powerinverter.channel.powerflowinverter1power.label = Power Flow (Inverter 1) -thing-type.fronius.powerinverter.channel.powerflowinverter1soc.label = State of Charge (Inverter 1) # thing types config @@ -56,23 +51,23 @@ channel-type.fronius.devicestatus_errorcode.description = Current device error c channel-type.fronius.devicestatus_statuscode.label = Status Code channel-type.fronius.devicestatus_statuscode.description = Current device status code channel-type.fronius.fac.label = AC Frequency -channel-type.fronius.fac.description = AC frequency channel-type.fronius.iac.label = AC Current -channel-type.fronius.iac.description = AC current channel-type.fronius.idc.label = DC Current -channel-type.fronius.idc.description = DC current channel-type.fronius.idc2.label = DC Current 2 -channel-type.fronius.idc2.description = DC current 2 +channel-type.fronius.idc2.description = DC current of MPPT tracker 2 channel-type.fronius.idc3.label = DC Current 3 -channel-type.fronius.idc3.description = DC current 3 -channel-type.fronius.inverter1Power.label = Inverter 1 Power -channel-type.fronius.inverter1Power.description = Inverter 1 Power -channel-type.fronius.inverter1Soc.label = Inverter 1 State of Charge -channel-type.fronius.inverter1Soc.description = Inverter 1 State of Charge +channel-type.fronius.idc3.description = DC current of MPPT tracker 3 +channel-type.fronius.inverter1Power.label = Inverter 1 Power (DEPRECATED) +channel-type.fronius.inverter1Power.description = Inverter 1 Power - DEPRECATED. Please use inverterPower channel instead. +channel-type.fronius.inverter1Soc.label = Inverter 1 State of Charge (DEPRECATED) +channel-type.fronius.inverter1Soc.description = Inverter 1 State of Charge - DEPRECATED. Please use inverterSoc channel instead +channel-type.fronius.inverterPower.label = Inverter Power +channel-type.fronius.inverterPower.description = Current power of the inverter, `NULL` if not running (+ produce/export, - consume/import) +channel-type.fronius.inverterSoc.label = Battery State of Charge +channel-type.fronius.inverterSoc.description = Current state of charge of the battery connected to the inverter in percent channel-type.fronius.meter_ac_current.label = AC Current channel-type.fronius.meter_ac_voltage.label = AC Voltage channel-type.fronius.meter_enable.label = Enabled -channel-type.fronius.meter_enable.description = Enabled channel-type.fronius.meter_energy.label = Energy channel-type.fronius.meter_location.label = Location channel-type.fronius.meter_location.description = Meter Location Code @@ -85,21 +80,21 @@ channel-type.fronius.ohmpilot_powerreal.description = Actual power consumption [ channel-type.fronius.ohmpilot_temperature.label = Temperature channel-type.fronius.ohmpilot_temperature.description = Temperature of the PT1000 channel-type.fronius.pAkku.label = Battery Power -channel-type.fronius.pAkku.description = Battery Power ( + discharge, - charge ) +channel-type.fronius.pAkku.description = Power from battery ( + discharge, - charge ) channel-type.fronius.pGrid.label = Grid Power channel-type.fronius.pGrid.description = Grid Power ( + from grid, - to grid ) channel-type.fronius.pLoad.label = Load Power -channel-type.fronius.pLoad.description = Load Power ( + generator, - consumer ) +channel-type.fronius.pLoad.description = Power from load ( + generator, - consumer ) channel-type.fronius.pPv.label = Solar Plant Power -channel-type.fronius.pPv.description = Current Solar Plant Power +channel-type.fronius.pPv.description = Power from solar plant channel-type.fronius.pac.label = AC Power -channel-type.fronius.pac.description = AC power +channel-type.fronius.pac.description = AC power generated by the inverter channel-type.fronius.pdc.label = DC Power -channel-type.fronius.pdc.description = DC power +channel-type.fronius.pdc.description = DC power generated by the inverter channel-type.fronius.pdc2.label = DC Power 2 -channel-type.fronius.pdc2.description = DC power 2 +channel-type.fronius.pdc2.description = DC power generated by MPPT tracker 2 channel-type.fronius.pdc3.label = DC Power 3 -channel-type.fronius.pdc3.description = DC power 3 +channel-type.fronius.pdc3.description = DC power generated by MPPT tracker 3 channel-type.fronius.powerflow_rel_autonomy.label = Autonomy channel-type.fronius.powerflow_rel_autonomy.description = The current relative autonomy in %, NULL if no smart meter is connected channel-type.fronius.powerflow_rel_selfconsumption.label = Self Consumption @@ -111,8 +106,8 @@ channel-type.fronius.uac.description = AC voltage channel-type.fronius.udc.label = DC Voltage channel-type.fronius.udc.description = DC voltage channel-type.fronius.udc2.label = DC Voltage 2 -channel-type.fronius.udc2.description = DC voltage 2 +channel-type.fronius.udc2.description = DC voltage of MPPT tracker 2 channel-type.fronius.udc3.label = DC Voltage 3 -channel-type.fronius.udc3.description = DC voltage 3 +channel-type.fronius.udc3.description = DC voltage of MPPT tracker 3 channel-type.fronius.year_energy.label = Year Energy channel-type.fronius.year_energy.description = Energy generated in current year diff --git a/bundles/org.openhab.binding.fronius/src/main/resources/OH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.fronius/src/main/resources/OH-INF/thing/thing-types.xml index 4d42e1dea8f..bae2bc13433 100644 --- a/bundles/org.openhab.binding.fronius/src/main/resources/OH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.fronius/src/main/resources/OH-INF/thing/thing-types.xml @@ -31,26 +31,22 @@ - - - + - - - - - - + + - - - - - - + + + + + + 1 + + @@ -161,25 +157,25 @@ Number:Power - AC power + AC power generated by the inverter Number:Power - DC power + DC power generated by the inverter Number:Power - DC power 2 + DC power generated by MPPT tracker 2 Number:Power - DC power 3 + DC power generated by MPPT tracker 3 @@ -198,33 +194,30 @@ Number:Frequency - AC frequency Number:ElectricCurrent - AC current Number:ElectricCurrent - DC current Number:ElectricCurrent - DC current 2 + DC current of MPPT tracker 2 Number:ElectricCurrent - DC current 3 + DC current of MPPT tracker 3 @@ -242,13 +235,13 @@ Number:ElectricPotential - DC voltage 2 + DC voltage of MPPT tracker 2 Number:ElectricPotential - DC voltage 3 + DC voltage of MPPT tracker 3 @@ -274,51 +267,62 @@ Number:Power - Load Power ( + generator, - consumer ) + Power from load ( + generator, - consumer ) Number:Power - Battery Power ( + discharge, - charge ) + Power from battery ( + discharge, - charge ) Number:Power - Current Solar Plant Power + Power from solar plant Number:Dimensionless The current relative autonomy in %, NULL if no smart meter is connected - + Number:Dimensionless The current relative self consumption in %, NULL if no smart meter is connected - + - + Number:Power - - Inverter 1 Power + + Current power of the inverter, `NULL` if not running (+ produce/export, - consume/import) - + Number:Dimensionless - - Inverter 1 State of Charge - + + Current state of charge of the battery connected to the inverter in percent + + + + Number:Power + + Inverter 1 Power - DEPRECATED. Please use inverterPower channel instead. + + + + Number:Dimensionless + + Inverter 1 State of Charge - DEPRECATED. Please use inverterSoc channel instead + Number - Enabled diff --git a/bundles/org.openhab.binding.fronius/src/main/resources/OH-INF/update/update.xml b/bundles/org.openhab.binding.fronius/src/main/resources/OH-INF/update/update.xml new file mode 100644 index 00000000000..1da3e7c12ad --- /dev/null +++ b/bundles/org.openhab.binding.fronius/src/main/resources/OH-INF/update/update.xml @@ -0,0 +1,27 @@ + + + + + + + fronius:inverterPower + + + fronius:inverterSoc + + + fronius:inverter1Power + + Inverter 1 Power - DEPRECATED. Please use inverterPower channel instead. + + + fronius:inverter1Soc + + Inverter 1 State of Charge - DEPRECATED. Please use inverterSoc channel instead + + + + +