tschamm / boschshc-hass

Home Assistant component for accessing Bosch Smart Home Controller using boschshcpy python library.
Other
163 stars 24 forks source link

Set the room thermostate to cooling #70

Open PhilippF1992 opened 1 year ago

PhilippF1992 commented 1 year ago

Hi,

is it possible to set the room thermostat to cooling? Like in the native bosch app? When I read your code correctly, it supports 3 HVAC modes currently: Auto, Heating and Off. Can we add the option to set it to cooling or does the bosch-API not provide this?

If I am wrong and it is already present, can you please help me to find the proper setting?

Thanks in advance and all your effort to provide this custom component.

tschamm commented 1 year ago

I assume you are using the wall thermostat (THB or BWTH) and not the room thermostat (TRV or TRV_GEN2), correct? If you are able to set the room thermostat to cooling in the native Bosch App, this should be possible in principle. HA supports device modes for cooling as well as for heating. However, the cooling mode is normally controlled via the heating system and not via the wall thermostat.

PhilippF1992 commented 1 year ago

Sorry for my late response, I have missed the email.

You are right I am using the wall thermostat (230V, bwth) that is directly connected to the valve of the floor heating (water) for that room.

So it needs to reverse the function in the summer, when "current temperature" > "set temperature" it needs to open the valve, not keeping it close as it does in winter.

I am able to set this inside the Bosch app. But it gets overwritten by the "heating" command from HA.

Again, sorry for the late response and thank you for your time!

tschamm commented 1 year ago

Can you do a rawscan of your device and the associated services, so that I know which services need to be implemented? I only have a Thermostat here, which does not support cooling. For more information of rawscans, see https://github.com/tschamm/boschshcpy#command-line-access-to-shc

ccccompany commented 1 year ago

Hi tschamm, I'm not experienced in scripting and Home Assistant. I have no idea how to perform a rawscan. However, I also have the desire to switch from heating mode to cooling mode using Home Assistant. Is there any other way I can provide you with the requested information?

lgraf commented 1 year ago

I did a rawscan of one my RTH2_230 devices.

