From d03a4ea419efd37c9c82b920be0b03704f1e9838 Mon Sep 17 00:00:00 2001 From: lsiepel Date: Sat, 16 Nov 2024 14:35:49 +0100 Subject: [PATCH] [ipobserver] Add channel rainTotal (#17727) * Add totalRain channel Signed-off-by: Leo Siepel Signed-off-by: Ciprian Pascu --- .../internal/IpObserverBindingConstants.java | 1 + .../ipobserver/internal/IpObserverHandler.java | 1 + .../resources/OH-INF/i18n/ipobserver.properties | 1 + .../main/resources/OH-INF/thing/thing-types.xml | 11 +++++++++++ .../main/resources/OH-INF/update/instructions.xml | 14 ++++++++++++++ 5 files changed, 28 insertions(+) create mode 100644 bundles/org.openhab.binding.ipobserver/src/main/resources/OH-INF/update/instructions.xml diff --git a/bundles/org.openhab.binding.ipobserver/src/main/java/org/openhab/binding/ipobserver/internal/IpObserverBindingConstants.java b/bundles/org.openhab.binding.ipobserver/src/main/java/org/openhab/binding/ipobserver/internal/IpObserverBindingConstants.java index 4203c6203f6..b0327a3f269 100644 --- a/bundles/org.openhab.binding.ipobserver/src/main/java/org/openhab/binding/ipobserver/internal/IpObserverBindingConstants.java +++ b/bundles/org.openhab.binding.ipobserver/src/main/java/org/openhab/binding/ipobserver/internal/IpObserverBindingConstants.java @@ -55,6 +55,7 @@ public class IpObserverBindingConstants { public static final String WEEKLY_RAIN = "rainForWeek"; public static final String MONTHLY_RAIN = "rainForMonth"; public static final String YEARLY_RAIN = "rainForYear"; + public static final String TOTAL_RAIN = "rainTotal"; public static final String INDOOR_BATTERY = "batteryIndoor"; public static final String OUTDOOR_BATTERY = "batteryOutdoor"; public static final String RESPONSE_TIME = "responseTime"; diff --git a/bundles/org.openhab.binding.ipobserver/src/main/java/org/openhab/binding/ipobserver/internal/IpObserverHandler.java b/bundles/org.openhab.binding.ipobserver/src/main/java/org/openhab/binding/ipobserver/internal/IpObserverHandler.java index e87a9fcfc1c..722f7a83c14 100644 --- a/bundles/org.openhab.binding.ipobserver/src/main/java/org/openhab/binding/ipobserver/internal/IpObserverHandler.java +++ b/bundles/org.openhab.binding.ipobserver/src/main/java/org/openhab/binding/ipobserver/internal/IpObserverHandler.java @@ -298,6 +298,7 @@ public class IpObserverHandler extends BaseThingHandler { createChannelHandler(WEEKLY_RAIN, QuantityType.class, ImperialUnits.INCH, "weeklyrainin"); createChannelHandler(MONTHLY_RAIN, QuantityType.class, ImperialUnits.INCH, "monthlyrainin"); createChannelHandler(YEARLY_RAIN, QuantityType.class, ImperialUnits.INCH, "yearlyrainin"); + createChannelHandler(TOTAL_RAIN, QuantityType.class, ImperialUnits.INCH, "totalrainin"); createChannelHandler(UV_INDEX, DecimalType.class, SIUnits.CELSIUS, "UV"); createChannelHandler(WIND_AVERAGE_SPEED, QuantityType.class, ImperialUnits.MILES_PER_HOUR, "windspeedmph"); createChannelHandler(WIND_GUST, QuantityType.class, ImperialUnits.MILES_PER_HOUR, "windgustmph"); diff --git a/bundles/org.openhab.binding.ipobserver/src/main/resources/OH-INF/i18n/ipobserver.properties b/bundles/org.openhab.binding.ipobserver/src/main/resources/OH-INF/i18n/ipobserver.properties index 50099f3dd12..0285ee4b57f 100644 --- a/bundles/org.openhab.binding.ipobserver/src/main/resources/OH-INF/i18n/ipobserver.properties +++ b/bundles/org.openhab.binding.ipobserver/src/main/resources/OH-INF/i18n/ipobserver.properties @@ -41,6 +41,7 @@ channel-type.ipobserver.rainHourlyRate.label = Rain Hourly Rate channel-type.ipobserver.rainHourlyRate.description = How much rain will fall in an Hour if the rate continues channel-type.ipobserver.rainToday.label = Rain Today channel-type.ipobserver.rainToday.description = Rain since Midnight +channel-type.ipobserver.rainTotal.label = Total Rain channel-type.ipobserver.responseTime.label = Response Time channel-type.ipobserver.responseTime.description = How many milliseconds it took to fetch the sensor readings from livedata.htm channel-type.ipobserver.solarRadiation.label = Solar Radiation diff --git a/bundles/org.openhab.binding.ipobserver/src/main/resources/OH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.ipobserver/src/main/resources/OH-INF/thing/thing-types.xml index 0de44b33cab..40445dc34a1 100644 --- a/bundles/org.openhab.binding.ipobserver/src/main/resources/OH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.ipobserver/src/main/resources/OH-INF/thing/thing-types.xml @@ -29,12 +29,17 @@ + + + 1 + + network-address @@ -233,6 +238,12 @@ Rain + + Number:Length + + Rain + + DateTime diff --git a/bundles/org.openhab.binding.ipobserver/src/main/resources/OH-INF/update/instructions.xml b/bundles/org.openhab.binding.ipobserver/src/main/resources/OH-INF/update/instructions.xml new file mode 100644 index 00000000000..b57ca79774a --- /dev/null +++ b/bundles/org.openhab.binding.ipobserver/src/main/resources/OH-INF/update/instructions.xml @@ -0,0 +1,14 @@ + + + + + + + ipobserver:rainTotal + + + + +