public static final String CHANNEL_AUTOMATIC = "automatic";
public static final String CHANNEL_TEMPERATURE = "temperature";
public static final String CHANNEL_HUMIDITY = "humidity";
+ public static final String CHANNEL_PM25 = "pm25";
public static final String CHANNEL_WATERLEVEL = "waterLevel";
public static final String CHANNEL_FAN_RPM = "fanRPM";
public static final String CHANNEL_CLEAN_MODE = "cleanMode";
public static final String CHANNEL_DISC_REPLACE_TIME = "discReplaceTime";
public static final String CHANNEL_CLEANING_TIME = "cleaningTime";
public static final String CHANNEL_TIMER_TIME_PASSED = "timerTimePassed";
+ public static final String CHANNEL_SERVICE_TIME = "serviceTime";
public static final int PORT = 48000;
}
import org.openhab.binding.ventaair.internal.message.dto.Header;
import org.openhab.binding.ventaair.internal.message.dto.Info;
import org.openhab.binding.ventaair.internal.message.dto.Measurements;
+import org.openhab.core.library.dimension.Density;
import org.openhab.core.library.types.DecimalType;
import org.openhab.core.library.types.OnOffType;
import org.openhab.core.library.types.QuantityType;
updateState(VentaAirBindingConstants.CHANNEL_HUMIDITY, humidityState);
channelValueCache.put(VentaAirBindingConstants.CHANNEL_HUMIDITY, humidityState);
+ QuantityType<Density> pm25State = new QuantityType<>(measurements.getDust(),
+ Units.MICROGRAM_PER_CUBICMETRE);
+ updateState(VentaAirBindingConstants.CHANNEL_PM25, pm25State);
+ channelValueCache.put(VentaAirBindingConstants.CHANNEL_PM25, pm25State);
+
DecimalType waterLevelState = new DecimalType(measurements.getWaterLevel());
updateState(VentaAirBindingConstants.CHANNEL_WATERLEVEL, waterLevelState);
channelValueCache.put(VentaAirBindingConstants.CHANNEL_WATERLEVEL, waterLevelState);
updateState(VentaAirBindingConstants.CHANNEL_TIMER_TIME_PASSED, timerTimePassedState);
channelValueCache.put(VentaAirBindingConstants.CHANNEL_TIMER_TIME_PASSED, timerTimePassedState);
+ QuantityType<Time> serviceTimeState = new QuantityType<Time>(info.getServiceT(), Units.MINUTE);
+ updateState(VentaAirBindingConstants.CHANNEL_SERVICE_TIME, serviceTimeState);
+ channelValueCache.put(VentaAirBindingConstants.CHANNEL_SERVICE_TIME, serviceTimeState);
+
updateProperties(info);
}
@SerializedName(value = "FilterT")
private int filterT;
+ @SerializedName(value = "ServiceT")
+ private int serviceT;
+
@SerializedName(value = "UVCOnT")
private int uvCOnT;
return filterT;
}
+ public int getServiceT() {
+ return serviceT;
+ }
+
public int getUvCOnT() {
return uvCOnT;
}
private double humidity;
@SerializedName(value = "Dust")
- private int dust;
+ private double dust;
@SerializedName(value = "WaterLevel")
private int waterLevel;
return humidity;
}
- public int getDust() {
+ public double getDust() {
return dust;
}
channel-type.ventaair.humidity.description = Current Humidity
channel-type.ventaair.operationTime.label = Operation Time
channel-type.ventaair.operationTime.description = Operation Time since the device was first started (in hours)
+channel-type.ventaair.pm25.label = Air Quality
+channel-type.ventaair.pm25.description = Current Air Quality measured in PM 2.5
+channel-type.ventaair.serviceTime.label = Service Time
+channel-type.ventaair.serviceTime.description = Service time in minutes
channel-type.ventaair.sleepMode.label = Sleep Mode
channel-type.ventaair.sleepMode.description = Sleep Mode
channel-type.ventaair.targetHumidity.label = Target Humidity
channel-type.ventaair.waterLevel.state.option.1 = Refill tank
channel-type.ventaair.waterLevel.state.option.2 = OK
channel-type.ventaair.waterLevel.state.option.3 = Full
+channel-type.ventaair.waterLevel.state.option.4 = Max
<state pattern="%.1f %unit%" readOnly="true"/>
</channel-type>
+ <channel-type id="pm25">
+ <item-type>Number:Density</item-type>
+ <label>Air Quality</label>
+ <description>Current Air Quality measured in PM 2.5</description>
+ <state pattern="%.1f %unit%" readOnly="true"/>
+ </channel-type>
+
<channel-type id="waterLevel">
<item-type>Number</item-type>
<label>Water Level</label>
<option value="1">Refill tank</option>
<option value="2">OK</option>
<option value="3">Full</option>
+ <option value="4">Max</option>
</options>
</state>
</channel-type>
<state pattern="%d" readOnly="true"/>
</channel-type>
+ <channel-type id="serviceTime">
+ <item-type>Number:Time</item-type>
+ <label>Service Time</label>
+ <description>Service time in minutes</description>
+ <state pattern="%d" readOnly="true"/>
+ </channel-type>
+
</thing:thing-descriptions>
<channel id="automatic" typeId="automatic"/>
<channel id="temperature" typeId="temperature"/>
<channel id="humidity" typeId="humidity"/>
+ <channel id="pm25" typeId="pm25"/>
<channel id="waterLevel" typeId="waterLevel"/>
<channel id="fanRPM" typeId="fanRPM"/>
<channel id="cleanMode" typeId="cleanMode"/>
<channel id="operationTime" typeId="operationTime"/>
<channel id="discReplaceTime" typeId="discReplaceTime"/>
<channel id="cleaningTime" typeId="cleaningTime"/>
+ <channel id="serviceTime" typeId="serviceTime"/>
</channels>
<representation-property>macAddress</representation-property>