adapt to 4.1.x

This commit is contained in:
Thomas Vogl 2024-01-04 12:46:16 +01:00
parent 13b4080e4a
commit 7c14d57483
9 changed files with 285 additions and 124 deletions

View File

@ -431,16 +431,12 @@
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<<<<<<< HEAD
<artifactId>org.openhab.binding.ecovacs</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.ecowatt</artifactId>
=======
<artifactId>org.openhab.binding.ecowitt</artifactId>
>>>>>>> 833ca96673 (initial commit for ecowitt binding)
<version>${project.version}</version>
</dependency>
<dependency>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>3.2.0</version>
<version>4.1.1-SNAPSHOT</version>
</parent>
<artifactId>org.openhab.binding.ecowitt</artifactId>

View File

@ -12,15 +12,13 @@
*/
package interfaces;
import org.eclipse.jdt.annotation.NonNull;
import org.openhab.core.thing.Channel;
import org.openhab.core.thing.binding.ThingHandler;
/**
* @author Av3m - Initial contribution
*/
public interface ChannelUpdater {
void updateChannel(Channel ch, String strValue);
void setStateUpdater(StateUpdater stateUpdater);
}

View File

@ -21,5 +21,6 @@ import org.openhab.core.types.State;
*/
public interface StateUpdater {
Channel getChannel(String channelName);
void updateState(ChannelUID uid, State state);
}

View File

