Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Device Support Request] Full implementation of BOSCH Radiator Thermostat II (BTH-RA) #2476

Open
dierochade opened this issue Jul 15, 2023 · 71 comments · May be fixed by #2808
Open

[Device Support Request] Full implementation of BOSCH Radiator Thermostat II (BTH-RA) #2476

dierochade opened this issue Jul 15, 2023 · 71 comments · May be fixed by #2808
Labels
device support request This requests support for a new device

Comments

@dierochade
Copy link

dierochade commented Jul 15, 2023

Problem description

I use skyconnect+zha.
I am able to pair the device using zha.permit with install code and source-ieee.

It then shows up with 4 entitys:

(screenshot below)

  1. [button.bosch_rbsh_trv0_zb_eu_identify]

     BOSCH RBSH-TRV0-ZB-EU Identify
     unknown	device_class: identify
     friendly_name: BOSCH RBSH-TRV0-ZB-EU Identify
    
  2. [climate.bosch_rbsh_trv0_zb_eu_thermostat]

     BOSCH RBSH-TRV0-ZB-EU Thermostat
     heat	hvac_modes: off, heat
     min_temp: 5
     max_temp: 30
     current_temperature: 24.6
     temperature: 21
     system_mode: [<SystemMode.Heat: 4>]/heat
     occupied_cooling_setpoint: 2300
     occupied_heating_setpoint: 2100
     friendly_name: BOSCH RBSH-TRV0-ZB-EU Thermostat
     supported_features: 1
    
  3. [sensor.bosch_rbsh_trv0_zb_eu_battery]

     BOSCH RBSH-TRV0-ZB-EU Battery
     100	state_class: measurement
     battery_voltage: 3.1
     unit_of_measurement: %
     device_class: battery
     friendly_name: BOSCH RBSH-TRV0-ZB-EU Battery
    
  4. [sensor.bosch_rbsh_trv0_zb_eu_hvac_action]

     BOSCH RBSH-TRV0-ZB-EU HVAC action
     unknown	friendly_name: BOSCH RBSH-TRV0-ZB-EU HVAC action
    

I have got two main issues:

  1. The state of climate.bosch entity is always "heating". If I change the target temparature I can hear the motor of the device closing/opening the valve, but it doesnt change the state.
    If I do set the state manually in the developer tools, it changes but switches back after some seconds.
    Besides, the HVAC action (entity 4) is shown as "unknown" all the time.

  2. Most attributes are missing

From the integration via z2m it is known that there are many more attributes, some are importat/useful:

window open, boost, position of the valve, temperature offset, disabling of internal temp sensor, many more ++

As far as I understand, these attributes can be manipulated via a set command in z2m....

Additional wish

The device got a nice led color ring that can show status. I do not know if the led can be manipulated or is controlled locally by the device solely?

Solution description

Quirk?

Screenshots/Video

Screenshots/Video

FireShot Capture 072 - Developer Tools – Home Assistant - 192 168 100 56

Device signature

Device signature
{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4617, maximum_buffer_size=127, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)",
  "endpoints": {
    "1": {
      "profile_id": "0x0104",
      "device_type": "0x0301",
      "input_clusters": [
        "0x0000",
        "0x0001",
        "0x0003",
        "0x0004",
        "0x0020",
        "0x0201",
        "0x0204",
        "0x0b05"
      ],
      "output_clusters": [
        "0x000a",
        "0x0019"
      ]
    }
  },
  "manufacturer": "BOSCH",
  "model": "RBSH-TRV0-ZB-EU",
  "class": "zigpy.device.Device"
}

Diagnostic information

