]> git.basschouten.com Git - openhab-addons.git/commitdiff
[somfytahoma] improvements for the Hitachi air to water heating system (#12612)
authorOndrej Pecta <opecta@gmail.com>
Sun, 17 Apr 2022 18:22:37 +0000 (20:22 +0200)
committerGitHub <noreply@github.com>
Sun, 17 Apr 2022 18:22:37 +0000 (20:22 +0200)
Signed-off-by: Ondrej Pecta <opecta@gmail.com>
bundles/org.openhab.binding.somfytahoma/README.md
bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/SomfyTahomaBindingConstants.java
bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaBaseThingHandler.java
bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaHitachiATWHZHandler.java
bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaHitachiATWMCHandler.java
bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaHitachiDHWHandler.java
bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/i18n/somfytahoma.properties
bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/thing/channels.xml
bundles/org.openhab.binding.somfytahoma/src/main/resources/OH-INF/thing/hitachiatwhz.xml

index da905c186f5744591bfad63604b2bb0e1eff7927..689fc84539aa871b8701f97ad89e0225f50cc935 100644 (file)
@@ -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)                                                                                                                                                                           |
index 5f5d19fbd1838d6c4b7661ab8eca13da1c915f5b..6e0d68b382473f1572187da07248290f43db2c83 100644 (file)
@@ -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";
index 7e2e546f42521646b528e03329a7990962b2d37a..eedf9abd76ad13b24f2c4c29077678cb94dbbc32 100644 (file)
@@ -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, "[]");
     }
index 36488083b2b82603c5cbfdd2bb95c0299f99e772..a547852251795f824ffc55dd6f7c9e50efd212ab 100644 (file)
@@ -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");
             }
         }
     }
index 41332bd2a544fb8c07b70a3fa55b37db09a3bc40..1020141ccd979fdb623dc97b09924d4d5ade4323 100644 (file)
@@ -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);
-            }
-        }
-    }
 }
index ae5f829ccf14c3a226ef947615fa8096b8c5fa95..0c2f4495705dde73f8558814be4b661c912a9937 100644 (file)
@@ -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);
-            }
-        }
-    }
 }
index 3f6fa5681bc93649a2b0d27d86a3180ec3c9164d..d0ee641ec1c940ba0929b18a863e180901a7dcbe 100644 (file)
@@ -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
index 7fc6d686ec6a3bad2bb793f88baf27b5011aaf23..448d1b9302465ed53a497926ef8f5519e4673b37 100644 (file)
                <state pattern="%d %unit%" readOnly="true"></state>
        </channel-type>
 
+       <channel-type id="thermostat_setting_zone1">
+               <item-type>Number:Temperature</item-type>
+               <label>Zone 1 Thermostat Setting</label>
+               <description>Thermostat setting control for the zone 1</description>
+               <state pattern="%d %unit%"></state>
+       </channel-type>
+
+       <channel-type id="wh_setting_temp_zone1">
+               <item-type>Number:Temperature</item-type>
+               <label>Zone 1 Water Heating Setting Temperature</label>
+               <description>Water heating setting temperature control for the zone 1</description>
+               <state pattern="%d %unit%"></state>
+       </channel-type>
+
+       <channel-type id="room_ambient_temp_zone1">
+               <item-type>Number:Temperature</item-type>
+               <label>Zone 1 Room Ambient Temperature</label>
+               <description>Room ambient temperature control for the zone 1</description>
+               <state pattern="%d %unit%"></state>
+       </channel-type>
+
        <channel-type id="yutaki_operating_mode">
                <item-type>String</item-type>
                <label>Yutaki Operating Mode</label>
index ed55d3ac0d7b8c36bab7ac6ed24789f4250f6b29..99c21b143eba5843d7a4f43250b18c8d1659626a 100644 (file)
@@ -17,6 +17,9 @@
                        <channel id="yutaki_mode" typeId="yutaki_mode"></channel>
                        <channel id="holiday_mode" typeId="holiday_mode"></channel>
                        <channel id="alarm_number" typeId="alarm_number"></channel>
+                       <channel id="thermostat_setting_zone1" typeId="thermostat_setting_zone1"></channel>
+                       <channel id="wh_setting_temp_zone1" typeId="wh_setting_temp_zone1"></channel>
+                       <channel id="room_ambient_temp_zone1" typeId="room_ambient_temp_zone1"></channel>
                </channels>
                <representation-property>url</representation-property>
                <config-description-ref uri="thing-type:somfytahoma:device"/>