[openwebnet] rename thermoregulation's (WHO=4) things (#10865)
* - bus_thermostat renamed to bus_thermo_zone - bus_temp_sensor renamed to bus_themo_sensor - linked OWN4j 0.5.3-SNAPSHOT (camelCase for enums) Signed-off-by: Conte Andrea <andrea@conte.com> * updated ReadMe according to things renaming Signed-off-by: Conte Andrea <andrea@conte.com> * Updated readme and thermo thing labels. Renamed thing descriptors to BusThermoZone and BusThermoSensor Signed-off-by: Massimo Valla <mvcode00@gmail.com> * using own4j release 0.5.3 Signed-off-by: Conte Andrea <andrea@conte.com> * removed json tags in README. Added KG4691 to tested thermostats Signed-off-by: Massimo Valla <mvcode00@gmail.com> Co-authored-by: Massimo Valla <mvcode00@gmail.com>
This commit is contained in:
@@ -55,10 +55,10 @@ public class OpenWebNetBindingConstants {
|
||||
public static final String THING_LABEL_BUS_AUTOMATION = "Automation";
|
||||
public static final ThingTypeUID THING_TYPE_BUS_ENERGY_METER = new ThingTypeUID(BINDING_ID, "bus_energy_meter");
|
||||
public static final String THING_LABEL_BUS_ENERGY_METER = "Energy Meter";
|
||||
public static final ThingTypeUID THING_TYPE_BUS_TEMP_SENSOR = new ThingTypeUID(BINDING_ID, "bus_temp_sensor");
|
||||
public static final String THING_LABEL_BUS_TEMP_SENSOR = "Temperature Sensor";
|
||||
public static final ThingTypeUID THING_TYPE_BUS_THERMOSTAT = new ThingTypeUID(BINDING_ID, "bus_thermostat");
|
||||
public static final String THING_LABEL_BUS_THERMOSTAT = "Thermostat (stand-alone)";
|
||||
public static final ThingTypeUID THING_TYPE_BUS_THERMO_SENSOR = new ThingTypeUID(BINDING_ID, "bus_thermo_sensor");
|
||||
public static final String THING_LABEL_BUS_THERMO_SENSOR = "Thermo Sensor";
|
||||
public static final ThingTypeUID THING_TYPE_BUS_THERMO_ZONE = new ThingTypeUID(BINDING_ID, "bus_thermo_zone");
|
||||
public static final String THING_LABEL_BUS_THERMO_ZONE = "Thermo Zone";
|
||||
|
||||
// ZIGBEE
|
||||
public static final ThingTypeUID THING_TYPE_ZB_ON_OFF_SWITCH = new ThingTypeUID(BINDING_ID, "zb_on_off_switch");
|
||||
@@ -83,8 +83,8 @@ public class OpenWebNetBindingConstants {
|
||||
THING_TYPE_BUS_AUTOMATION);
|
||||
|
||||
// ## Thermoregulation
|
||||
public static final Set<ThingTypeUID> THERMOREGULATION_SUPPORTED_THING_TYPES = Set.of(THING_TYPE_BUS_THERMOSTAT,
|
||||
THING_TYPE_BUS_TEMP_SENSOR);
|
||||
public static final Set<ThingTypeUID> THERMOREGULATION_SUPPORTED_THING_TYPES = Set.of(THING_TYPE_BUS_THERMO_ZONE,
|
||||
THING_TYPE_BUS_THERMO_SENSOR);
|
||||
|
||||
// ## Energy Management
|
||||
public static final Set<ThingTypeUID> ENERGY_MANAGEMENT_SUPPORTED_THING_TYPES = Set.of(THING_TYPE_BUS_ENERGY_METER);
|
||||
@@ -119,9 +119,9 @@ public class OpenWebNetBindingConstants {
|
||||
public static final String CHANNEL_TEMP_SETPOINT = "setpointTemperature";
|
||||
public static final String CHANNEL_MODE = "mode";
|
||||
public static final String CHANNEL_FAN_SPEED = "speedFanCoil";
|
||||
public static final String CHANNEL_CONDITIONING_VALVE = "conditioningValve";
|
||||
public static final String CHANNEL_HEATING_VALVE = "heatingValve";
|
||||
public static final String CHANNEL_ACTUATOR = "actuator";
|
||||
public static final String CHANNEL_CONDITIONING_VALVES = "conditioningValves";
|
||||
public static final String CHANNEL_HEATING_VALVES = "heatingValves";
|
||||
public static final String CHANNEL_ACTUATORS = "actuators";
|
||||
|
||||
// energy management
|
||||
public static final String CHANNEL_POWER = "power";
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
*/
|
||||
package org.openhab.binding.openwebnet.handler;
|
||||
|
||||
import static org.openhab.binding.openwebnet.OpenWebNetBindingConstants.*;
|
||||
import static org.openhab.binding.openwebnet.OpenWebNetBindingConstants.PROPERTY_FIRMWARE_VERSION;
|
||||
import static org.openhab.binding.openwebnet.OpenWebNetBindingConstants.PROPERTY_SERIAL_NO;
|
||||
import static org.openhab.binding.openwebnet.OpenWebNetBindingConstants.THING_TYPE_ZB_GATEWAY;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@@ -312,12 +314,12 @@ public class OpenWebNetBridgeHandler extends ConfigStatusBridgeHandler implement
|
||||
BaseOpenMessage bmsg = baseMsg;
|
||||
if (baseMsg instanceof Lighting) {
|
||||
What what = baseMsg.getWhat();
|
||||
if (Lighting.WHAT.OFF.equals(what)) { // skipping OFF msg: cannot distinguish dimmer/switch
|
||||
if (Lighting.WhatLighting.OFF.equals(what)) { // skipping OFF msg: cannot distinguish dimmer/switch
|
||||
logger.debug("discoverByActivation: skipping OFF msg: cannot distinguish dimmer/switch");
|
||||
return;
|
||||
}
|
||||
if (Lighting.WHAT.ON.equals(what)) { // if not already done just now, request light status to
|
||||
// distinguish dimmer from switch
|
||||
if (Lighting.WhatLighting.ON.equals(what)) { // if not already done just now, request light status to
|
||||
// distinguish dimmer from switch
|
||||
if (discoveringDevices.containsKey(ownIdFromMessage(baseMsg))) {
|
||||
logger.debug(
|
||||
"discoverByActivation: we just requested status for this device and it's ON -> it's a switch");
|
||||
|
||||
@@ -36,7 +36,6 @@ import org.openwebnet4j.OpenGateway;
|
||||
import org.openwebnet4j.communication.OWNException;
|
||||
import org.openwebnet4j.message.BaseOpenMessage;
|
||||
import org.openwebnet4j.message.EnergyManagement;
|
||||
import org.openwebnet4j.message.EnergyManagement.DIM;
|
||||
import org.openwebnet4j.message.FrameException;
|
||||
import org.openwebnet4j.message.Where;
|
||||
import org.openwebnet4j.message.WhereEnergyManagement;
|
||||
@@ -182,7 +181,7 @@ public class OpenWebNetEnergyHandler extends OpenWebNetThingHandler {
|
||||
return;
|
||||
} else {
|
||||
// fix: check for correct DIM (ActivePower / 113)
|
||||
if (msg.getDim().equals(DIM.ACTIVE_POWER)) {
|
||||
if (msg.getDim().equals(EnergyManagement.DimEnergyMgmt.ACTIVE_POWER)) {
|
||||
updateActivePower(msg);
|
||||
} else {
|
||||
logger.debug("handleMessage() Ignoring message {} because it's not related to active power value.",
|
||||
|
||||
@@ -12,7 +12,13 @@
|
||||
*/
|
||||
package org.openhab.binding.openwebnet.handler;
|
||||
|
||||
import static org.openhab.binding.openwebnet.OpenWebNetBindingConstants.*;
|
||||
import static org.openhab.binding.openwebnet.OpenWebNetBindingConstants.CHANNEL_BRIGHTNESS;
|
||||
import static org.openhab.binding.openwebnet.OpenWebNetBindingConstants.CHANNEL_SWITCH;
|
||||
import static org.openhab.binding.openwebnet.OpenWebNetBindingConstants.CHANNEL_SWITCH_01;
|
||||
import static org.openhab.binding.openwebnet.OpenWebNetBindingConstants.CHANNEL_SWITCH_02;
|
||||
import static org.openhab.binding.openwebnet.OpenWebNetBindingConstants.THING_TYPE_BUS_DIMMER;
|
||||
import static org.openhab.binding.openwebnet.OpenWebNetBindingConstants.THING_TYPE_ZB_DIMMER;
|
||||
import static org.openhab.binding.openwebnet.OpenWebNetBindingConstants.THING_TYPE_ZB_ON_OFF_SWITCH_2UNITS;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -304,7 +310,7 @@ public class OpenWebNetLightingHandler extends OpenWebNetThingHandler {
|
||||
if (msg.getWhat() != null) {
|
||||
updateBrightnessState(msg);
|
||||
} else { // dimension notification
|
||||
if (msg.getDim() == Lighting.DIM.DIMMER_LEVEL_100) {
|
||||
if (msg.getDim() == Lighting.DimLighting.DIMMER_LEVEL_100) {
|
||||
int newBrightness;
|
||||
try {
|
||||
newBrightness = msg.parseDimmerLevel100();
|
||||
@@ -336,8 +342,8 @@ public class OpenWebNetLightingHandler extends OpenWebNetThingHandler {
|
||||
private void updateBrightnessState(Lighting msg) {
|
||||
What w = msg.getWhat();
|
||||
if (w != null) {
|
||||
if (Lighting.WHAT.ON.equals(w)) {
|
||||
w = Lighting.WHAT.DIMMER_LEVEL_2; // levels start at 2
|
||||
if (Lighting.WhatLighting.ON.equals(w)) {
|
||||
w = Lighting.WhatLighting.DIMMER_LEVEL_2; // levels start at 2
|
||||
}
|
||||
int newBrightnessWhat = w.value();
|
||||
int brightnessWhat = UNKNOWN_STATE;
|
||||
|
||||
@@ -41,8 +41,8 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* The {@link OpenWebNetThermoregulationHandler} is responsible for handling commands/messages for a Thermoregulation
|
||||
* OpenWebNet device. It extends the abstract {@link OpenWebNetThingHandler}.
|
||||
* The {@link OpenWebNetThermoregulationHandler} is responsible for handling commands/messages for Thermoregulation
|
||||
* Things. It extends the abstract {@link OpenWebNetThingHandler}.
|
||||
*
|
||||
* @author Massimo Valla - Initial contribution
|
||||
* @author Andrea Conte - Thermoregulation
|
||||
@@ -55,7 +55,7 @@ public class OpenWebNetThermoregulationHandler extends OpenWebNetThingHandler {
|
||||
|
||||
public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = OpenWebNetBindingConstants.THERMOREGULATION_SUPPORTED_THING_TYPES;
|
||||
|
||||
private boolean isTempSensor = false; // is the device a sensor or thermostat?
|
||||
private boolean isTempSensor = false; // is the thing a sensor ?
|
||||
|
||||
private double currentSetPointTemp = 11.5d; // 11.5 is the default setTemp used in MyHomeUP mobile app
|
||||
|
||||
@@ -293,25 +293,25 @@ public class OpenWebNetThermoregulationHandler extends OpenWebNetThingHandler {
|
||||
try {
|
||||
Thermoregulation.ValveOrActuatorStatus cv = Thermoregulation.parseValveStatus(tmsg,
|
||||
Thermoregulation.WhatThermo.CONDITIONING);
|
||||
updateState(CHANNEL_CONDITIONING_VALVE, new StringType(cv.toString()));
|
||||
updateState(CHANNEL_CONDITIONING_VALVES, new StringType(cv.toString()));
|
||||
|
||||
Thermoregulation.ValveOrActuatorStatus hv = Thermoregulation.parseValveStatus(tmsg,
|
||||
Thermoregulation.WhatThermo.HEATING);
|
||||
updateState(CHANNEL_HEATING_VALVE, new StringType(hv.toString()));
|
||||
updateState(CHANNEL_HEATING_VALVES, new StringType(hv.toString()));
|
||||
} catch (FrameException e) {
|
||||
logger.warn("updateValveStatus() FrameException on frame {}: {}", tmsg, e.getMessage());
|
||||
updateState(CHANNEL_CONDITIONING_VALVE, UnDefType.UNDEF);
|
||||
updateState(CHANNEL_HEATING_VALVE, UnDefType.UNDEF);
|
||||
updateState(CHANNEL_CONDITIONING_VALVES, UnDefType.UNDEF);
|
||||
updateState(CHANNEL_HEATING_VALVES, UnDefType.UNDEF);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateActuatorStatus(Thermoregulation tmsg) {
|
||||
try {
|
||||
Thermoregulation.ValveOrActuatorStatus hv = Thermoregulation.parseActuatorStatus(tmsg);
|
||||
updateState(CHANNEL_ACTUATOR, new StringType(hv.toString()));
|
||||
updateState(CHANNEL_ACTUATORS, new StringType(hv.toString()));
|
||||
} catch (FrameException e) {
|
||||
logger.warn("updateActuatorStatus() FrameException on frame {}: {}", tmsg, e.getMessage());
|
||||
updateState(CHANNEL_ACTUATOR, UnDefType.UNDEF);
|
||||
updateState(CHANNEL_ACTUATORS, UnDefType.UNDEF);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -322,12 +322,12 @@ public class OpenWebNetThermoregulationHandler extends OpenWebNetThingHandler {
|
||||
try {
|
||||
send(Thermoregulation.requestTemperature(w));
|
||||
if (!this.isTempSensor) {
|
||||
// for bus_thermostat request also other single channels updates
|
||||
// for bus_thermo_zone request also other single channels updates
|
||||
send(Thermoregulation.requestSetPointTemperature(w));
|
||||
send(Thermoregulation.requestFanCoilSpeed(w));
|
||||
send(Thermoregulation.requestMode(w));
|
||||
send(Thermoregulation.requestValveStatus(w));
|
||||
send(Thermoregulation.requestActuatorStatus(w));
|
||||
send(Thermoregulation.requestValvesStatus(w));
|
||||
send(Thermoregulation.requestActuatorsStatus(w));
|
||||
}
|
||||
} catch (OWNException e) {
|
||||
logger.warn("refreshDevice() where='{}' returned OWNException {}", w, e.getMessage());
|
||||
|
||||
@@ -131,15 +131,15 @@ public class OpenWebNetDeviceDiscoveryService extends AbstractDiscoveryService
|
||||
deviceWho = Who.AUTOMATION;
|
||||
break;
|
||||
}
|
||||
case SCS_TEMP_SENSOR: {
|
||||
thingTypeUID = OpenWebNetBindingConstants.THING_TYPE_BUS_TEMP_SENSOR;
|
||||
thingLabel = OpenWebNetBindingConstants.THING_LABEL_BUS_TEMP_SENSOR;
|
||||
case SCS_THERMO_SENSOR: {
|
||||
thingTypeUID = OpenWebNetBindingConstants.THING_TYPE_BUS_THERMO_SENSOR;
|
||||
thingLabel = OpenWebNetBindingConstants.THING_LABEL_BUS_THERMO_SENSOR;
|
||||
deviceWho = Who.THERMOREGULATION;
|
||||
break;
|
||||
}
|
||||
case SCS_THERMOSTAT: {
|
||||
thingTypeUID = OpenWebNetBindingConstants.THING_TYPE_BUS_THERMOSTAT;
|
||||
thingLabel = OpenWebNetBindingConstants.THING_LABEL_BUS_THERMOSTAT;
|
||||
case SCS_THERMO_ZONE: {
|
||||
thingTypeUID = OpenWebNetBindingConstants.THING_TYPE_BUS_THERMO_ZONE;
|
||||
thingLabel = OpenWebNetBindingConstants.THING_LABEL_BUS_THERMO_ZONE;
|
||||
deviceWho = Who.THERMOREGULATION;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -4,13 +4,14 @@
|
||||
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
|
||||
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
|
||||
|
||||
<!-- Thing for BUS Temperature Sensor -->
|
||||
<thing-type id="bus_temp_sensor">
|
||||
<!-- Thing for BUS Thermo Sensor -->
|
||||
<thing-type id="bus_thermo_sensor">
|
||||
<supported-bridge-type-refs>
|
||||
<bridge-type-ref id="bus_gateway"/>
|
||||
</supported-bridge-type-refs>
|
||||
<label>Temperature Sensor</label>
|
||||
<description>A OpenWebNet BUS/SCS temperature sensor. BTicino models: L/N/NT4577 etc.</description>
|
||||
<label>Thermo Sensor</label>
|
||||
<description>A OpenWebNet BUS/SCS thermo sensor (probe) for measuring temperature in a zone. BTicino models:
|
||||
L/N/NT4577 etc.</description>
|
||||
|
||||
<channels>
|
||||
<channel id="temperature" typeId="temperature"/>
|
||||
@@ -27,7 +28,7 @@
|
||||
<config-description>
|
||||
<parameter name="where" type="text" required="true">
|
||||
<label>OpenWebNet Device Address</label>
|
||||
<description>Example: Zone 2 --> where=2. For external sensors: sensor 5 --> where=500</description>
|
||||
<description>Example: sensor 3 of zone 2 --> where=302. Sensor 5 of external zone 00 --> where=500</description>
|
||||
</parameter>
|
||||
</config-description>
|
||||
|
||||
@@ -4,21 +4,21 @@
|
||||
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
|
||||
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
|
||||
|
||||
<!-- Thing for BUS Thermostat (BTicino xxx/xxx/...) -->
|
||||
<thing-type id="bus_thermostat">
|
||||
<!-- Thing for BUS Thermo Zone -->
|
||||
<thing-type id="bus_thermo_zone">
|
||||
<supported-bridge-type-refs>
|
||||
<bridge-type-ref id="bus_gateway"/>
|
||||
</supported-bridge-type-refs>
|
||||
|
||||
<label>Thermostat (stand-alone)</label>
|
||||
<description>A OpenWebNet BUS/SCS zone stand-alone thermostat. BTicino models: LN4691.</description>
|
||||
<label>Thermo Zone</label>
|
||||
<description>A OpenWebNet BUS/SCS configured thermo zone (managed via Central Unit or stand alone).</description>
|
||||
|
||||
<channels>
|
||||
<!-- read only -->
|
||||
<channel id="temperature" typeId="temperature"/>
|
||||
<channel id="conditioningValve" typeId="conditioningValve"/>
|
||||
<channel id="heatingValve" typeId="heatingValve"/>
|
||||
<channel id="actuator" typeId="actuator"/>
|
||||
<channel id="conditioningValves" typeId="conditioningValves"/>
|
||||
<channel id="heatingValves" typeId="heatingValves"/>
|
||||
<channel id="actuators" typeId="actuators"/>
|
||||
<!-- read/write -->
|
||||
<channel id="setpointTemperature" typeId="setpointTemperature"/>
|
||||
<channel id="function" typeId="function"/>
|
||||
@@ -28,8 +28,8 @@
|
||||
|
||||
<properties>
|
||||
<property name="vendor">BTicino/Legrand</property>
|
||||
<property name="model">BTI-LN4691</property>
|
||||
<property name="ownDeviceType">410/420/430</property>
|
||||
<property name="model">Zone thermostat BTI-LN4691 (stand-alone), 3550 (99 zones Central Unit)</property>
|
||||
<property name="ownDeviceType">410/420</property>
|
||||
</properties>
|
||||
|
||||
<representation-property>ownId</representation-property>
|
||||
@@ -37,7 +37,13 @@
|
||||
<config-description>
|
||||
<parameter name="where" type="text" required="true">
|
||||
<label>OpenWebNet Device Address</label>
|
||||
<description>Example: Zone 2 --> where=2.</description>
|
||||
<description>Example: zone 2 --> where=2.</description>
|
||||
</parameter>
|
||||
|
||||
<parameter name="standAlone" type="boolean">
|
||||
<label>Stand-alone</label>
|
||||
<description>Distinguishes between a zone managed by a Central Unit (false) or stand-alone (true, default)</description>
|
||||
<default>true</default>
|
||||
</parameter>
|
||||
</config-description>
|
||||
|
||||
@@ -100,10 +100,10 @@
|
||||
</state>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="conditioningValve" advanced="true">
|
||||
<channel-type id="conditioningValves" advanced="true">
|
||||
<item-type>String</item-type>
|
||||
<label>Conditioning Valve</label>
|
||||
<description>Conditioning Valve status (read only)</description>
|
||||
<label>Conditioning Valves</label>
|
||||
<description>Conditioning Valves status (read only)</description>
|
||||
<state readOnly="true">
|
||||
<options>
|
||||
<option value="OFF">OFF</option>
|
||||
@@ -122,10 +122,10 @@
|
||||
</state>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="heatingValve" advanced="true">
|
||||
<channel-type id="heatingValves" advanced="true">
|
||||
<item-type>String</item-type>
|
||||
<label>Heating Valve</label>
|
||||
<description>Heating Valve status (read only)</description>
|
||||
<label>Heating Valves</label>
|
||||
<description>Heating Valves status (read only)</description>
|
||||
<state readOnly="true">
|
||||
<options>
|
||||
<option value="OFF">OFF</option>
|
||||
@@ -144,10 +144,10 @@
|
||||
</state>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="actuator" advanced="true">
|
||||
<channel-type id="actuators" advanced="true">
|
||||
<item-type>String</item-type>
|
||||
<label>Actuator Status</label>
|
||||
<description>Actuator status (read only)</description>
|
||||
<label>Actuators Status</label>
|
||||
<description>Actuators status (read only)</description>
|
||||
<state readOnly="true">
|
||||
<options>
|
||||
<option value="OFF">OFF</option>
|
||||
|
||||
Reference in New Issue
Block a user