Diagnostic information
{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2023.7.1",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.11.4",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Berlin",
    "os_name": "Linux",
    "os_version": "6.1.34",
    "supervisor": "2023.07.1",
    "host_os": "Home Assistant OS 10.3",
    "docker_version": "23.0.6",
    "chassis": "vm",
    "run_as_root": true
  },
  "custom_components": {
    "dreame_vacuum": {
      "version": "v0.16.4",
      "requirements": [
        "pillow",
        "numpy",
        "pybase64",
        "requests",
        "pycryptodome",
        "python-miio>=0.5.6",
        "py-mini-racer"
      ]
    },
    "hacs": {
      "version": "1.32.1",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "nodered": {
      "version": "1.2.0",
      "requirements": []
    }
  },
  "integration_manifest": {
    "domain": "zha",
    "name": "Zigbee Home Automation",
    "after_dependencies": [
      "onboarding",
      "usb"
    ],
    "codeowners": [
      "@dmulcahey",
      "@adminiuga",
      "@puddly"
    ],
    "config_flow": true,
    "dependencies": [
      "file_upload"
    ],
    "documentation": "https://www.home-assistant.io/integrations/zha",
    "iot_class": "local_polling",
    "loggers": [
      "aiosqlite",
      "bellows",
      "crccheck",
      "pure_pcapy3",
      "zhaquirks",
      "zigpy",
      "zigpy_deconz",
      "zigpy_xbee",
      "zigpy_zigate",
      "zigpy_znp"
    ],
    "requirements": [
      "bellows==0.35.8",
      "pyserial==3.5",
      "pyserial-asyncio==0.6",
      "zha-quirks==0.0.101",
      "zigpy-deconz==0.21.0",
      "zigpy==0.56.1",
      "zigpy-xbee==0.18.1",
      "zigpy-zigate==0.11.0",
      "zigpy-znp==0.11.2"
    ],
    "usb": [
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*2652*",
        "known_devices": [
          "slae.sh cc2652rb stick"
        ]
      },
      {
        "vid": "1A86",
        "pid": "55D4",
        "description": "*sonoff*plus*",
        "known_devices": [
          "sonoff zigbee dongle plus v2"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*sonoff*plus*",
        "known_devices": [
          "sonoff zigbee dongle plus"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*tubeszb*",
        "known_devices": [
          "TubesZB Coordinator"
        ]
      },
      {
        "vid": "1A86",
        "pid": "7523",
        "description": "*tubeszb*",
        "known_devices": [
          "TubesZB Coordinator"
        ]
      },
      {
        "vid": "1A86",
        "pid": "7523",
        "description": "*zigstar*",
        "known_devices": [
          "ZigStar Coordinators"
        ]
      },
      {
        "vid": "1CF1",
        "pid": "0030",
        "description": "*conbee*",
        "known_devices": [
          "Conbee II"
        ]
      },
      {
        "vid": "10C4",
        "pid": "8A2A",
        "description": "*zigbee*",
        "known_devices": [
          "Nortek HUSBZB-1"
        ]
      },
      {
        "vid": "0403",
        "pid": "6015",
        "description": "*zigate*",
        "known_devices": [
          "ZiGate+"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*zigate*",
        "known_devices": [
          "ZiGate"
        ]
      },
      {
        "vid": "10C4",
        "pid": "8B34",
        "description": "*bv 2010/10*",
        "known_devices": [
          "Bitron Video AV2010/10"
        ]
      }
    ],
    "zeroconf": [
      {
        "type": "_esphomelib._tcp.local.",
        "name": "tube*"
      },
      {
        "type": "_zigate-zigbee-gateway._tcp.local.",
        "name": "*zigate*"
      },
      {
        "type": "_zigstar_gw._tcp.local.",
        "name": "*zigstar*"
      },
      {
        "type": "_slzb-06._tcp.local.",
        "name": "slzb-06*"
      }
    ],
    "is_built_in": true
  },
  "data": {
    "ieee": "**REDACTED**",
    "nwk": 59249,
    "manufacturer": "BOSCH",
    "model": "RBSH-TRV0-ZB-EU",
    "name": "BOSCH RBSH-TRV0-ZB-EU",
    "quirk_applied": false,
    "quirk_class": "zigpy.device.Device",
    "manufacturer_code": 4617,
    "power_source": "Battery or Unknown",
    "lqi": 255,
    "rssi": -63,
    "last_seen": "2023-07-15T08:31:40",
    "available": true,
    "device_type": "EndDevice",
    "signature": {
      "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4617, maximum_buffer_size=127, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)",
      "endpoints": {
        "1": {
          "profile_id": "0x0104",
          "device_type": "0x0301",
          "input_clusters": [
            "0x0000",
            "0x0001",
            "0x0003",
            "0x0004",
            "0x0020",
            "0x0201",
            "0x0204",
            "0x0b05"
          ],
          "output_clusters": [
            "0x000a",
            "0x0019"
          ]
        }
      },
      "manufacturer": "BOSCH",
      "model": "RBSH-TRV0-ZB-EU"
    },
    "active_coordinator": false,
    "entities": [
      {
        "entity_id": "button.bosch_rbsh_trv0_zb_eu_identify",
        "name": "BOSCH RBSH-TRV0-ZB-EU"
      },
      {
        "entity_id": "climate.bosch_rbsh_trv0_zb_eu_thermostat",
        "name": "BOSCH RBSH-TRV0-ZB-EU"
      },
      {
        "entity_id": "sensor.bosch_rbsh_trv0_zb_eu_battery",
        "name": "BOSCH RBSH-TRV0-ZB-EU"
      },
      {
        "entity_id": "sensor.bosch_rbsh_trv0_zb_eu_hvac_action",
        "name": "BOSCH RBSH-TRV0-ZB-EU"
      }
    ],
    "neighbors": [],
    "routes": [],
    "endpoint_names": [
      {
        "name": "THERMOSTAT"
      }
    ],
    "user_given_name": null,
    "device_reg_id": "8a705142eda33efd541b5bdceb7ac9c7",
    "area_id": null,
    "cluster_details": {
      "1": {
        "device_type": {
          "name": "THERMOSTAT",
          "id": 769
        },
        "profile_id": 260,
        "in_clusters": {
          "0x0000": {
            "endpoint_attribute": "basic",
            "attributes": {
              "0x0004": {
                "attribute_name": "manufacturer",
                "value": "BOSCH"
              },
              "0x0005": {
                "attribute_name": "model",
                "value": "RBSH-TRV0-ZB-EU"
              }
            },
            "unsupported_attributes": {}
          },
          "0x0001": {
            "endpoint_attribute": "power",
            "attributes": {
              "0x0021": {
                "attribute_name": "battery_percentage_remaining",
                "value": 200
              },
              "0x0020": {
                "attribute_name": "battery_voltage",
                "value": 31
              }
            },
            "unsupported_attributes": {}
          },
          "0x0003": {
            "endpoint_attribute": "identify",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0004": {
            "endpoint_attribute": "groups",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0020": {
            "endpoint_attribute": "poll_control",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0201": {
            "endpoint_attribute": "thermostat",
            "attributes": {
              "0x001b": {
                "attribute_name": "ctrl_sequence_of_oper",
                "value": 2
              },
              "0x0000": {
                "attribute_name": "local_temperature",
                "value": 2480
              },
              "0x0016": {
                "attribute_name": "max_heat_setpoint_limit",
                "value": 3000
              },
              "0x0015": {
                "attribute_name": "min_heat_setpoint_limit",
                "value": 500
              },
              "0x0011": {
                "attribute_name": "occupied_cooling_setpoint",
                "value": 2300
              },
              "0x0012": {
                "attribute_name": "occupied_heating_setpoint",
                "value": 2100
              },
              "0x001c": {
                "attribute_name": "system_mode",
                "value": 4
              }
            },
            "unsupported_attributes": {
              "0x0002": {
                "attribute_name": "occupancy"
              },
              "0x0003": {
                "attribute_name": "abs_min_heat_setpoint_limit"
              },
              "0x0004": {
                "attribute_name": "abs_max_heat_setpoint_limit"
              },
              "0x0005": {
                "attribute_name": "abs_min_cool_setpoint_limit"
              },
              "0x0007": {
                "attribute_name": "pi_cooling_demand"
              },
              "0x0008": {
                "attribute_name": "pi_heating_demand"
              },
              "0x0006": {
                "attribute_name": "abs_max_cool_setpoint_limit"
              },
              "0x001e": {
                "attribute_name": "running_mode"
              },
              "0x0013": {
                "attribute_name": "unoccupied_cooling_setpoint"
              },
              "0x0014": {
                "attribute_name": "unoccupied_heating_setpoint"
              },
              "0x0029": {
                "attribute_name": "running_state"
              },
              "0x0017": {
                "attribute_name": "min_cool_setpoint_limit"
              },
              "0x0018": {
                "attribute_name": "max_cool_setpoint_limit"
              }
            }
          },
          "0x0204": {
            "endpoint_attribute": "thermostat_ui",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0b05": {
            "endpoint_attribute": "diagnostic",
            "attributes": {},
            "unsupported_attributes": {}
          }
        },
        "out_clusters": {
          "0x000a": {
            "endpoint_attribute": "time",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0019": {
            "endpoint_attribute": "ota",
            "attributes": {},
            "unsupported_attributes": {}
          }
        }
      }
    }
  }
}

Additional information

https://www.zigbee2mqtt.io/devices/BTH-RA.html

Koenkk/zigbee2mqtt#14926

https://zigbee.blakadder.com/Bosch_BTH-RA.html

@pdsccode
Copy link

pdsccode commented Oct 7, 2023

After finally switching to a SkyConnect, I want to ditch my Bosch SHC but without a working quirk, I cannot fully control the thermostat.

Please prioritize this. If needed, I might be able to provide neccessary information about the device.

@Samueras
Copy link

Same from me, If Information are neede, I'm happy to help, for the Bosh Thermostat 2 and the BOSCH Smart Home Roomthermostat

@JohndeWaal
Copy link

I tried to connect the BOSCH Radiator Thermostat II today. On multiple attempts it connects each time, but most times without any entities. It only connected once with entities (battery 100% HVAC), but they didn't work.

@Samueras
Copy link

It worked for me. What you do is first you use the zha.permit zu give it the adress and installcode that is inside the battery lid. That you need to go in HA to adding new Zigbee devices. Then you reset the Themostat. (Hold the button while insterting the batteries till it blinks orrange.) Lastly press the button ont the thermostat once more so it enters pairing mode.

@JohndeWaal
Copy link

It worked for me. What you do is first you use the zha.permit zu give it the adress and installcode that is inside the battery lid. That you need to go in HA to adding new Zigbee devices. Then you reset the Themostat. (Hold the button while insterting the batteries till it blinks orrange.) Lastly press the button ont the thermostat once more so it enters pairing mode.

Did this each time. I’ve got 53 working zigbee devices, but this one isn’t working. I bought it to replace a Tuya thermostat, even that worked okay (only battery drained every 2 months).
I ordered a Bosch controller now, hope it works with Home Assistant.

@Samueras
Copy link

I actually want to move awy from bosh for the don't hold the Set temperatur but hat up and cool down for about 2 degree all the time
Screenshot_20231021_204113_Home Assistant

@ulrichkamp61
Copy link

ulrichkamp61 commented Oct 24, 2023

they don't hold the Set temperatur but hat up and cool down for about 2 degree all the time

Same for me, it only holds the temperature, when I frequently update the Set temperature, which is Occupied heating setpoint.

Also, the Z2MTT dialog says for element Remote temperature -> Setting this will disable the internal temperature sensor until batteries are removed!, which is not right. I can always change the Remote temperature, and as far as I understood, this setting interferes with the heating mode and with the Set temperature. But I do not yet understand the behavior fully.

With some tricks (setting up the thermostat target values about every 30 minutes reflecting the room temperature as needed) I got the thermostat working for me, but it is not very handy and intuitive.

So, it seems there are some small bugs in the Bosch Thermostat Z2MTT implementation. I also could help with screenshots, experiences and I can support with testing.

@dierochade
Copy link
Author

dierochade commented Oct 26, 2023

@Samueras @ulrichkamp61 @EverybodyElse

Regarding the overshooting temperature: I believe this is intentional, to compensate that close to the heater the temp will rise very fast but not in the rest of the room. I have some trv's with external sensors that do not show this kind of wave overshooting the limit set.

regarding the remote temp: As far as i can see, home assistant tracks "remote" and "current" temperature, but it is the same value all the time. So current is just mirroring remote values. I have not tried to deactivate the remote temp (because it will just keep the last state forever till reboot of home assistant), but it might end in mirroring an unavailable state - and the documentation on z2m means you have to reset the trv to enable local measurement again?

I run these trvs on z2m now, which works as expected. But there is major setback in my installation: The device (without hub) has a build in schedule that cannot be wiped (as i do not know how, at least). this would be annoying but could be overcome with a simple time based automation. but it calls this in-device temperature target also every time when switched to auto mode… This has nothing to do with zigbee but the firmware itself.
I was able to fix this in node red, but it is a real pain…

For any one interested, I made a rather big flow in node red (based on z2m) with this key capabilities:

  • workaround to overwrite built in target temps schedule of the device
  • run different schedules for workday and holiday (ha integration) with a 15 min schedule (manual timetables with array of targettemps though)
  • ability to change temperatures (triggered by external event/manual switch) specified trv and time(range), e.g. heat now for x hours, -heat guest room today, heat living room this evening etc
  • block schedule for single trv after manual change for a given period of time (e.g. 90 min) to prevent imminent overwrite.
  • boost functionality up to 30 mins (6*5 min)
  • away mode
  • window sensor
  • external temp sensor
  • display brightness auto dim at night
  • lovelace interface (incomplete, cause i still think how to best use the ability to change temperatures)

I would be interested in collaboration and further joint development, although it is still work in progress and documentation limited..just pm me

@jclsn
Copy link
Contributor

jclsn commented Nov 6, 2023

Here is all the relevant information I could gather. Maybe OTA would also be relevant for updates, but the endpoint is quite complicated.

I will start writing a quirk this week. This thermostat deserves full support!

Signature:

{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4617, maximum_buffer_size=127, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)",
  "endpoints": {
    "1": {
      "profile_id": "0x0104",
      "device_type": "0x0301",
      "input_clusters": [
        "0x0000",
        "0x0001",
        "0x0003",
        "0x0004",
        "0x0020",
        "0x0201",
        "0x0204",
        "0x0b05"
      ],
      "output_clusters": [
        "0x000a",
        "0x0019"
      ]
    }
  },
  "manufacturer": "BOSCH",
  "model": "RBSH-TRV0-ZB-EU",
  "class": "zigpy.device.Device"
}

Endpoints:

	Basic:
		manufacturer: BOSCH
		model: RBSH-TRV0-ZB-EU
		generic_device_class: GenericDeviceClass.Lighting ???
		generic_device_type: GenericDeviceType.LightBulb ???


	Thermostat (Endpoint id: 1, Id: 0x0201, Type: in)

	Attributes:
		ctrl_sequence_of_oper (id: 0x001b)
			values:
				- ControlSequenceOfOperation.Heating_Only
				- ControlSequenceOfOperation.Heating_With_Reheat
				- ControlSequenceOfOperation.Cooling_Only
				- ControlSequenceOfOperation.Cooling_With_Reheat

		local_temperature (id: 0x0000) 
			read-only: yes
			format: 2050 (20.5°)

		local_temperature_calibration (id: 0x0010) 
			read-only: no
			format: 25 (2.5°)
			range: -50 to 50

		max_heat_setpoint_limit (id: 0x0016)
			read-only: no
			format : 500 (5°)
			range: 500 - 3000

		min_heat_setpoint_limit (id: 0x0015)
			read-only: no
			format : 500 (5°)
			range: 500 - 3000

		number_of_daily_transitions (id: 0x0022)
			read-only: yes
			format: integers
			
		number_of_weekly_transitions (id: 0x0021)
			read-only: yes
			format: integers

		occupied_cooling_setpoint (id: 0x0011)
			read-only: no
			format : 500 (5°)
			range: 500 - 3000

		occupied_heating_setpoint (id: 0x0012)
			read-only: no
			format : 500 (5°)
			range: 500 - 3000


		setpoint_change_source (id: 0x0030)
			read-only: yes
			values: 
				- SetpointChangeSource.External
				- SetpointChangeSource.Schedule

		start_of_week (id: 0x0020)
			read-only: yes
			values: 
				- StartOfWeek.Monday
				- StartOfWeek.Tuesday
				- StartOfWeek.Wednesday
				- StartOfWeek.Thursday
				- StartOfWeek.Friday
				- StartOfWeek.Saturday
				- StartOfWeek.Sunday

		system_mode (id: 0x001c)
			read-only: no
			values:
				- SystemMode.Heat
				- SystemMode.Cool

	Commands:
		clear_weekly_schedule (id: 0x0003)

	PowerConfiguration (Endpoint id: 1, Id: 0x0001, Type: in)

		battery_alarm_mask (id: 0x0035)
			read-only: no
			format: integer
			values:
				- 1
				- 0
			
		battery_alarm_mask (id: 0x003e)
			read-only: yes
			format: integer

		battery_percentage_remaining (id: 0x0021)
			read-only: yes
			format: integer

		battery_quantity (id: 0x0033)
			read-only: yes
			value: 2

		battery_size (id: 0x0031)
			read-only: yes
			value: BatterySize.AA

		battery_volt_min_thres (id: 0x0036)
			read-only: yes
			value: 22

		battery_volt_min_thres (id: 0x0036)
			read-only: yes
			value: 22

		battery_volt_thres1 (id: 0x0037)
			read-only: yes
			value: 23

		battery_volt_thres2 (id: 0x0038)
			read-only: yes
			value: 27

		battery_volt_thres3 (id: 0x0039)
			read-only: yes
			value: 29

		battery_voltage (id: 0x0020)
			read-only: yes
			format: 27 (2.7 V)
				

	UserInterface (Endpoint id: 1, Id: 0x0204, Type: in)

		keypad_lockout (id: 0x0001)
			values:
				- KeypadLockout.No_lockout
				- KeypadLockout.Level_1_lockout

		temperature_display_mode (id: 0x0000)
			values:
				- TemperatureDisplayMode.Metric
				- TemperatureDisplayMode.Imperial

@jclsn
Copy link
Contributor

jclsn commented Nov 6, 2023

I actually want to move awy from bosh for the don't hold the Set temperatur but hat up and cool down for about 2 degree all the time Screenshot_20231021_204113_Home Assistant

Interesting! I don't have this issue. My heating setpoint is at 21°C and it stops at 21°C.

What is your value for ctrl_sequence_of_oper ?

@coxtor
Copy link

coxtor commented Nov 14, 2023

I've just purchased three bosch thermostats and was able to pair them using the QR-Code with ZHA. However I only have a couple of sensors there: temperature, mode (heat an off) , hvac(unknown) and battery. LQI and RSSI are not available.
There should be a whole bunch more or am I wrong?

@jclsn
Copy link
Contributor

jclsn commented Nov 17, 2023

@coxtor Yes, I am currently writing a quirk to support it. It should be ready in the coming weeks. This thermostat actually supports even valve opening from 1-100%. Really nice!

@BernhardMaier
Copy link

@jclsn Very good 👏 I'm really looking forward to being able to use more functionalities.

@Samueras
Copy link

@coxtor Yes, I am currently writing a quirk to support it. It should be ready in the coming weeks. This thermostat actually supports even valve opening from 1-100%. Really nice!

You just became my personal Hero.

@dierochade
Copy link
Author

@coxtor Yes, I am currently writing a quirk to support it. It should be ready in the coming weeks. This thermostat actually supports even valve opening from 1-100%. Really nice!

If I can contribute with any log/data from running these on z2m, just let me know. Will gladly assist.

@jclsn
Copy link
Contributor

jclsn commented Nov 17, 2023

If I can contribute with any log/data from running these on z2m, just let me know. Will gladly assist.

No need. Everything is in the Z2M repo. I just need to find time. We have a lot to do at work atm.

@wallenium
Copy link

wallenium commented Nov 17, 2023

@jcsln willing to donate a beer (ASTRA, Best city you live in :)). 12 thermos are waiting for full support.

