[ipobserver] Add channel rainTotal (#17727)

* Add totalRain channel

Signed-off-by: Leo Siepel <leosiepel@gmail.com>
This commit is contained in:
lsiepel 2024-11-16 14:35:49 +01:00 committed by GitHub
parent 9d1c0a6dfa
commit 22aeffbc44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 28 additions and 0 deletions

View File

@ -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";

View File

@ -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");

View File

@ -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

View File

@ -29,12 +29,17 @@
<channel id="rainForWeek" typeId="rainForWeek"/>
<channel id="rainForMonth" typeId="rainForMonth"/>
<channel id="rainForYear" typeId="rainForYear"/>
<channel id="rainTotal" typeId="rainTotal"/>
<channel id="batteryOutdoor" typeId="system.low-battery"/>
<channel id="batteryIndoor" typeId="system.low-battery"/>
<channel id="responseTime" typeId="responseTime"/>
<channel id="lastUpdatedTime" typeId="lastUpdatedTime"/>
</channels>
<properties>
<property name="thingTypeVersion">1</property>
</properties>
<config-description>
<parameter name="address" type="text" required="true">
<context>network-address</context>
@ -233,6 +238,12 @@
<category>Rain</category>
<state pattern="%.2f %unit%" readOnly="true"/>
</channel-type>
<channel-type id="rainTotal">
<item-type>Number:Length</item-type>
<label>Total Rain</label>
<category>Rain</category>
<state pattern="%.2f %unit%" readOnly="true"/>
</channel-type>
<channel-type id="lastUpdatedTime" advanced="true">
<item-type>DateTime</item-type>
<label>Last Updated Time</label>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<update:update-descriptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:update="https://openhab.org/schemas/update-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/update-description/v1.0.0 https://openhab.org/schemas/update-description-1.0.0.xsd">
<thing-type uid="ipobserver:weatherstation">
<instruction-set targetVersion="1">
<add-channel id="rainTotal">
<type>ipobserver:rainTotal</type>
</add-channel>
</instruction-set>
</thing-type>
</update:update-descriptions>