diff --git a/bundles/org.openhab.binding.somfytahoma/README.md b/bundles/org.openhab.binding.somfytahoma/README.md index da905c186..689fc8453 100644 --- a/bundles/org.openhab.binding.somfytahoma/README.md +++ b/bundles/org.openhab.binding.somfytahoma/README.md @@ -147,6 +147,9 @@ Please see the example below. | hitachi (yutaki) air to water heating zone | yutaki_mode | actual mode of the heat pump (Eco, Comfort) | | hitachi (yutaki) air to water heating zone | yutaki_target_mode | sets the mode of the heat pump (Eco, Comfort) | | hitachi (yutaki) air to water heating zone | zone_mode | sets the zone mode (Auto, Manual) | +| hitachi (yutaki) air to water heating zone | thermostat_setting_zone1 | controls the thermostat setting for the zone 1 | +| hitachi (yutaki) air to water heating zone | wh_setting_temp_zone1 | controls the water heating setting temperature for the zone 1 | +| hitachi (yutaki) air to water heating zone | room_ambient_temp_zone1 | controls the room ambient temperature for the zone 1 | | hitachi (yutaki) domestic hot water | anti_legionella | controls the anti legionella mode (Run, Stop) | | hitachi (yutaki) domestic hot water | anti_legionella_temp | controls the anti legionella temperature | | hitachi (yutaki) domestic hot water | target_boost_mode | controls the boost mode (No request, Enabled, Disabled) | diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/SomfyTahomaBindingConstants.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/SomfyTahomaBindingConstants.java index 5f5d19fbd..6e0d68b38 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/SomfyTahomaBindingConstants.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/SomfyTahomaBindingConstants.java @@ -321,6 +321,9 @@ public class SomfyTahomaBindingConstants { public static final String YUTAKI_TARGET_MODE = "yutaki_target_mode"; public static final String YUTAKI_MODE = "yutaki_mode"; public static final String HOLIDAY_MODE = "holiday_mode"; + public static final String THERMOSTAT_SETTING_ZONE1 = "thermostat_setting_zone1"; + public static final String WH_SETTING_TEMP_ZONE1 = "wh_setting_temp_zone1"; + public static final String ROOM_AMBIENT_TEMP_ZONE1 = "room_ambient_temp_zone1"; // Hitachi Air To Water Main Component public static final String AUTO_MANU_MODE = "auto_manu_mode"; diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaBaseThingHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaBaseThingHandler.java index 7e2e546f4..eedf9abd7 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaBaseThingHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaBaseThingHandler.java @@ -182,6 +182,16 @@ public abstract class SomfyTahomaBaseThingHandler extends BaseThingHandler { } } + protected void sendTempCommand(String cmd, Command command) { + if (command instanceof DecimalType || command instanceof QuantityType) { + BigDecimal temperature = toTemperature(command); + if (temperature != null) { + String param = "[" + temperature.toPlainString() + "]"; + sendCommand(cmd, param); + } + } + } + protected void sendCommandToSameDevicesInPlace(String cmd) { sendCommandToSameDevicesInPlace(cmd, "[]"); } diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaHitachiATWHZHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaHitachiATWHZHandler.java index 36488083b..a54785225 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaHitachiATWHZHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaHitachiATWHZHandler.java @@ -39,6 +39,9 @@ public class SomfyTahomaHitachiATWHZHandler extends SomfyTahomaBaseThingHandler stateNames.put(YUTAKI_MODE, "modbus:YutakiModeState"); stateNames.put(HOLIDAY_MODE, "modbus:HolidayModeZone1State"); stateNames.put(ALARM_NUMBER, "modbus:AlarmNumberState"); + stateNames.put(THERMOSTAT_SETTING_ZONE1, "modbus:ThermostatSettingStatusZone1State"); + stateNames.put(WH_SETTING_TEMP_ZONE1, "modbus:WaterHeatingSettingTemperatureStatusZone1State"); + stateNames.put(ROOM_AMBIENT_TEMP_ZONE1, "modbus:RoomAmbientTemperatureStatusZone1State"); } @Override @@ -47,25 +50,38 @@ public class SomfyTahomaHitachiATWHZHandler extends SomfyTahomaBaseThingHandler if (command instanceof RefreshType) { return; } else { - if (command instanceof StringType) { - switch (channelUID.getId()) { - case ZONE_MODE: + switch (channelUID.getId()) { + case ZONE_MODE: + if (command instanceof StringType) { sendCommand("setAutoManuMode", "[\"" + command + "\"]"); - break; - case CIRCUIT_CONTROL: + } + break; + case CIRCUIT_CONTROL: + if (command instanceof StringType) { sendCommand("setControlCircuit1", "[\"" + command + "\"]"); - break; - case YUTAKI_TARGET_MODE: + } + break; + case YUTAKI_TARGET_MODE: + if (command instanceof StringType) { sendCommand("setTargetMode", "[\"" + command + "\"]"); - break; - case HOLIDAY_MODE: + } + break; + case HOLIDAY_MODE: + if (command instanceof StringType) { sendCommand("setHolidayMode", "[\"" + command + "\"]"); - break; - default: - getLogger().debug("This channel doesn't accept any commands"); - } - } else { - getLogger().debug("This thing accepts only String commands"); + } + break; + case THERMOSTAT_SETTING_ZONE1: + sendTempCommand("setThermostatSettingControlZone1", command); + break; + case WH_SETTING_TEMP_ZONE1: + sendTempCommand("setWaterHeatingSettingTemperatureControlZone1", command); + break; + case ROOM_AMBIENT_TEMP_ZONE1: + sendTempCommand("setRoomAmbientTemperatureControlZone1", command); + break; + default: + getLogger().debug("This channel doesn't accept any commands"); } } } diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaHitachiATWMCHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaHitachiATWMCHandler.java index 41332bd2a..1020141cc 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaHitachiATWMCHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaHitachiATWMCHandler.java @@ -14,11 +14,7 @@ package org.openhab.binding.somfytahoma.internal.handler; import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; -import java.math.BigDecimal; - import org.eclipse.jdt.annotation.NonNullByDefault; -import org.openhab.core.library.types.DecimalType; -import org.openhab.core.library.types.QuantityType; import org.openhab.core.library.types.StringType; import org.openhab.core.thing.ChannelUID; import org.openhab.core.thing.Thing; @@ -53,6 +49,8 @@ public class SomfyTahomaHitachiATWMCHandler extends SomfyTahomaBaseThingHandler stateNames.put(LIQUID_TEMP_THMI, "modbus:LiquidTemperatureTHMIState"); stateNames.put(LIQUID_TEMP, "modbus:LiquidTemperatureState"); stateNames.put(COMPRESSOR_RUNNING_CURRENT, "modbus:CompressorRunningCurrentState"); + // override state type because the cloud sends consumption in percent + cacheStateType(COMPRESSOR_RUNNING_CURRENT, TYPE_DECIMAL); stateNames.put(WATER_TEMP_SETTING, "modbus:WaterTemperatureSettingState"); stateNames.put(YUTAKI_OPERATING_MODE, "modbus:YutakiVirtualOperatingModeState"); stateNames.put(ALARM_NUMBER, "modbus:AlarmNumberState"); @@ -98,14 +96,4 @@ public class SomfyTahomaHitachiATWMCHandler extends SomfyTahomaBaseThingHandler } } } - - private void sendTempCommand(String cmd, Command command) { - if (command instanceof DecimalType || command instanceof QuantityType) { - BigDecimal temperature = toTemperature(command); - if (temperature != null) { - String param = "[" + temperature.toPlainString() + "]"; - sendCommand(cmd, param); - } - } - } } diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaHitachiDHWHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaHitachiDHWHandler.java index ae5f829cc..0c2f44957 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaHitachiDHWHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaHitachiDHWHandler.java @@ -14,11 +14,7 @@ package org.openhab.binding.somfytahoma.internal.handler; import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; -import java.math.BigDecimal; - import org.eclipse.jdt.annotation.NonNullByDefault; -import org.openhab.core.library.types.DecimalType; -import org.openhab.core.library.types.QuantityType; import org.openhab.core.library.types.StringType; import org.openhab.core.thing.ChannelUID; import org.openhab.core.thing.Thing; @@ -85,14 +81,4 @@ public class SomfyTahomaHitachiDHWHandler extends SomfyTahomaBaseThingHandler { } } } - - private void sendTempCommand(String cmd, Command command) { - if (command instanceof DecimalType || command instanceof QuantityType) { - BigDecimal temperature = toTemperature(command); - if (temperature != null) { - String param = "[" + temperature.toPlainString() + "]"; - sendCommand(cmd, param); - } - } - } } diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/i18n/somfytahoma.properties b/bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/i18n/somfytahoma.properties index 3f6fa5681..d0ee641ec 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/i18n/somfytahoma.properties +++ b/bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/i18n/somfytahoma.properties @@ -283,6 +283,8 @@ channel-type.somfytahoma.radio_battery.label = Radio Part Battery State channel-type.somfytahoma.radio_battery.description = State of the radio part of the Somfy sensor channel-type.somfytahoma.rocker.label = Rocker Position channel-type.somfytahoma.rocker.description = A channel for controlling the rocker position +channel-type.somfytahoma.room_ambient_temp_zone1.label = Zone 1 Room Ambient Temperature +channel-type.somfytahoma.room_ambient_temp_zone1.description = Room ambient temperature control for the zone 1 channel-type.somfytahoma.rssi.label = RSSI channel-type.somfytahoma.rssi.description = Relative received signal strength state channel-type.somfytahoma.scenarios.label = Scenarios @@ -325,6 +327,8 @@ channel-type.somfytahoma.target_temperature.label = Target Temperature channel-type.somfytahoma.target_temperature.description = The target temperature of the heating system channel-type.somfytahoma.temperature.label = Temperature channel-type.somfytahoma.temperature.description = The temperature value of the sensor +channel-type.somfytahoma.thermostat_setting_zone1.label = Zone 1 Thermostat Setting +channel-type.somfytahoma.thermostat_setting_zone1.description = Thermostat setting control for the zone 1 channel-type.somfytahoma.unit_control.label = Unit Control channel-type.somfytahoma.unit_control.description = Unit control channel-type.somfytahoma.unit_control.state.option.run = Run @@ -350,6 +354,8 @@ channel-type.somfytahoma.water_outlet_temp.label = Water Outlet Temperature channel-type.somfytahoma.water_outlet_temp.description = Water outlet temperature state channel-type.somfytahoma.water_temp_setting.label = Water Temperature Setting channel-type.somfytahoma.water_temp_setting.description = Water temperature setting state +channel-type.somfytahoma.wh_setting_temp_zone1.label = Zone 1 Water Heating Setting Temperature +channel-type.somfytahoma.wh_setting_temp_zone1.description = Water heating setting temperature control for the zone 1 channel-type.somfytahoma.yutaki_boost_mode.label = Boost Mode channel-type.somfytahoma.yutaki_boost_mode.description = Boost mode state channel-type.somfytahoma.yutaki_boost_mode.state.option.enabled = Enabled diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/thing/channels.xml b/bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/thing/channels.xml index 7fc6d686e..448d1b930 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/thing/channels.xml @@ -810,6 +810,27 @@ + + Number:Temperature + + Thermostat setting control for the zone 1 + + + + + Number:Temperature + + Water heating setting temperature control for the zone 1 + + + + + Number:Temperature + + Room ambient temperature control for the zone 1 + + + String diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/thing/hitachiatwhz.xml b/bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/thing/hitachiatwhz.xml index ed55d3ac0..99c21b143 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/thing/hitachiatwhz.xml +++ b/bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/thing/hitachiatwhz.xml @@ -17,6 +17,9 @@ + + + url