@jclsn
Copy link
Contributor

jclsn commented Nov 18, 2023

@wallenium There are better beers if you ask me ;)

So I have implemented the missing attributes and they react correctly

jclsn@621eabd

If you want to try it out, add it as a custom quirk as described here, then click on the three dot menu -> manage devices and make the setting on the BoschThermostat or BoschUserInterface clusters.

I still have to expose the attributes correctly to Home Assistant. Bosch's system_mode and operating_mode attributes are very different from the normal Zigbee specification and therefore what ZHA expects. That is why you get an error when trying to turn the thermostat off. Unfortunately neither the ZHA nor the Zigpy code is documented well and I have to rely on the developers pointing me in the right direction on how to do this.

@wallenium
Copy link

@jclsn You are right. But none which has a connection to this city ;)

Short question: Seems to work. Do you know the setting for temperature offset? Need to set 1.5 degrees offset... ;)
Is there a list of possible parameters? Orientation of display would be nice, too.

@jclsn
Copy link
Contributor

jclsn commented Nov 18, 2023

@wallenium The local_temperature_calibration attribute works without the quirk. 1.5°C should be an integer value of 15.

Regarding the beer, there are plenty of good other beers from private breweries in Hamburg: Ratsherren, Wildwuchs, Gröninger

@wallenium
Copy link

