It should be around line 569:-
Thanks again and i can report that the indent was not correct and with above help corrected. Added the valve successful and will dive deeper in all the functionalities
If I may, could someone help me with this similar problem?
I have zha running with about 10 devices connected to a sonoff usb zigbee adapter connected to my home assistant serving running on a raspberry pi.
I recently bought the same Moes BRT-100 TRV and connected it to my zha. I realised there were very few entities so I did some research and figures it’s because I’m missing a quirk. So I followed the steps from @Rofo
and created a .py file with the contents @Rofo posted, then put the file in “custom_zha_quirks” directory in config/
and in my configuration.yaml i wrote this:
zha:
custom_quirks_path: /config/custom_zha_quirks/
When I restart home assistant, and go to Settings > Integrations I see that my zha integration foiled to set up.
This is the error I get:
2023-03-08 15:35:46.327 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Sonoff Zigbee 3.0 USB Dongle Plus - Sonoff Zigbee 3.0 USB Dongle Plus for zha
File "/usr/src/homeassistant/homeassistant/components/zha/__init__.py", line 100, in async_setup_entry
File "/usr/local/lib/python3.10/site-packages/zhaquirks/__init__.py", line 409, in setup
File "/config/custom_zha_quirks/moes.py", line 570
2023-03-08 15:35:58.551 ERROR (MainThread) [homeassistant.components.automation.toggle_bedroom_bulb] Got error 'Unable to get zha device f4b6b0d9efb38a4e9326d7755a0d0caa' when setting up triggers for Toggle Bedroom Bulb
2023-03-08 15:35:58.589 ERROR (MainThread) [homeassistant.components.automation.button_br_day] Got error 'Unable to get zha device f4b6b0d9efb38a4e9326d7755a0d0caa' when setting up triggers for Button BR Day
2023-03-08 15:35:58.594 ERROR (MainThread) [homeassistant.components.automation.button_br_night] Got error 'Unable to get zha device f4b6b0d9efb38a4e9326d7755a0d0caa' when setting up triggers for Button BR Night
2023-03-08 15:35:58.612 ERROR (MainThread) [homeassistant.components.automation.br_red_dark] Got error 'Unable to get zha device f4b6b0d9efb38a4e9326d7755a0d0caa' when setting up triggers for BR Red dark
2023-03-08 15:35:58.615 ERROR (MainThread) [homeassistant.components.automation.button_br_warm_50] Got error 'Unable to get zha device f4b6b0d9efb38a4e9326d7755a0d0caa' when setting up triggers for Button BR Warm 50%
2023-03-08 15:35:58.620 ERROR (MainThread) [homeassistant.components.automation.button_bedroom_color_swap] Got error 'Unable to get zha device f4b6b0d9efb38a4e9326d7755a0d0caa' when setting up triggers for Button Bedroom Color Swap
What am I doing wrong? I can’t find any solution to my problem anywhere.
I would greatly appreciate some assistance. Thanks in advance!
I’m guessing you called your file moes.py
Looks like when you pasted the two parts together you had the same issue as @TheeBeginner.
Check your file to see that around line 570 looks like this:
I’m guessing you have what is on line 572 on the end of line 569.
Just press enter and break it onto another line, making sure the word class starts on the far left with no white space indents.
Yes, you’re right! Thank you very much!
I didn’t realise that the indenting mattered, so I had the “class…” part right under “self._update…”
Now I put line 572 to the far left and it works! Thanks again
You wouldn’t happen to know what you did to make the automations work do you?
I’m using this automation blueprint:
It (somehow) worked before I had the quirk installed, but now the thermostat doesn’t respond to the automation at all. It would be great if I can continue to use the thermostat with the quirk so that I can adjust the calibration, but it would also work with automations.
Is something preventing the thermostat from listening to automations? Like, I don’t know what the binary sensor is for, but in the logs I can see it’s active. Do you maybe know something about that?
Any suggestions would be appreciated. But, thenk again, you’ve already helped me very much with the quirk
Or does it have something to do with this “idle” mode?
Because if so, is there anyway to turn the idle mode off? I definately cant find it…
In the screenshot above, the thermostat is showing idle because the current temperature (The large number) is higher than the target temperature (the small number).
Now you have the device working, you might want to play with the temperature offset value to account for the fact that TRV’s temperature sensor is right next to the radiator:
Mine is set to -3.
However, I dont actually use the TRV’s temp sensor, I use a separate room thermostat and combine the two using Generic Thermostat - Home Assistant
Ahh…and these TRV’s only have 1 hvac mode, which is ‘heat’, so there is no way to turn them off via the hvac mode:
As an example, I also have another (different) TRV and its supported modes are:
I suspect the blueprint uses hvac mode to turn the TRV on and off, which wont work. See if there is another way using temperature instead.
I dont use a blueprint at all, I use my own automation to simply toggle the temperature to either 5 or 25 for ‘on’ and ‘off’ based on whether the current temperature is above or below the target temp.
That makes sense now Thanks
That’s way better, I would prefer to use my own automations as well, but how do you read the current temperature from the thermostat? The only entities I have from this thermostat are these:
So how can I make an automation based on the current temperature?
Is there a way to split the climate.bathroom_thermostat_becathermostat entity into 3 sensor entities that I can use seperately?
Since when I choose this entity in the history page, I can see 3 sensors:
I must be missing something… again…
Here is a very simple automation that checks if the TRV is below 20 degrees and if so turn on the TRV by setting its target temperature to 25. I added a delay of 2 minutes, but you don’t need to.
description: ""
mode: queued
trigger:
- platform: device
device_id: 3db80c338be90671452f65f50baa71b7
domain: climate
entity_id: climate.moes_trv_downstairs_bathroom_becathermostat
type: current_temperature_changed
below: 20
for:
hours: 0
minutes: 2
seconds: 0
condition: []
action:
- service: climate.set_temperature
data:
temperature: 25
target:
entity_id: climate.moes_trv_ensuite_bathroom_becathermostat
Naturally your device id will be different, this is what it looks like in the automation editor UI:
You can do something similar to in reverse to turn it off, either as a separate automation or combined into this one with trigger ids.
Like James-Lee-007 I bought a Moes BRT-100 TRV and figured it presented me too little entities. I cannot read or set its temperature setpoint. So I followed the same steps, copying Rofo’s quirk to a file on my Pi and adding the reference in my configuration.yaml, exactly the same. I even added the extra two lines cckp suggested. Removed the device, restarted HA and repaired the TRV.
There’s no change in the entities though. What can I do?
The only reference to an error related to Moes I could find is this:
Logger: zhaquirks
Source: /usr/local/lib/python3.11/site-packages/zhaquirks/__init__.py:462
First occurred: 17:57:01 (1 occurrences)
Last logged: 17:57:01
Unexpected exception importing custom quirk 'moes'
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/zhaquirks/__init__.py", line 460, in setup
spec.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/config/custom_zha_quirks/moes.py", line 69, in <module>
class BecaManufCluster(TuyaManufClusterAttributes):
File "/usr/local/lib/python3.11/site-packages/zigpy/zcl/__init__.py", line 167, in __init_subclass__
raise TypeError(f"Duplicate definitions exist for {duplicates}")
TypeError: Duplicate definitions exist for ['boost_duration_seconds']
The quirk is old. That error you’ve listed was caused by an HA upgrade ages ago, but it was very easily fixed.
Try this one: (The link will expire in a day)
If I use this quirks file in home assistant I get an log error:
Logger: zhaquirks
Source: /usr/local/lib/python3.11/site-packages/zhaquirks/__init__.py:462
First occurred: 22:12:57 (1 occurrences)
Last logged: 22:12:57
Unexpected exception importing custom quirk 'ts0601_trv_beca'
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/zhaquirks/__init__.py", line 460, in setup
spec.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/config/custom_zha_quirks/ts0601_trv_beca.py", line 68, in <module>
class BecaManufCluster(TuyaManufClusterAttributes):
File "/usr/local/lib/python3.11/site-packages/zigpy/zcl/__init__.py", line 167, in __init_subclass__
raise TypeError(f"Duplicate definitions exist for {duplicates}")
TypeError: Duplicate definitions exist for ['boost_duration_seconds']
@Rofo Could you share a link to this new quirks file again? Or could I find this file elsewhere?
Find this line of code in the quirk (should be line 95):-
BECA_BOOST_COUNTDOWN_ATTR: ("boost_duration_seconds", t.uint32_t),
And change it to this:-
BECA_BOOST_COUNTDOWN_ATTR: ("boost_duration_countdown_seconds", t.uint32_t),
Keep the indentation the same as the lines above and below it.
Note there is another line of code on line 92 above it that looks the same, leave that untouched.
Yes, thank you. It looks like it is working now. No error in the log.
For what reason is the description of the on_off buttons in the interface just “Switch”?
Is this a limitation of home assistant (e.g. on_off buttons do not have a “description” property)?
I am asking because I have a similar quirk for another Tuya valve and it has the same issue. I have been trying to add a description, but failed with my limited home assistant knowledge.
Could you please share this working ZHA quirk?