Skip to content

Commit

Permalink
[ipobserver] Add channel rainTotal (openhab#17727)
Browse files Browse the repository at this point in the history
* Add totalRain channel

Signed-off-by: Leo Siepel <leosiepel@gmail.com>
  • Loading branch information
lsiepel authored and matchews committed Dec 16, 2024
1 parent 1dca392 commit ece576a
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ private void setupServerChannels() {
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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
@@ -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>

0 comments on commit ece576a

Please sign in to comment.