wallenium commented Nov 18, 2023

You are right. Favorite is Ratsherren.

I will try.
Possible to add this set point to device management page?
Negative Offset seems not to work? Need -15, temperature is too high compared to room temperature.

@jclsn
Copy link
Contributor

jclsn commented Nov 18, 2023

-15 correctly sets -1.5°C for me

Possible to add this set point to device management page?

That is what I mean by exposing the attributes to HA. I don't know how to do that and the Zigpy code is not very intuitive. There is a guide on writing quirks, but it merely scratches the surface. I am in contact with one of the main developers, but he seems to live somewhere in America and only responds when we are about to go to bed. So a fully working quirk may take until Christmas. Sorry, I would also like to accelerate this somehow!

@pdsccode
Copy link

Just wanted to say thanks @jclsn for working on this. I installed the quirk and like expected, it works for everything that worked before. For me, the only thing I really need added is the off mode. Though it seems there is no real "off" in the Bosch implementation. At least I did not find any working one.

@jclsn
Copy link
Contributor

jclsn commented Nov 19, 2023

@pdsccode No, there is this attribute I called operating_mode with manual, pause and schedule. I will probably have to create a virtual attribute somehow that encompasses those and also heat and cool from system_mode. Usually those would all be under system_mode and mutually exclusive.