boschshc_rawscan device hdm:ZigBee:xxx
{
    "@type": "device",
    "rootDeviceId": "xx-yy-zz-11-22-33",
    "id": "hdm:ZigBee:xxx",
    "deviceServiceIds": [
        "CommunicationQuality",
        "Thermostat",
        "DisplayConfiguration",
        "TemperatureLevel",
        "TerminalConfiguration",
        "HumidityLevel",
        "WallThermostatConfiguration",
        "TemperatureOffset"
    ],
    "manufacturer": "BOSCH",
    "roomId": "hz_4",
    "deviceModel": "RTH2_230",
    "serial": "xxx",
    "profile": "GENERIC",
    "name": "Room thermostat II 230 V",
    "status": "AVAILABLE",
    "parentDeviceId": "roomClimateControl_hz_4",
    "childDeviceIds": []
}
boschshc_rawscan device_services hdm:ZigBee:xxx
[
    {
        "@type": "DeviceServiceData",
        "id": "TemperatureOffset",
        "deviceId": "hdm:ZigBee:xxx",
        "state": {
            "@type": "temperatureOffsetState",
            "offset": 0.0,
            "stepSize": 0.1,
            "minOffset": -5.0,
            "maxOffset": 5.0
        },
        "path": "/devices/hdm:ZigBee:xxx/services/TemperatureOffset"
    },
    {
        "@type": "DeviceServiceData",
        "id": "WallThermostatConfiguration",
        "deviceId": "hdm:ZigBee:xxx",
        "state": {
            "@type": "wallThermostatConfigurationState",
            "valveType": "NORMALLY_CLOSE",
            "heaterType": "FLOOR_HEATING",
            "supportedHeaterTypes": [
                "VOLT_FREE_HEATING",
                "FLOOR_HEATING"
            ]
        },
        "path": "/devices/hdm:ZigBee:xxx/services/WallThermostatConfiguration"
    },
    {
        "@type": "DeviceServiceData",
        "id": "Thermostat",
        "deviceId": "hdm:ZigBee:xxx",
        "state": {
            "@type": "childLockState",
            "childLock": "OFF"
        },
        "path": "/devices/hdm:ZigBee:xxx/services/Thermostat"
    },
    {
        "@type": "DeviceServiceData",
        "id": "TerminalConfiguration",
        "deviceId": "hdm:ZigBee:xxx",
        "state": {
            "@type": "terminalConfigurationState",
            "type": "NOT_CONNECTED",
            "supportedTypes": [
                "NOT_CONNECTED",
                "FLOOR_SENSOR_DISPLAYED",
                "OUTDOOR_SENSOR_CONNECTED",
                "FLOOR_SENSOR_DISPLAYED_AND_USED_FOR_REGULATION"
            ]
        },
        "path": "/devices/hdm:ZigBee:xxx/services/TerminalConfiguration"
    },
    {
        "@type": "DeviceServiceData",
        "id": "CommunicationQuality",
        "deviceId": "hdm:ZigBee:xxx",
        "state": {
            "@type": "communicationQualityState",
            "quality": "UNKNOWN"
        },
        "path": "/devices/hdm:ZigBee:xxx/services/CommunicationQuality"
    },
    {
        "@type": "DeviceServiceData",
        "id": "HumidityLevel",
        "deviceId": "hdm:ZigBee:xxx",
        "state": {
            "@type": "humidityLevelState",
            "humidity": 51.73
        },
        "path": "/devices/hdm:ZigBee:xxx/services/HumidityLevel"
    },
    {
        "@type": "DeviceServiceData",
        "id": "TemperatureLevel",
        "deviceId": "hdm:ZigBee:xxx",
        "state": {
            "@type": "temperatureLevelState",
            "temperature": 26.3
        },
        "path": "/devices/hdm:ZigBee:xxx/services/TemperatureLevel"
    },
    {
        "@type": "DeviceServiceData",
        "id": "DisplayConfiguration",
        "deviceId": "hdm:ZigBee:xxx",
        "state": {
            "@type": "displayConfigurationState",
            "displayBrightness": 70,
            "displayBrightnessMax": 100,
            "displayBrightnessMin": 10,
            "displayBrightnessStepSize": 10,
            "displayOnTime": 5,
            "displayOnTimeMax": 30,
            "displayOnTimeMin": 5,
            "displayOnTimeStepSize": 5
        },
        "path": "/devices/hdm:ZigBee:xxx/services/DisplayConfiguration"
    }

It looks like that the RTH2_230 device uses a parent device that is responsible for setting a control mode (OFF,HEATING,COOLING). The interesting bits should be the ThermostatSupportedControlMode service and the RoomClimateControl service (roomControlMode).

boschshc_rawscan device roomClimateControl_hz_4
{
    "@type": "device",
    "rootDeviceId": xx-yy-zz-11-22-33",
    "id": "roomClimateControl_hz_4",
    "deviceServiceIds": [
        "ThermostatSupportedControlMode",
        "TemperatureLevelConfiguration",
        "RoomClimateControl",
        "TemperatureLevel"
    ],
    "manufacturer": "BOSCH",
    "roomId": "hz_4",
    "deviceModel": "ROOM_CLIMATE_CONTROL",
    "serial": "roomClimateControl_hz_4",
    "iconId": "icon_room_living_room_rcc",
    "name": "-RoomClimateControl-",
    "status": "AVAILABLE",
    "childDeviceIds": [
        "hdm:ZigBee:xxx"
    ]
}
boschshc_rawscan device_services roomClimateControl_hz_4
[
    {
        "@type": "DeviceServiceData",
        "id": "ThermostatSupportedControlMode",
        "deviceId": "roomClimateControl_hz_4",
        "state": {
            "@type": "thermostatSupportedControlModeState",
            "supportedControlModes": [
                "COOLING",
                "OFF",
                "HEATING"
            ]
        },
        "path": "/devices/roomClimateControl_hz_4/services/ThermostatSupportedControlMode"
    },
    {
        "@type": "DeviceServiceData",
        "id": "TemperatureLevelConfiguration",
        "deviceId": "roomClimateControl_hz_4",
        "state": {
            "@type": "temperatureLevelConfigurationState",
            "sensors": [
                {
                    "deviceId": "hdm:ZigBee:xxx",
                    "active": true
                }
            ]
        },
        "path": "/devices/roomClimateControl_hz_4/services/TemperatureLevelConfiguration"
    },
    {
        "@type": "DeviceServiceData",
        "id": "RoomClimateControl",
        "deviceId": "roomClimateControl_hz_4",
        "state": {
            "@type": "climateControlState",
            "operationMode": "MANUAL",
            "setpointTemperature": 5.0,
            "setpointTemperatureForLevelEco": 17.0,
            "setpointTemperatureForLevelComfort": 21.0,
            "schedule": {
                "profiles": [
                    {
                        "day": "MONDAY",
                        "switchPoints": [
                            {
                                "startTimeMinutes": 0,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "ECO"
                                }
                            },
                            {
                                "startTimeMinutes": 360,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "COMFORT"
                                }
                            },
                            {
                                "startTimeMinutes": 480,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "ECO"
                                }
                            },
                            {
                                "startTimeMinutes": 960,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "COMFORT"
                                }
                            },
                            {
                                "startTimeMinutes": 1200,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "ECO"
                                }
                            }
                        ]
                    },
                    {
                        "day": "TUESDAY",
                        "switchPoints": [
                            {
                                "startTimeMinutes": 0,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "ECO"
                                }
                            },
                            {
                                "startTimeMinutes": 360,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "COMFORT"
                                }
                            },
                            {
                                "startTimeMinutes": 480,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "ECO"
                                }
                            },
                            {
                                "startTimeMinutes": 960,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "COMFORT"
                                }
                            },
                            {
                                "startTimeMinutes": 1200,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "ECO"
                                }
                            }
                        ]
                    },
                    {
                        "day": "WEDNESDAY",
                        "switchPoints": [
                            {
                                "startTimeMinutes": 0,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "ECO"
                                }
                            },
                            {
                                "startTimeMinutes": 360,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "COMFORT"
                                }
                            },
                            {
                                "startTimeMinutes": 480,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "ECO"
                                }
                            },
                            {
                                "startTimeMinutes": 960,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "COMFORT"
                                }
                            },
                            {
                                "startTimeMinutes": 1200,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "ECO"
                                }
                            }
                        ]
                    },
                    {
                        "day": "THURSDAY",
                        "switchPoints": [
                            {
                                "startTimeMinutes": 0,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "ECO"
                                }
                            },
                            {
                                "startTimeMinutes": 360,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "COMFORT"
                                }
                            },
                            {
                                "startTimeMinutes": 480,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "ECO"
                                }
                            },
                            {
                                "startTimeMinutes": 960,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "COMFORT"
                                }
                            },
                            {
                                "startTimeMinutes": 1200,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "ECO"
                                }
                            }
                        ]
                    },
                    {
                        "day": "FRIDAY",
                        "switchPoints": [
                            {
                                "startTimeMinutes": 0,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "ECO"
                                }
                            },
                            {
                                "startTimeMinutes": 360,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "COMFORT"
                                }
                            },
                            {
                                "startTimeMinutes": 480,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "ECO"
                                }
                            },
                            {
                                "startTimeMinutes": 960,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "COMFORT"
                                }
                            },
                            {
                                "startTimeMinutes": 1200,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "ECO"
                                }
                            }
                        ]
                    },
                    {
                        "day": "SATURDAY",
                        "switchPoints": [
                            {
                                "startTimeMinutes": 0,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "ECO"
                                }
                            },
                            {
                                "startTimeMinutes": 480,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "COMFORT"
                                }
                            },
                            {
                                "startTimeMinutes": 1200,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "ECO"
                                }
                            }
                        ]
                    },
                    {
                        "day": "SUNDAY",
                        "switchPoints": [
                            {
                                "startTimeMinutes": 0,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "ECO"
                                }
                            },
                            {
                                "startTimeMinutes": 480,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "COMFORT"
                                }
                            },
                            {
                                "startTimeMinutes": 1200,
                                "value": {
                                    "@type": "temperatureLevelSwitchPointValue",
                                    "temperatureLevel": "ECO"
                                }
                            }
                        ]
                    }
                ]
            },
            "ventilationMode": false,
            "low": false,
            "boostMode": false,
            "summerMode": true,
            "supportsBoostMode": false,
            "roomControlMode": "OFF"
        },
        "operations": [
            "incrementSetpointTemperature",
            "decrementSetpointTemperature"
        ],
        "path": "/devices/roomClimateControl_hz_4/services/RoomClimateControl"
    },
    {
        "@type": "DeviceServiceData",
        "id": "TemperatureLevel",
        "deviceId": "roomClimateControl_hz_4",
        "state": {
            "@type": "temperatureLevelState",
            "temperature": 26.3
        },
        "path": "/devices/roomClimateControl_hz_4/services/TemperatureLevel"
    }
]
tschamm commented 1 year ago

