* Rename channel powerConsumption to energyConsumption and set display unit to litres for waterConsumption
---------
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
#### Dishwasher
-| Channel | Type | Read/write | Description |
-|---------------------|----------------------|------------|---------------------------------------------------------------------|
-| state | String | Read | Current status of the appliance |
-| rawState | Number | Read | Current status of the appliance as raw number |
-| program | String | Read | Current program or function running on the appliance |
-| rawProgram | Number | Read | Current program or function running on the appliance as raw number |
-| phase | String | Read | Current phase of the program running on the appliance |
-| rawPhase | Number | Read | Current phase of the program running on the appliance as raw number |
-| start | DateTime | Read | Programmed start time of the program |
-| end | DateTime | Read | End time of the program (programmed or running) |
-| duration | Number:Time | Read | Duration of the program running on the appliance |
-| elapsed | Number:Time | Read | Time elapsed in the program running on the appliance |
-| finish | Number:Time | Read | Time to finish the program running on the appliance |
-| door | Contact | Read | Current state of the door of the appliance |
-| switch | Switch | Write | Switch the appliance on or off |
-| powerConsumption | Number:Energy | Read | Power consumption by the currently running program on the appliance |
-| waterConsumption | Number:Volume | Read | Water consumption by the currently running program on the appliance |
+| Channel | Type | Read/write | Description |
+|---------------------|----------------------|------------|----------------------------------------------------------------------|
+| state | String | Read | Current status of the appliance |
+| rawState | Number | Read | Current status of the appliance as raw number |
+| program | String | Read | Current program or function running on the appliance |
+| rawProgram | Number | Read | Current program or function running on the appliance as raw number |
+| phase | String | Read | Current phase of the program running on the appliance |
+| rawPhase | Number | Read | Current phase of the program running on the appliance as raw number |
+| start | DateTime | Read | Programmed start time of the program |
+| end | DateTime | Read | End time of the program (programmed or running) |
+| duration | Number:Time | Read | Duration of the program running on the appliance |
+| elapsed | Number:Time | Read | Time elapsed in the program running on the appliance |
+| finish | Number:Time | Read | Time to finish the program running on the appliance |
+| door | Contact | Read | Current state of the door of the appliance |
+| switch | Switch | Write | Switch the appliance on or off |
+| energyConsumption | Number:Energy | Read | Energy consumption by the currently running program on the appliance |
+| waterConsumption | Number:Volume | Read | Water consumption by the currently running program on the appliance |
##### Programs
#### Washing Machine
-| Channel | Type | Read/write | Description |
-|---------------------|----------------------|------------|---------------------------------------------------------------------|
-| state | String | Read | Current status of the appliance |
-| rawState | Number | Read | Current status of the appliance as raw number |
-| program | String | Read | Current program or function running on the appliance |
-| rawProgram | Number | Read | Current program or function running on the appliance as raw number |
-| type | String | Read | Type of the program running on the appliance |
-| phase | String | Read | Current phase of the program running on the appliance |
-| rawPhase | Number | Read | Current phase of the program running on the appliance as raw number |
-| start | DateTime | Read | Programmed start time of the program |
-| end | DateTime | Read | End time of the program (programmed or running) |
-| duration | Number:Time | Read | Duration of the program running on the appliance |
-| elapsed | Number:Time | Read | Time elapsed in the program running on the appliance |
-| finish | Number:Time | Read | Time to finish the program running on the appliance |
-| door | Contact | Read | Current state of the door of the appliance |
-| switch | Switch | Write | Switch the appliance on or off |
-| target | Number:Temperature | Read | Temperature of the selected program (10 °C = cold) |
-| spinningspeed | String | Read | Spinning speed in the program running on the appliance |
-| powerConsumption | Number:Energy | Read | Power consumption by the currently running program on the appliance |
-| waterConsumption | Number:Volume | Read | Water consumption by the currently running program on the appliance |
+| Channel | Type | Read/write | Description |
+|---------------------|----------------------|------------|----------------------------------------------------------------------|
+| state | String | Read | Current status of the appliance |
+| rawState | Number | Read | Current status of the appliance as raw number |
+| program | String | Read | Current program or function running on the appliance |
+| rawProgram | Number | Read | Current program or function running on the appliance as raw number |
+| type | String | Read | Type of the program running on the appliance |
+| phase | String | Read | Current phase of the program running on the appliance |
+| rawPhase | Number | Read | Current phase of the program running on the appliance as raw number |
+| start | DateTime | Read | Programmed start time of the program |
+| end | DateTime | Read | End time of the program (programmed or running) |
+| duration | Number:Time | Read | Duration of the program running on the appliance |
+| elapsed | Number:Time | Read | Time elapsed in the program running on the appliance |
+| finish | Number:Time | Read | Time to finish the program running on the appliance |
+| door | Contact | Read | Current state of the door of the appliance |
+| switch | Switch | Write | Switch the appliance on or off |
+| target | Number:Temperature | Read | Temperature of the selected program (10 °C = cold) |
+| spinningspeed | String | Read | Spinning speed in the program running on the appliance |
+| energyConsumption | Number:Energy | Read | Energy consumption by the currently running program on the appliance |
+| waterConsumption | Number:Volume | Read | Water consumption by the currently running program on the appliance |
##### Programs
String Dishwasher_Phase "Phase [%s]" {channel="miele:dishwasher:home:dishwasher:phase"}
Number:Time Dishwasher_ElapsedTime "Elapsed time" <time> {channel="miele:dishwasher:home:dishwasher:elapsed"}
Number:Time Dishwasher_FinishTime "Remaining time" <time> {channel="miele:dishwasher:home:dishwasher:finish"}
-Number:Energy Dishwasher_PowerConsumption {channel="miele:dishwasher:home:dishwasher:powerConsumption"}
+Number:Energy Dishwasher_EnergyConsumption {channel="miele:dishwasher:home:dishwasher:energyConsumption"}
Number:Volume Dishwasher_WaterConsumption {channel="miele:dishwasher:home:dishwasher:waterConsumption"}
String Fridge_State {channel="miele:fridge:home:fridge:state"}
String WashingMachine_SpinningSpeed {channel="miele:washingmachine:home:washingmachine:spinningspeed"}
Number:Time WashingMachine_ElapsedTime "Elapsed time" <time> {channel="miele:washingmachine:home:washingmachine:elapsed"}
Number:Time WashingMachine_FinishTime "Remaining time" <time> {channel="miele:washingmachine:home:washingmachine:finish"}
-Number:Energy WashingMachine_PowerConsumption {channel="miele:washingmachine:home:washingmachine:powerConsumption"}
+Number:Energy WashingMachine_EnergyConsumption {channel="miele:washingmachine:home:washingmachine:energyConsumption"}
Number:Volume WashingMachine_WaterConsumption {channel="miele:washingmachine:home:washingmachine:waterConsumption"}
String TumbleDryer_State {channel="miele:tumbledryer:home:tumbledryer:state"}
Text item=WashingMachine_Phase visibility=[WashingMachine_Phase!=UNDEF]
Text item=WashingMachine_ElapsedTime
Text item=WashingMachine_FinishTime
- Text item=WashingMachine_PowerConsumption
+ Text item=WashingMachine_EnergyConsumption
Text item=WashingMachine_WaterConsumption
}
Text item=TumbleDryer_State label="Tumble Dryer [%s]" icon="dryer" {
Text itemDishwasher_Phase visibility=[Dishwasher_Phase!=UNDEF]
Text item=Dishwasher_ElapsedTime
Text item=Dishwasher_FinishTime
- Text item=Dishwasher_PowerConsumption
+ Text item=Dishwasher_EnergyConsumption
Text item=Dishwasher_WaterConsumption
}
Text item=Fridge_CurrentTemperature label="Fridge" icon="climate" {
public static final String START_CHANNEL_ID = "start";
public static final String END_CHANNEL_ID = "end";
public static final String FINISH_CHANNEL_ID = "finish";
- public static final String POWER_CONSUMPTION_CHANNEL_ID = "powerConsumption";
+ public static final String ENERGY_CONSUMPTION_CHANNEL_ID = "energyConsumption";
public static final String WATER_CONSUMPTION_CHANNEL_ID = "waterConsumption";
// List of all Thing Type UIDs
}
},
SWITCH("", "switch", OnOffType.class, false, false),
- POWER_CONSUMPTION(EXTENDED_DEVICE_STATE_PROPERTY_NAME, POWER_CONSUMPTION_CHANNEL_ID, QuantityType.class, false,
+ ENERGY_CONSUMPTION(EXTENDED_DEVICE_STATE_PROPERTY_NAME, ENERGY_CONSUMPTION_CHANNEL_ID, QuantityType.class, false,
true),
WATER_CONSUMPTION(EXTENDED_DEVICE_STATE_PROPERTY_NAME, WATER_CONSUMPTION_CHANNEL_ID, QuantityType.class, false,
true);
*/
package org.openhab.binding.miele.internal.handler;
-import static org.openhab.binding.miele.internal.MieleBindingConstants.MIELE_DEVICE_CLASS_DISHWASHER;
-import static org.openhab.binding.miele.internal.MieleBindingConstants.POWER_CONSUMPTION_CHANNEL_ID;
-import static org.openhab.binding.miele.internal.MieleBindingConstants.WATER_CONSUMPTION_CHANNEL_ID;
+import static org.openhab.binding.miele.internal.MieleBindingConstants.*;
import java.math.BigDecimal;
public class DishwasherHandler extends MieleApplianceHandler<DishwasherChannelSelector>
implements ExtendedDeviceStateListener {
- private static final int POWER_CONSUMPTION_BYTE_POSITION = 16;
+ private static final int ENERGY_CONSUMPTION_BYTE_POSITION = 16;
private static final int WATER_CONSUMPTION_BYTE_POSITION = 18;
private static final int EXTENDED_STATE_MIN_SIZE_BYTES = 19;
}
BigDecimal kiloWattHoursTenths = BigDecimal
- .valueOf(extendedDeviceState[POWER_CONSUMPTION_BYTE_POSITION] & 0xff);
+ .valueOf(extendedDeviceState[ENERGY_CONSUMPTION_BYTE_POSITION] & 0xff);
var kiloWattHours = new QuantityType<>(kiloWattHoursTenths.divide(BigDecimal.valueOf(10)), Units.KILOWATT_HOUR);
- updateExtendedState(POWER_CONSUMPTION_CHANNEL_ID, kiloWattHours);
+ updateExtendedState(ENERGY_CONSUMPTION_CHANNEL_ID, kiloWattHours);
BigDecimal decilitres = BigDecimal.valueOf(extendedDeviceState[WATER_CONSUMPTION_BYTE_POSITION] & 0xff);
var litres = new QuantityType<>(decilitres.divide(BigDecimal.valueOf(10)), Units.LITRE);
if (cause == null) {
logger.debug("An exception occurred while getting the home devices: '{}'", e.getMessage());
} else {
- logger.debug("An exception occurred while getting the home devices: '{}' -> '{}", e.getMessage(),
+ logger.debug("An exception occurred while getting the home devices: '{}' -> '{}'", e.getMessage(),
cause.getMessage());
}
}
}
},
SWITCH("", "switch", OnOffType.class, false, false),
- POWER_CONSUMPTION(EXTENDED_DEVICE_STATE_PROPERTY_NAME, POWER_CONSUMPTION_CHANNEL_ID, QuantityType.class, false,
+ ENERGY_CONSUMPTION(EXTENDED_DEVICE_STATE_PROPERTY_NAME, ENERGY_CONSUMPTION_CHANNEL_ID, QuantityType.class, false,
true),
WATER_CONSUMPTION(EXTENDED_DEVICE_STATE_PROPERTY_NAME, WATER_CONSUMPTION_CHANNEL_ID, QuantityType.class, false,
true);
*/
package org.openhab.binding.miele.internal.handler;
-import static org.openhab.binding.miele.internal.MieleBindingConstants.MIELE_DEVICE_CLASS_WASHING_MACHINE;
-import static org.openhab.binding.miele.internal.MieleBindingConstants.POWER_CONSUMPTION_CHANNEL_ID;
-import static org.openhab.binding.miele.internal.MieleBindingConstants.WATER_CONSUMPTION_CHANNEL_ID;
+import static org.openhab.binding.miele.internal.MieleBindingConstants.*;
import java.math.BigDecimal;
public class WashingMachineHandler extends MieleApplianceHandler<WashingMachineChannelSelector>
implements ExtendedDeviceStateListener {
- private static final int POWER_CONSUMPTION_BYTE_POSITION = 51;
+ private static final int ENERGY_CONSUMPTION_BYTE_POSITION = 51;
private static final int WATER_CONSUMPTION_BYTE_POSITION = 53;
private static final int EXTENDED_STATE_MIN_SIZE_BYTES = 54;
}
BigDecimal kiloWattHoursTenths = BigDecimal
- .valueOf(extendedDeviceState[POWER_CONSUMPTION_BYTE_POSITION] & 0xff);
+ .valueOf(extendedDeviceState[ENERGY_CONSUMPTION_BYTE_POSITION] & 0xff);
var kiloWattHours = new QuantityType<>(kiloWattHoursTenths.divide(BigDecimal.valueOf(10)), Units.KILOWATT_HOUR);
- updateExtendedState(POWER_CONSUMPTION_CHANNEL_ID, kiloWattHours);
+ updateExtendedState(ENERGY_CONSUMPTION_CHANNEL_ID, kiloWattHours);
var litres = new QuantityType<>(BigDecimal.valueOf(extendedDeviceState[WATER_CONSUMPTION_BYTE_POSITION] & 0xff),
Units.LITRE);
channel-type.miele.elapsed.state.pattern = %1$tR
channel-type.miele.end.label = End Time
channel-type.miele.end.description = End time of the program (programmed or running)
+channel-type.miele.energy-consumption.label = Energy Consumption
+channel-type.miele.energy-consumption.description = Energy consumption by the currently running program on the appliance
channel-type.miele.finish.label = Finish Time
channel-type.miele.finish.description = Time to finish the program running on the appliance
channel-type.miele.finish.state.pattern = %1$tR
channel-type.miele.plates.description = Number of heating zones/plates on the hob
channel-type.miele.power.label = Power Step
channel-type.miele.power.description = Power level of the heating zone/plate
-channel-type.miele.powerConsumption.label = Power Consumption
-channel-type.miele.powerConsumption.description = Power consumption by the currently running program on the appliance
channel-type.miele.program.label = Program
channel-type.miele.program.description = Current program or function running on the appliance
channel-type.miele.rawPhase.label = Raw Phase
channel-type.miele.type.description = Type of the program running on the appliance
channel-type.miele.ventilation.label = Ventilation Power
channel-type.miele.ventilation.description = Current ventilation power
-channel-type.miele.waterConsumption.label = Water Consumption
-channel-type.miele.waterConsumption.description = Water consumption by the currently running program on the appliance
+channel-type.miele.water-consumption.label = Water Consumption
+channel-type.miele.water-consumption.description = Water consumption by the currently running program on the appliance
# thing status descriptions
<state readOnly="true"></state>
</channel-type>
- <channel-type id="powerConsumption">
+ <channel-type id="energy-consumption">
<item-type>Number:Energy</item-type>
- <label>Power Consumption</label>
- <description>Power consumption by the currently running program on the appliance</description>
+ <label>Energy Consumption</label>
+ <description>Energy consumption by the currently running program on the appliance</description>
<category>Energy</category>
<tags>
<tag>Measurement</tag>
<state readOnly="true" pattern="%.1f %unit%"/>
</channel-type>
- <channel-type id="waterConsumption">
+ <channel-type id="water-consumption">
<item-type>Number:Volume</item-type>
<label>Water Consumption</label>
<description>Water consumption by the currently running program on the appliance</description>
<tag>Measurement</tag>
<tag>Water</tag>
</tags>
- <state readOnly="true" pattern="%.1f %unit%"/>
+ <state readOnly="true" pattern="%.1f l"/>
</channel-type>
</thing:thing-descriptions>
<channel id="finish" typeId="finish"/>
<channel id="door" typeId="door"/>
<channel id="switch" typeId="switch"/>
- <channel id="powerConsumption" typeId="powerConsumption"/>
- <channel id="waterConsumption" typeId="waterConsumption"/>
+ <channel id="energyConsumption" typeId="energy-consumption"/>
+ <channel id="waterConsumption" typeId="water-consumption"/>
</channels>
+ <properties>
+ <property name="thingTypeVersion">1</property>
+ </properties>
+
<representation-property>uid</representation-property>
<config-description-ref uri="thing-type:miele:appliance"/>
<description>Temperature of the selected program (10 °C = cold)</description>
</channel>
<channel id="spinningspeed" typeId="spinningspeed"/>
- <channel id="powerConsumption" typeId="powerConsumption"/>
- <channel id="waterConsumption" typeId="waterConsumption"/>
+ <channel id="energyConsumption" typeId="energy-consumption"/>
+ <channel id="waterConsumption" typeId="water-consumption"/>
</channels>
+ <properties>
+ <property name="thingTypeVersion">1</property>
+ </properties>
+
<representation-property>uid</representation-property>
<config-description-ref uri="thing-type:miele:appliance"/>
--- /dev/null
+<?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="miele:dishwasher">
+ <instruction-set targetVersion="1">
+ <add-channel id="energyConsumption">
+ <type>miele:energy-consumption</type>
+ </add-channel>
+ <update-channel id="waterConsumption">
+ <type>miele:water-consumption</type>
+ </update-channel>
+ <remove-channel id="powerConsumption"/>
+ </instruction-set>
+ </thing-type>
+
+ <thing-type uid="miele:washingmachine">
+ <instruction-set targetVersion="1">
+ <add-channel id="energyConsumption">
+ <type>miele:energy-consumption</type>
+ </add-channel>
+ <update-channel id="waterConsumption">
+ <type>miele:water-consumption</type>
+ </update-channel>
+ <remove-channel id="powerConsumption"/>
+ </instruction-set>
+ </thing-type>
+
+</update:update-descriptions>