Anyway, pause is what you are looking for!

@pdsccode
Copy link

pdsccode commented Nov 19, 2023

Ah, good to know. But it seems I am either blind or too dumb. I can not find the attribute you mention.
My states look like the following:
image

And my device page look like this:
image

May I have missed something?

EDIT: I just now saw it in the device management and was able to set it to pause. And after re-reading your comment, I think I understand that this is not yet available via another way.

@jclsn
Copy link
Contributor

jclsn commented Nov 19, 2023

Yes, seems like I will have to implement the entities from the ZHA side.

@JericoPablo
Copy link

can anyone tell me here how i could use the remote temp? I can put a value in, but i would like to use a value from my sensor, like sensor.kitchen_roomthermostate_temp. I have some GoveeLife/Govee thermostates for my rooms which report me the temp of the room. Much accurater then the bosch one which is directly under the window / next to heater.

@dasEtwasmitPunkten
Copy link

@JericoPablo i think you could use better Thermostat for this

@jclsn
Copy link
Contributor

jclsn commented Nov 29, 2023

@JericoPablo I recommend not doing that. There is a note in Zigbee2MQTT code that says you have to take out the batteries and reset the thermostat once you have set this attribute. Therefore I will not implement this functionality. You will be able to do all of this with Home Assistant, once the thermostat is fully integrated.