Thank you. This way I can extend the functionality.

jumlu commented 11 months ago

Hi @tschamm, I am also interested in that functionality. Is there any news on this? I would be also happy to support in getting the coding done, if you point me to the right direction.

romangerbers commented 11 months ago

Hi iam also using this thermostat and beside the cooling function I would love to see the following features

Thank you so much for the nice integration.

tschamm commented 11 months ago

Sorry I did not managed to integrate this until now. I will follow up on this. @romangerbers: Are these latter two features possible by using the official app? If not, I fear the API is not providing these infos. The temperature of the Room should be available after adding the room thermostate.

metallmanu commented 10 months ago

I am also very interessted in this. Also when I connect the thermostat directly with ZHA, this function is not possible yet

romangerbers commented 8 months ago

Sorry I did not managed to integrate this until now. I will follow up on this. @romangerbers: Are these latter two features possible by using the official app? If not, I fear the API is not providing these infos. The temperature of the Room should be available after adding the room thermostate.

@tschamm Thank you for your answer. the device can have two temperature sensors: one is build in and the other can be connected externally with a cable. The second sensor is used to directly measure the temperature of the floor. In the app I can see the temperature of the floor and I can configure if the build in or the external sensor should be used for control of temperature.

jengel84 commented 1 week ago

Hi @tschamm Even if summer is over, I am really interested in the cooling feature. Is there any way I can support you with this?

metallmanu commented 1 week ago

In ZigBee2MQTT it is now possible to cool

jengel84 commented 1 week ago

In ZigBee2MQTT it is now possible to cool

Thank you! That is great news.