@ -12,8 +12,11 @@
*/
package org.openhab.binding.ecowitt.internal.handlers;
import interfaces.StateUpdater;
import javax.servlet.Servlet;
import javax.servlet.ServletException;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.servlet.ServletHandler;
import org.eclipse.jetty.servlet.ServletHolder;
@ -28,16 +31,13 @@ import org.openhab.core.types.Command;
import org.openhab.core.types.State;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.eclipse.jetty.server.Server;
import javax.servlet.Servlet;
import javax.servlet.ServletException;
import interfaces.StateUpdater;
/**
* @author Av3m - Initial contribution
*/
public class EcowittThingHandler<T extends AbstractEcowittServlet> extends BaseThingHandler implements StateUpdater {
private final Logger logger = LoggerFactory.getLogger(EcowittThingHandler.class);
@ -52,18 +52,16 @@ public class EcowittThingHandler<T extends AbstractEcowittServlet> extends BaseT
@Override
public void handleCommand(ChannelUID channelUID, Command command) {
//no command supported - do nothing!
// no command supported - do nothing!
}
@Override
public void initialize() {
config = getConfigAs(ecowittConfiguration.class);
updateStatus(ThingStatus.UNKNOWN);
if (config == null ) {
if (config == null) {
logger.error("no config object!");
updateStatus(ThingStatus.OFFLINE);
return;
@ -84,16 +82,13 @@ public class EcowittThingHandler<T extends AbstractEcowittServlet> extends BaseT
String thingTypeName = thing.getThingTypeUID().getId();
logger.info("url base: {}", thingTypeName);
ServletHolder holder = servletHandler.addServletWithMapping(
this.classServlet, "/" + thingTypeName);
ServletHolder holder = servletHandler.addServletWithMapping(this.classServlet, "/" + thingTypeName);
try {
server.start();
try {
Servlet servlet = holder.getServlet();
if ( servlet != null) {
if (servlet != null) {
((AbstractEcowittServlet) servlet).setStateUpdater(this);
} else {
logger.error("could not get servlet");
@ -109,12 +104,11 @@ public class EcowittThingHandler<T extends AbstractEcowittServlet> extends BaseT
logger.error("{}", e.getMessage());
}
});
}
@Override
public void dispose() {
if ( server != null && !server.isStopped() ) {
if (server != null && !server.isStopped()) {
try {
server.stop();
} catch (Exception e) {
@ -132,6 +126,5 @@ public class EcowittThingHandler<T extends AbstractEcowittServlet> extends BaseT
@Override
public void updateState(ChannelUID uid, State state) {
super.updateState(uid, state);
}
}

View File

@ -12,7 +12,12 @@
*/
package org.openhab.binding.ecowitt.internal.servlets;
import interfaces.StateUpdater;
import java.util.Map;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.jetty.http.HttpStatus;
@ -20,12 +25,7 @@ import org.openhab.core.thing.Channel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
import interfaces.StateUpdater;
/**
* @author Av3m - Initial contribution
@ -41,11 +41,9 @@ public abstract class AbstractEcowittServlet extends HttpServlet {
protected StateUpdater stateUpdater = null;
private final Logger logger = LoggerFactory.getLogger(AbstractEcowittServlet.class);
protected void doPost(HttpServletRequest request, HttpServletResponse response)
{
protected void doPost(HttpServletRequest request, HttpServletResponse response) {
for (Map.Entry<String, String[]> stringEntry : request.getParameterMap().entrySet()) {
if ( stringEntry.getValue().length > 0 && !stringEntry.getValue()[0].equals("")) {
if (stringEntry.getValue().length > 0 && !stringEntry.getValue()[0].equals("")) {
updateValue(stringEntry.getKey(), stringEntry.getValue()[0]);
}
@ -54,19 +52,23 @@ public abstract class AbstractEcowittServlet extends HttpServlet {
}
private void updateValue(String field, String value) {
if ( stateUpdater == null ) { return; }
if (stateUpdater == null) {
return;
}
@Nullable Channel ch = stateUpdater.getChannel(field);
@Nullable
Channel ch = stateUpdater.getChannel(field);
if (ch == null ) {
if (ch == null) {
logger.debug("channel for field {} (current value: {}) not implemented", field, value);
return;
}
updateChannel(ch, value);
}
protected abstract void updateChannel(Channel ch, String strValue);
public abstract String getName();
public void setStateUpdater(StateUpdater stateUpdater) {

View File

@ -12,6 +12,10 @@
*/
package org.openhab.binding.ecowitt.internal.servlets;
import java.time.Instant;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.openhab.core.library.types.DateTimeType;
@ -24,12 +28,6 @@ import org.openhab.core.library.unit.Units;
import org.openhab.core.thing.Channel;
import org.openhab.core.thing.type.ChannelTypeUID;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.time.Instant;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
/**
* @author Av3m - Initial contribution
*/
@ -45,19 +43,23 @@ public class EcowittGW1000Servlet extends AbstractEcowittServlet {
return EcowittGW1000Servlet.class.getName();
}
@Override
protected void updateChannel(Channel ch, String strValue) {
if (stateUpdater == null) {return; }
if (stateUpdater == null) {
return;
}
String id = ch.getUID().getId();
@Nullable ChannelTypeUID channelUID = ch.getChannelTypeUID();
if ( channelUID == null ) {return; }
@Nullable
ChannelTypeUID channelUID = ch.getChannelTypeUID();
if (channelUID == null) {
return;
}
String type = channelUID.getId();
float value;
switch(type) {
switch (type) {
case "humidity":
case "atmospheric-humidity":
@ -118,11 +120,11 @@ public class EcowittGW1000Servlet extends AbstractEcowittServlet {
case "battery-level":
value = Float.parseFloat(strValue);
int batLevel = 0;
switch(id) {
switch (id) {
case "pm25batt1":
case "pm25batt2":
case "wh57batt":
batLevel = (int) (100/5 * value);
batLevel = (int) (100 / 5 * value);
break;
case "wh40batt":
case "soilbatt1":
@ -131,16 +133,23 @@ public class EcowittGW1000Servlet extends AbstractEcowittServlet {
case "soilbatt4":
float minLevel = 1.1f;
float maxLevel = 1.5f;
if (value >= maxLevel) {batLevel = 100;}
else if (value < minLevel) {batLevel = 0;}
else { batLevel = (int) (100 * (value - minLevel) / (maxLevel - minLevel)); }
if (value >= maxLevel) {
batLevel = 100;
} else if (value < minLevel) {
batLevel = 0;
} else {
batLevel = (int) (100 * (value - minLevel) / (maxLevel - minLevel));
}
break;
case "wh65batt":
case "battout":
case "wh26batt":
case "wh25batt":
if ( value == 0) { batLevel = 100;}
else { batLevel = 0;}
if (value == 0) {
batLevel = 100;
} else {
batLevel = 0;
}
break;
}
stateUpdater.updateState(ch.getUID(), new QuantityType<>(batLevel, Units.PERCENT));
@ -148,7 +157,4 @@ public class EcowittGW1000Servlet extends AbstractEcowittServlet {
}
}
}

View File

@ -9,73 +9,238 @@
<label>Ecowitt GW1000 Thing</label>
<description>Thing for GW1000 Weather Station</description>
<channels>
<channel id="tempf" typeId="system.outdoor-temperature"><label>outdoor temperature</label><description>outdoor temperature</description></channel>
<channel id="tempinf" typeId="system.outdoor-temperature"><label>indoor temperature</label><description>indoor temperature</description></channel>
<channel id="temp1f" typeId="system.outdoor-temperature"><label>temperature CH1</label><description>temperature CH1</description></channel>
<channel id="temp2f" typeId="system.outdoor-temperature"><label>temperature CH2</label><description>temperature CH2</description></channel>
<channel id="temp3f" typeId="system.outdoor-temperature"><label>temperature CH3</label><description>temperature CH3</description></channel>
<channel id="temp4f" typeId="system.outdoor-temperature"><label>temperature CH4</label><description>temperature CH4</description></channel>
<channel id="temp5f" typeId="system.outdoor-temperature"><label>temperature CH5</label><description>temperature CH5</description></channel>
<channel id="temp6f" typeId="system.outdoor-temperature"><label>temperature CH6</label><description>temperature CH6</description></channel>
<channel id="temp7f" typeId="system.outdoor-temperature"><label>temperature CH7</label><description>temperature CH7</description></channel>
<channel id="temp8f" typeId="system.outdoor-temperature"><label>temperature CH8</label><description>temperature CH8</description></channel>
<channel id="tempf" typeId="system.outdoor-temperature">
<label>outdoor temperature</label>
<description>outdoor temperature</description>
</channel>
<channel id="tempinf" typeId="system.outdoor-temperature">
<label>indoor temperature</label>
<description>indoor temperature</description>
</channel>
<channel id="temp1f" typeId="system.outdoor-temperature">
<label>temperature CH1</label>
<description>temperature CH1</description>
</channel>
<channel id="temp2f" typeId="system.outdoor-temperature">
<label>temperature CH2</label>
<description>temperature CH2</description>
</channel>
<channel id="temp3f" typeId="system.outdoor-temperature">
<label>temperature CH3</label>
<description>temperature CH3</description>
</channel>
<channel id="temp4f" typeId="system.outdoor-temperature">
<label>temperature CH4</label>
<description>temperature CH4</description>
</channel>
<channel id="temp5f" typeId="system.outdoor-temperature">
<label>temperature CH5</label>
<description>temperature CH5</description>
</channel>
<channel id="temp6f" typeId="system.outdoor-temperature">
<label>temperature CH6</label>
<description>temperature CH6</description>
</channel>
<channel id="temp7f" typeId="system.outdoor-temperature">
<label>temperature CH7</label>
<description>temperature CH7</description>
</channel>
<channel id="temp8f" typeId="system.outdoor-temperature">
<label>temperature CH8</label>
<description>temperature CH8</description>
</channel>
<channel id="humidity" typeId="system.atmospheric-humidity"><label>outdoor humidity</label><description>outdoor humidity</description></channel>
<channel id="humidityin" typeId="humidity"><label>indoor humidity</label><description>indoor humidity</description></channel>
<channel id="humidity1" typeId="humidity"><label>humidity CH1</label><description>humidity CH1</description></channel>
<channel id="humidity2" typeId="humidity"><label>humidity CH2</label><description>humidity CH2</description></channel>
<channel id="humidity3" typeId="humidity"><label>humidity CH3</label><description>humidity CH3</description></channel>
<channel id="humidity4" typeId="humidity"><label>humidity CH4</label><description>humidity CH4</description></channel>
<channel id="humidity5" typeId="humidity"><label>humidity CH5</label><description>humidity CH5</description></channel>
<channel id="humidity6" typeId="humidity"><label>humidity CH6</label><description>humidity CH6</description></channel>
<channel id="humidity7" typeId="humidity"><label>humidity CH7</label><description>humidity CH7</description></channel>
<channel id="humidity8" typeId="humidity"><label>humidity CH8</label><description>humidity CH8</description></channel>
<channel id="humidity" typeId="system.atmospheric-humidity">
<label>outdoor humidity</label>
<description>outdoor humidity</description>
</channel>
<channel id="humidityin" typeId="humidity">
<label>indoor humidity</label>
<description>indoor humidity</description>
</channel>
<channel id="humidity1" typeId="humidity">
<label>humidity CH1</label>
<description>humidity CH1</description>
</channel>
<channel id="humidity2" typeId="humidity">
<label>humidity CH2</label>
<description>humidity CH2</description>
</channel>
<channel id="humidity3" typeId="humidity">
<label>humidity CH3</label>
<description>humidity CH3</description>
</channel>
<channel id="humidity4" typeId="humidity">
<label>humidity CH4</label>
<description>humidity CH4</description>
</channel>
<channel id="humidity5" typeId="humidity">
<label>humidity CH5</label>
<description>humidity CH5</description>
</channel>
<channel id="humidity6" typeId="humidity">
<label>humidity CH6</label>
<description>humidity CH6</description>
</channel>
<channel id="humidity7" typeId="humidity">
<label>humidity CH7</label>
<description>humidity CH7</description>
</channel>
<channel id="humidity8" typeId="humidity">
<label>humidity CH8</label>
<description>humidity CH8</description>
</channel>
<channel id="winddir" typeId="system.wind-direction"><label>wind direction</label><description>wind direction</description></channel>
<channel id="windspeedmph" typeId="system.wind-speed"><label>wind speed</label><description>wind speed</description></channel>
<channel id="windgustmph" typeId="system.wind-speed"><label>wind gust</label><description>wind gust</description></channel>
<channel id="maxdailygust" typeId="system.wind-speed"><label>daily maximum value gust</label><description>daily maximum value gust</description></channel>
<channel id="winddir" typeId="system.wind-direction">
<label>wind direction</label>
<description>wind direction</description>
</channel>
<channel id="windspeedmph" typeId="system.wind-speed">
<label>wind speed</label>
<description>wind speed</description>
</channel>
<channel id="windgustmph" typeId="system.wind-speed">
<label>wind gust</label>
<description>wind gust</description>
</channel>
<channel id="maxdailygust" typeId="system.wind-speed">
<label>daily maximum value gust</label>
<description>daily maximum value gust</description>
</channel>
<channel id="totalrainin" typeId="rain-amount"><label>total amount of rain</label><description>total amount of rain</description></channel>
<channel id="eventrainin" typeId="rain-amount"><label>amount of rain (event-based)</label><description>amount of rain (event-based)</description></channel>
<channel id="yearlyrainin" typeId="rain-amount"><label>yearly amount of rain</label><description>yearly amount of rain</description></channel>
<channel id="monthlyrainin" typeId="rain-amount"><label>monthly amount of rain</label><description>monthly amount of rain</description></channel>
<channel id="weeklyrainin" typeId="rain-amount"><label>weekly amount of rain</label><description>weekly amount of rain</description></channel>
<channel id="dailyrainin" typeId="rain-amount"><label>daily amount of rain</label><description>daily amount of rain</description></channel>
<channel id="hourlyrainin" typeId="rain-amount"><label>hourly amount of rain</label><description>hourly amount of rain</description></channel>
<channel id="rainratein" typeId="rain-rate"><label>rain amount per hour</label><description>rain amount per hour</description></channel>
<channel id="totalrainin" typeId="rain-amount">
<label>total amount of rain</label>
<description>total amount of rain</description>
</channel>
<channel id="eventrainin" typeId="rain-amount">
<label>amount of rain (event-based)</label>
<description>amount of rain (event-based)</description>
</channel>
<channel id="yearlyrainin" typeId="rain-amount">
<label>yearly amount of rain</label>
<description>yearly amount of rain</description>
</channel>
<channel id="monthlyrainin" typeId="rain-amount">
<label>monthly amount of rain</label>
<description>monthly amount of rain</description>
</channel>
<channel id="weeklyrainin" typeId="rain-amount">
<label>weekly amount of rain</label>
<description>weekly amount of rain</description>
</channel>
<channel id="dailyrainin" typeId="rain-amount">
<label>daily amount of rain</label>
<description>daily amount of rain</description>
</channel>
<channel id="hourlyrainin" typeId="rain-amount">
<label>hourly amount of rain</label>
<description>hourly amount of rain</description>
</channel>
<channel id="rainratein" typeId="rain-rate">
<label>rain amount per hour</label>
<description>rain amount per hour</description>
</channel>
<channel id="solarradiation" typeId="solar-radiation"><label>solar radiation (intensity)</label><description>solar radiation (intensity)</description></channel>
<channel id="uv" typeId="uv-index"><label>uv index</label><description>uv index</description></channel>
<channel id="solarradiation" typeId="solar-radiation">
<label>solar radiation (intensity)</label>
<description>solar radiation (intensity)</description>
</channel>
<channel id="uv" typeId="uv-index">
<label>uv index</label>
<description>uv index</description>
</channel>
<channel id="baromabsin" typeId="system.barometric-pressure"><label>absolute barometric pressure</label><description>absolute barometric pressure</description></channel>
<channel id="baromrelin" typeId="system.barometric-pressure"><label>relative barometric pressure</label><description>relative barometric pressure</description></channel>
<channel id="baromabsin" typeId="system.barometric-pressure">
<label>absolute barometric pressure</label>
<description>absolute barometric pressure</description>
</channel>
<channel id="baromrelin" typeId="system.barometric-pressure">
<label>relative barometric pressure</label>
<description>relative barometric pressure</description>
</channel>
<channel id="soilmoisture1" typeId="moisture"><label>soil moisture CH1</label><description>soil moisture CH1</description></channel>
<channel id="soilmoisture2" typeId="moisture"><label>soil moisture CH2</label><description>soil moisture CH2</description></channel>
<channel id="soilmoisture3" typeId="moisture"><label>soil moisture CH3</label><description>soil moisture CH3</description></channel>
<channel id="soilmoisture4" typeId="moisture"><label>soil moisture CH4</label><description>soil moisture CH4</description></channel>
<channel id="soilmoisture1" typeId="moisture">
<label>soil moisture CH1</label>
<description>soil moisture CH1</description>
</channel>
<channel id="soilmoisture2" typeId="moisture">
<label>soil moisture CH2</label>
<description>soil moisture CH2</description>
</channel>
<channel id="soilmoisture3" typeId="moisture">
<label>soil moisture CH3</label>
<description>soil moisture CH3</description>
</channel>
<channel id="soilmoisture4" typeId="moisture">
<label>soil moisture CH4</label>
<description>soil moisture CH4</description>
</channel>
<channel id="lightning" typeId="lightning-distance"><label>distance of last lightning</label><description>distance of last lightning</description></channel>
<channel id="lightning_time" typeId="lightning-timestamp"><label>timestamp of last lightning</label><description>timestamp of last lightning</description></channel>
<channel id="lightning_num" typeId="lightning-num"><label>number of lightnings per day</label><description>number of lightnings</description></channel>
<channel id="lightning" typeId="lightning-distance">
<label>distance of last lightning</label>
<description>distance of last lightning</description>
</channel>
<channel id="lightning_time" typeId="lightning-timestamp">
<label>timestamp of last lightning</label>
<description>timestamp of last lightning</description>
</channel>
<channel id="lightning_num" typeId="lightning-num">
<label>number of lightnings per day</label>
<description>number of lightnings</description>
</channel>
<channel id="pm25_ch1" typeId="pm25-particles"><label>PM2.5 particle sensor CH1</label><description>PM2.5 particle sensor CH1</description></channel>
<channel id="pm25_avg_24h_ch1" typeId="pm25-particles"><label>daily average PM2.5 particle sensor CH1</label><description>daily average PM2.5 particle sensor CH1</description></channel>
<channel id="pm25_ch2" typeId="pm25-particles"><label>PM2.5 particle sensor CH2</label><description>PM2.5 particle sensor CH2</description></channel>
<channel id="pm25_avg_24h_ch2" typeId="pm25-particles"><label>daily average PM2.5 particle sensor CH2</label><description>daily average PM2.5 particle sensor CH2</description></channel>
<channel id="pm25_ch1" typeId="pm25-particles">
<label>PM2.5 particle sensor CH1</label>
<description>PM2.5 particle sensor CH1</description>
</channel>
<channel id="pm25_avg_24h_ch1" typeId="pm25-particles">
<label>daily average PM2.5 particle sensor CH1</label>
<description>daily average PM2.5 particle sensor CH1</description>
</channel>
<channel id="pm25_ch2" typeId="pm25-particles">
<label>PM2.5 particle sensor CH2</label>
<description>PM2.5 particle sensor CH2</description>
</channel>
<channel id="pm25_avg_24h_ch2" typeId="pm25-particles">
<label>daily average PM2.5 particle sensor CH2</label>
<description>daily average PM2.5 particle sensor CH2</description>
</channel>
<channel id="wh57batt" typeId="system.battery-level"><label>battery level WH57 sensor</label><description>battery level WH57 sensor</description></channel>
<channel id="wh65batt" typeId="system.battery-level"><label>battery level WH65 sensor</label><description>battery level WH65 sensor</description></channel>
<channel id="pm25batt1" typeId="system.battery-level"><label>battery level PM2.5 CH1 sensor</label><description>battery level PM2.5 CH1 sensor</description></channel>
<channel id="pm25batt2" typeId="system.battery-level"><label>battery level PM2.5 CH2 sensor</label><description>battery level PM2.5 CH2 sensor</description></channel>
<channel id="soilbatt1" typeId="system.battery-level"><label>battery level soil moisture sensor CH1</label><description>battery level soil moisture sensor CH1</description></channel>
<channel id="soilbatt2" typeId="system.battery-level"><label>battery level soil moisture sensor CH2</label><description>battery level soil moisture sensor CH2</description></channel>
<channel id="soilbatt3" typeId="system.battery-level"><label>battery level soil moisture sensor CH3</label><description>battery level soil moisture sensor CH3</description></channel>
<channel id="soilbatt4" typeId="system.battery-level"><label>battery level soil moisture sensor CH4</label><description>battery level soil moisture sensor CH4</description></channel>
<channel id="wh57batt" typeId="system.battery-level">
<label>battery level WH57 sensor</label>
<description>battery level WH57 sensor</description>
</channel>
<channel id="wh65batt" typeId="system.battery-level">
<label>battery level WH65 sensor</label>
<description>battery level WH65 sensor</description>
</channel>
<channel id="pm25batt1" typeId="system.battery-level">
<label>battery level PM2.5 CH1 sensor</label>
<description>battery level PM2.5 CH1 sensor</description>
</channel>
<channel id="pm25batt2" typeId="system.battery-level">
<label>battery level PM2.5 CH2 sensor</label>
<description>battery level PM2.5 CH2 sensor</description>
</channel>
<channel id="soilbatt1" typeId="system.battery-level">
<label>battery level soil moisture sensor CH1</label>
<description>battery level soil moisture sensor CH1</description>
</channel>
<channel id="soilbatt2" typeId="system.battery-level">
<label>battery level soil moisture sensor CH2</label>
<description>battery level soil moisture sensor CH2</description>
</channel>
<channel id="soilbatt3" typeId="system.battery-level">
<label>battery level soil moisture sensor CH3</label>
<description>battery level soil moisture sensor CH3</description>
</channel>
<channel id="soilbatt4" typeId="system.battery-level">
<label>battery level soil moisture sensor CH4</label>
<description>battery level soil moisture sensor CH4</description>
</channel>
</channels>
<config-description>
<parameter name="bindHostname" type="text" required="true">
@ -84,7 +249,7 @@
<default>0.0.0.0</default>
<description/>
</parameter>
<parameter name="bindPort" type="integer" min="1000">
<parameter name="bindPort" type="integer" min="1000">
<label>Port for HTTP Server</label>
<default>40111</default>
<description/>
@ -96,28 +261,28 @@
<item-type>Number:Dimensionless</item-type>
<label>Humidity</label>
<category>Humidity</category>
<state readOnly="true" pattern="%3f %" />
<state readOnly="true" pattern="%3f %"/>
</channel-type>
<channel-type id="rain-amount">
<item-type>Number:Length</item-type>
<label>Rain Amount</label>
<category>Rain</category>
<state readOnly="true" pattern="%.1f mm" />
<state readOnly="true" pattern="%.1f mm"/>
</channel-type>
<channel-type id="rain-rate">
<item-type>Number:Speed</item-type>
<label>Rain Amount</label>
<category>Rain</category>
<state readOnly="true" pattern="%.1f mm/h" />
<state readOnly="true" pattern="%.1f mm/h"/>
</channel-type>
<channel-type id="solar-radiation">
<item-type>Number:Intensity</item-type>
<label>Solar Radiation</label>
<category>Sun</category>
<state readOnly="true" pattern="%.1f W/m²" />
<state readOnly="true" pattern="%.1f W/m²"/>
</channel-type>
<channel-type id="uv-index">
@ -130,7 +295,7 @@
<item-type>Number:Dimensionless</item-type>
<label>Soil Moisture</label>
<category>Moisture</category>
<state readOnly="true" pattern="%.1f %" />
<state readOnly="true" pattern="%.1f %"/>
</channel-type>
<channel-type id="lightning-distance">
@ -151,7 +316,7 @@
<channel-type id="pm25-particles">
<item-type>Number</item-type>
<label>PM2.5 Particle Density</label>
<state readOnly="true" pattern="%.1f µg/m³" />
<state readOnly="true" pattern="%.1f µg/m³"/>
</channel-type>
</thing:thing-descriptions>

View File

@ -120,7 +120,7 @@
<module>org.openhab.binding.ecotouch</module>
<module>org.openhab.binding.ecovacs</module>
<module>org.openhab.binding.ecowatt</module>
<module>org.openhab.binding.ecowitt</module>
<module>org.openhab.binding.ecowitt</module>
<module>org.openhab.binding.ekey</module>
<module>org.openhab.binding.electroluxair</module>
<module>org.openhab.binding.elerotransmitterstick</module>