@jclsn
Copy link
Contributor

jclsn commented Feb 17, 2024

I will implement the pi_heating_demand in HA, but I don't think that changing it directly is a good idea. Probably best to let the TRV handle this internally, as it will do a better job.

@SJankow
Copy link

SJankow commented Mar 5, 2024

@jclsn have you considered adding remote_temperature attribute to your quirk?

remote_temperature = ZCLAttributeDef(
            id=t.uint16_t(0x4040),
            type=t.int16s,
            is_manufacturer_specific=True,
        )

It can be used with some automation, to set the measured temperature from external sensor, like that:

- id: 'XXXXXXXXXXXX'
  alias: External Temperature
  trigger:
  - platform: state
    entity_id: sensor.aquara2
  - platform: time_pattern
    minutes: /30
  action:
  - service: zha.set_zigbee_cluster_attribute
    data:
      ieee: XX:XX:XX:XX:XX:XX:XX:XX
      endpoint_id: 1
      cluster_id: 513
      attribute: 16448
      cluster_type: in
      manufacturer: 4617
      value: '{{  (states(''sensor.aquara2'')|float(0) * 100.0)|int(0)
        }}'

BTW pi_heating_demand looks like a perfect sink for PID controllers like HASmartThermostat. Results with external sensor are pretty good, but it still space for improvements.
bosch

@berwinter
Copy link

I have a Bosch Room Thermostat II - 230V (RBSH-RTH0-ZB-EU), which has similar endpoints and attributes. I used zha_toolkit to scan for all availble attributes and made them available through a quirk:
berwinter@94c5719

I still need to figure out the name/function of those addional attributes and their allowed values. For now I just named them according to their IDs (e.g. attr_0x4022):
image

Maybe someone with a Bosch Controller can help to get the mapping?

I don't think we are going to need Entities for all attributes, but at least have the attributes mapped and accessible from ZHA to control the device setup.

We can do the same for the Radiator Thermostat II if someone could perform a scan in zha_toolkit and share the report.

@mrrstux
Copy link
Contributor

mrrstux commented Apr 22, 2024

Hi! Many thanks for starting this quirk!

Here is an updated version that converts from Bosch's operating_mode to HA system_mode. It is my first attempt at messing around with ZHA quirks, so it might not be perfect.
rbsh_trv0_zb_eu.zip

What I tested and works:

  • switch thermostat to Heat or Off from the HA thermostat card
  • change operating_mode from "HA Manage Zigbee device" (this results in the thermostat card updating its state)

@jclsn
Copy link
Contributor

jclsn commented Apr 24, 2024

@mrrstux Thank you, I will try it out soon. Pretty busy atm

EDIT: Just tried it out. Seems to work, although I am getting an error message

TypeError: 'NoneType' object is not subscriptable

Tbh, I am not really motivated to continue working on this atm. Feel free to contact @dmulcahey and see if he can help you finish it. I could also push my progress on core somewhere, so someone else can continue.

@mrrstux
Copy link
Contributor

mrrstux commented Apr 30, 2024

Here is a version quirk_v2_rbsh_trv0_zb_eu.zip that displays extra controls for:

  • Preset { Normal, Boost }
  • Window open { switch: On/Off }
  • Operating mode: { Pause, Manual, Schedule }
  • Displayed Temperature { Measured, Target }
  • Display Orientation { Normal, Flipped }
  • Display ON time (screen timeout) [5-30]
  • Display brightness [0-10]

