diff --git a/bundles/org.openhab.binding.danfossairunit/README.md b/bundles/org.openhab.binding.danfossairunit/README.md index 9245f592aa2..94dd43b9920 100644 --- a/bundles/org.openhab.binding.danfossairunit/README.md +++ b/bundles/org.openhab.binding.danfossairunit/README.md @@ -38,12 +38,14 @@ These are the available configuration parameters: | humidity | humidity | Number:Dimensionless | RO | Current relative humidity measured by the air unit | | bypass | recuperator | Switch | RW | Disables the heat exchange. Useful in summer when room temperature is above target and outside temperature is below target. | | defrost | recuperator | Switch | RO | Defrost status. Active when low outdoor temperatures pose a risk of ice formation in the heat exchanger. | -| supply_temp | recuperator | Number | RO | Temperature of air which is passed to the rooms | -| extract_temp | recuperator | Number | RO | Temperature of the air as extracted from the rooms | -| exhaust_temp | recuperator | Number | RO | Temperature of the air when pushed outside | +| supply_temp | recuperator | Number:Temperature | RO | Temperature of air which is passed to the rooms | +| extract_temp | recuperator | Number:Temperature | RO | Temperature of the air as extracted from the rooms | +| exhaust_temp | recuperator | Number:Temperature | RO | Temperature of the air when pushed outside | | battery_life | service | Number | RO | Remaining Air Dial Battery Level (percentage) | | filter_life | service | Number | RO | Remaining life of filter until exchange is necessary (percentage) | | filter_period | service | Number | RW | Number of months between filter replacements (between 3 and 12). This value affects calculation of filter_life by the unit, and might get overwritten by Air Dial or Link CC Controller. | +| power_cycles | operation | Number | RO | The total count of power cycles, indicating how many times the unit has been turned off and on again. | +| operating_hours | operation | Number:Time | RO | The number of hours the unit has been in operation (in minutes). | ## Full Example diff --git a/bundles/org.openhab.binding.danfossairunit/src/main/java/org/openhab/binding/danfossairunit/internal/Channel.java b/bundles/org.openhab.binding.danfossairunit/src/main/java/org/openhab/binding/danfossairunit/internal/Channel.java index 80d51531c10..1ed14c860e2 100644 --- a/bundles/org.openhab.binding.danfossairunit/src/main/java/org/openhab/binding/danfossairunit/internal/Channel.java +++ b/bundles/org.openhab.binding.danfossairunit/src/main/java/org/openhab/binding/danfossairunit/internal/Channel.java @@ -25,7 +25,6 @@ import org.eclipse.jdt.annotation.Nullable; public enum Channel { // Main Channels - CHANNEL_CURRENT_TIME("current_time", ChannelGroup.MAIN, DanfossAirUnit::getCurrentTime), CHANNEL_MODE("mode", ChannelGroup.MAIN, DanfossAirUnit::getMode, DanfossAirUnit::setMode), CHANNEL_MANUAL_FAN_STEP("manual_fan_step", ChannelGroup.MAIN, DanfossAirUnit::getManualFanStep, @@ -34,7 +33,6 @@ public enum Channel { CHANNEL_SUPPLY_FAN_SPEED("supply_fan_speed", ChannelGroup.MAIN, DanfossAirUnit::getSupplyFanSpeed), CHANNEL_EXTRACT_FAN_STEP("extract_fan_step", ChannelGroup.MAIN, DanfossAirUnit::getExtractFanStep), CHANNEL_SUPPLY_FAN_STEP("supply_fan_step", ChannelGroup.MAIN, DanfossAirUnit::getSupplyFanStep), - CHANNEL_BOOST("boost", ChannelGroup.MAIN, DanfossAirUnit::getBoost, DanfossAirUnit::setBoost), CHANNEL_NIGHT_COOLING("night_cooling", ChannelGroup.MAIN, DanfossAirUnit::getNightCooling, DanfossAirUnit::setNightCooling), @@ -48,18 +46,22 @@ public enum Channel { // Humidity Channel CHANNEL_HUMIDITY("humidity", ChannelGroup.HUMIDITY, DanfossAirUnit::getHumidity), - // recuperator channels + // Recuperator channels CHANNEL_BYPASS("bypass", ChannelGroup.RECUPERATOR, DanfossAirUnit::getBypass, DanfossAirUnit::setBypass), CHANNEL_DEFROST("defrost", ChannelGroup.RECUPERATOR, DanfossAirUnit::getDefrostStatus), CHANNEL_SUPPLY_TEMP("supply_temp", ChannelGroup.RECUPERATOR, DanfossAirUnit::getSupplyTemperature), CHANNEL_EXTRACT_TEMP("extract_temp", ChannelGroup.RECUPERATOR, DanfossAirUnit::getExtractTemperature), CHANNEL_EXHAUST_TEMP("exhaust_temp", ChannelGroup.RECUPERATOR, DanfossAirUnit::getExhaustTemperature), - // service channels + // Service channels CHANNEL_BATTERY_LIFE("battery_life", ChannelGroup.SERVICE, DanfossAirUnit::getBatteryLife), CHANNEL_FILTER_LIFE("filter_life", ChannelGroup.SERVICE, DanfossAirUnit::getFilterLife), CHANNEL_FILTER_PERIOD("filter_period", ChannelGroup.SERVICE, DanfossAirUnit::getFilterPeriod, - DanfossAirUnit::setFilterPeriod); + DanfossAirUnit::setFilterPeriod), + + // Operation channels + CHANNEL_POWER_CYCLES("power_cycles", ChannelGroup.OPERATION, DanfossAirUnit::getPowerCycles), + CHANNEL_OPERATING_HOURS("operating_hours", ChannelGroup.OPERATION, DanfossAirUnit::getOperationTime); private final String channelName; private final ChannelGroup group; diff --git a/bundles/org.openhab.binding.danfossairunit/src/main/java/org/openhab/binding/danfossairunit/internal/ChannelGroup.java b/bundles/org.openhab.binding.danfossairunit/src/main/java/org/openhab/binding/danfossairunit/internal/ChannelGroup.java index fb83d0757bf..3e8b9b20a7e 100644 --- a/bundles/org.openhab.binding.danfossairunit/src/main/java/org/openhab/binding/danfossairunit/internal/ChannelGroup.java +++ b/bundles/org.openhab.binding.danfossairunit/src/main/java/org/openhab/binding/danfossairunit/internal/ChannelGroup.java @@ -25,7 +25,8 @@ public enum ChannelGroup { TEMPS("temps"), HUMIDITY("humidity"), RECUPERATOR("recuperator"), - SERVICE("service"); + SERVICE("service"), + OPERATION("operation"); private final String groupName; diff --git a/bundles/org.openhab.binding.danfossairunit/src/main/java/org/openhab/binding/danfossairunit/internal/DanfossAirUnit.java b/bundles/org.openhab.binding.danfossairunit/src/main/java/org/openhab/binding/danfossairunit/internal/DanfossAirUnit.java index ab2a6f2abb8..3f50add2eab 100644 --- a/bundles/org.openhab.binding.danfossairunit/src/main/java/org/openhab/binding/danfossairunit/internal/DanfossAirUnit.java +++ b/bundles/org.openhab.binding.danfossairunit/src/main/java/org/openhab/binding/danfossairunit/internal/DanfossAirUnit.java @@ -23,6 +23,7 @@ import java.time.ZonedDateTime; import javax.measure.quantity.Dimensionless; import javax.measure.quantity.Frequency; import javax.measure.quantity.Temperature; +import javax.measure.quantity.Time; import org.eclipse.jdt.annotation.NonNullByDefault; import org.openhab.binding.danfossairunit.internal.protocol.Parameter; @@ -257,6 +258,14 @@ public class DanfossAirUnit { return new DateTimeType(timestamp); } + public QuantityType