Since I could not find specific strings inside HA for these, one would need to name/rename each in HA.
Also, a newer HA version might be needed since this quirk version is based on the v2 API - zigpy/zigpy#1312

@jclsn Sorry to hear that you encounter issues. Maybe they go away with this new version. If not, a more complete trace might help with the investigation.

@mrrstux
Copy link
Contributor

mrrstux commented May 15, 2024

Latest version: #2808:

  1. Bosch Radiator Thermostat II
  • system_mode to/from operating_mode
  • operating mode: { select: Pause, Manual, Schedule }
  • control sequence of operation: { select: Heating, Cooling }
  • boost { switch: On/Off }
  • window open { switch: On/Off }
  • displayed temperature { select: Measured, Target }
  • display orientation { select: Normal, Flipped }
  • display on time (screen timeout) [5-30]
  • display brightness [0-10]
  • remote temperature
  • pi heating demand
  1. Bosch Room Thermostat II 230v
  • system_mode to/from operating_mode
  • operating mode: { select: Pause, Manual, Schedule }
  • control sequence of operation: { select: Heating, Cooling }
  • boost { switch: On/Off }
  • window open { switch: On/Off }
  • display on time (screen timeout) [5-30]
  • display brightness [0-10]
  • pi heating demand

@Hedda
Copy link
Contributor

Hedda commented Aug 14, 2024

Anyone here who would be willing to help the whole community by adding some easy to follow how-to instructions in the ZHA integration documentation for new users pairing (joining) Zigbee devices that require install_code and/or qr_code please see here:

https://www.home-assistant.io/integrations/zha#action-zhapermit

and

https://github.com/home-assistant/home-assistant.io/blob/current/source/_integrations/zha.markdown

That is, add some simpler step-by-step notes similar to these instructions copied from Zigbee2MQTT devices documentation:

Pairing Zigbee devices that require an install-code or QR-code

1. To pair this device you have to install the device via its installation code.
2. The installation code can be obtained by scanning the QR-code with your smartphone, (note that the QR code is often on the outside of the device but can sometimes be found on inside of the battery cover, a separate sticker or in the manual in the package).
3. Then get the device into pairing mode.
4. In zigbee2mqtt navigate to "Settings" --> "Tools" and click on "Add install code".
5. Paste the code you got from the QR-code and confirm by clicking "OK" which will get zigbee2mqtt into pairing mode automatically.
6. Wait for your device to be joined

I like suggest that it might be a good idea to put that in its own sub-section, or maybe the ZHA developers might feel that it belongs in the troubleshooting section(?).

https://www.home-assistant.io/integrations/zha#adding-devices

Also link to the ZHA limitations section which state that install_code is only supported with Silabs and TI Zigbee Coordinator's or or just add a comment like this;

Note! The current version support is limited to using QR-codes and install-codes for secure Zigbee device provisioning/commissioning with devices from Aqara, Bosch, Consciot, and Embrighten. You also need to use a Zigbee Coordinator that is based on Silicon Labs or Texas Instruments Zigbee stacks.

https://www.home-assistant.io/integrations/zha#limitations

PS: Also see this related discussion thread in Home Assistant community forum to understand why users find this complicated:

https://community.home-assistant.io/t/bosch-thermostat-2/492845/

PPS: I do not personally own any Zigbee devices that require install-code or QR-code to be paired/joined but I have seen the question being asked enough these days that I think that the ZHA integration documentation could do with some simpler step-by-step notes for beginners.

@MSZ-Spyro
Copy link

Hello, im not sure if i undersand this properly, but all i get from this radiator on my HA is what shown on the ss, reading the docu, seems like it should have a lot more ?

Image

@mrrstux
Copy link
Contributor

mrrstux commented Jan 16, 2025

@MSZ-Spyro For better support, you need to deploy this (not yet merged) quirk #2808.

@MSZ-Spyro
Copy link

@MSZ-Spyro For better support, you need to deploy this (not yet merged) quirk #2808.

I havn't done it before, so if i understand it correctly, i should put

zhaquirks/bosch/rbsh_trv0_zb_eu.py

into for example

/config/zha_quirks/rbsh_trv0_zb_eu.py

and add

zha:
     enable_quirks: true
     custom_quirks_path: /config/zha_quirks/

to the config.yaml, restart hass and readd the TRV so it should have more options then ?

As a side question, do you know when this is planned to be merged ?

@mrrstux
Copy link
Contributor

mrrstux commented Jan 16, 2025

@MSZ-Spyro "enable_quirks: true" might not be needed. The name of the config is configuration.yaml.

If it works for you, please leave a comment in the PR to hopefully improve the chances of it getting reviewed and merged sooner.

@MSZ-Spyro
Copy link

Either it doesnt work or ive done something wrong, but by seeing pycache folder in the custom quirks folder i would assume it loaded it. Nothig has changed for me unfortunately

Image

Image

@mrrstux
Copy link
Contributor

mrrstux commented Jan 16, 2025

@MSZ-Spyro If the quirk was loaded, then you should see this in the "Zigbee info": "Quirk: zigpy.quirks.v2.CustomDeviceV2". If you have it, then I suggest you remove and re-add the TRV to your HA.

@MSZ-Spyro
Copy link

@MSZ-Spyro If the quirk was loaded, then you should see this in the "Zigbee info": "Quirk: zigpy.quirks.v2.CustomDeviceV2". If you have it, then I suggest you remove and re-add the TRV to your HA.

Like here ?

Image

Image

I have rebooted hass, then removed the TRV from it, and when i removed it, TRV automatically went into pairing mode, so i permitted the device in actions and it got found at once. after this had no changes but i cant see the Quirk: zigpy.quirks.v2.CustomDeviceV2 anywhere

As a side note: i can see the quirk name in the danfoss TRV, which i have too and which wasn't added manually so i assume something is wrong in the way ive added the custom quirk :/

Image

@mrrstux
Copy link
Contributor

mrrstux commented Jan 16, 2025

@MSZ-Spyro I believe specific quirks for Danfoss exist in the HA installation. For your TRV, the custom quirk doesn't seem to be loaded. Please check HA logs, maybe there is a clue in there as to why that is.

@MSZ-Spyro
Copy link

MSZ-Spyro commented Jan 16, 2025

@MSZ-Spyro I believe specific quirks for Danfoss exist in the HA installation. For your TRV, the custom quirk doesn't seem to be loaded. Please check HA logs, maybe there is a clue in there as to why that is.

My bad, i couldnt find any errors in the log before, but i got this one

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/zhaquirks/__init__.py", line 462, in setup
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/zha_quirks/rbsh_trv0_zb_eu.py", line 6, in <module>
    from zigpy.quirks.v2 import QuirkBuilder, ReportingConfig
ImportError: cannot import name 'ReportingConfig' from 'zigpy.quirks.v2' (/usr/local/lib/python3.12/site-packages/zigpy/quirks/v2/__init__.py)

Not sure why its not available, i technically could just remove the ReportingConfig from imports but should i ?

@mrrstux
Copy link
Contributor

mrrstux commented Jan 16, 2025

@MSZ-Spyro I suspect your HA is from before 2024.11 release. If you do not want to upgrade, then yes, you can remove ReportConfig usage from this quirk.

@MSZ-Spyro
Copy link

@MSZ-Spyro I suspect your HA is from before 2024.11 release. If you do not want to upgrade, then yes, you can remove ReportConfig usage from this quirk.

Yup, it was 2024.10.4. Thank you all for help ! Updated to the newest and works like a charm.

Only thing that doesnt seem to work 100% properly is the firmware - it started with "up to date" status and after few seconds went to unknown :/

Image

Image

@mrrstux
Copy link
Contributor

mrrstux commented Jan 16, 2025

@MSZ-Spyro I suggest you to also update the firmware of the device - the latest one is 0x37041514,

@MSZ-Spyro
Copy link

MSZ-Spyro commented Jan 17, 2025

@MSZ-Spyro I suggest you to also update the firmware of the device - the latest one is 0x37041514,

Im not a huge fan of updating things that work fine, and the firmware most probably is to work better with the native hub, but the firmware status shows "unknown" and i dont even know where to get the files from :/

--EDIT--

I've found the way, and the file but seems that i have the newest fw already installed

Image

@mrrstux
Copy link
Contributor

mrrstux commented Jan 17, 2025

@MSZ-Spyro Unfortunately, some issues require upgrades as resolve. Culprit for issues could be HA, device firmwares or even the Zigbee coordinator.

@MSZ-Spyro
Copy link

@MSZ-Spyro Unfortunately, some issues require upgrades as resolve. Culprit for issues could be HA, device firmwares or even the Zigbee coordinator.

Ive downloaded the file from some repository, and ive put it in the folder in config directory but you pasted 0x37041514, and mine is clearly different but still shows its latest version. Where did you get your fw from ? Oh, i fogot there is the official app so probably there ?

@mrrstux
Copy link
Contributor

mrrstux commented Jan 17, 2025

What I use is the ota zigpy support by adding this to the configuration.yaml:

zha:
  zigpy_config:
    ota:
      extra_providers: [{'type': 'z2m'}]

Restart HA/ZHA and then wait until you get the update available notice.

@MSZ-Spyro
Copy link

What I use is the ota zigpy support by adding this to the configuration.yaml:

zha:
  zigpy_config:
    ota:
      extra_providers: [{'type': 'z2m'}]

Restart HA/ZHA and then wait until you get the update available notice.

ive got those valves connected via ZHA, im not using Z2M. Don't know if it matters, but anyway after adding to the config file what you suggested nothing has changed in the device settings, still says im up to date.

@mrrstux
Copy link
Contributor

mrrstux commented Jan 17, 2025

The setting is for ZHA. The ota provider uses the z2m repository. It usually takes hours before HA would notify you.
The manual way is faster, but you need to notify the Zigbee device that a newer images is available for update.

@MSZ-Spyro
Copy link

Is there any way of "manual notifying" the device ? I can obviously just wait until tomorrow or so, but just asking.

@mrrstux
Copy link
Contributor

mrrstux commented Jan 17, 2025

Yes. You have to know the details of the update: manufacturer id, file size, file version. These you pass to the device through a Zigbee command over "Manage Zigbee device" -> cluster Ota -> commands -> image_notify.

All the details of the update can be found in the z2m repository index file.

@TheJulianJES TheJulianJES added the device support request This requests support for a new device label Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
device support request This requests support for a new device
Projects
None yet