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] TS0601 _TZE204_pcdmj88b TRV not showing any entities #2706
Comments
For information, a converter was made for this valve for zigbee2mqtt: Koenkk/zigbee2mqtt#19462 |
Here is the relevant zigbee-herdsmann-converter: {
fingerprint: tuya.fingerprint('TS0601', [
'_TZE204_pcdmj88b',
]),
model: 'TS0601_thermostat_4',
vendor: 'TuYa',
description: 'Thermostatic radiator valve',
fromZigbee: [tuya.fz.datapoints],
toZigbee: [tuya.tz.datapoints],
onEvent: tuya.onEventSetLocalTime,
configure: tuya.configureMagicPacket,
exposes: [
e.child_lock(),
e.battery(),
e.battery_low(),
e.climate()
.withSetpoint('current_heating_setpoint', 5, 35, 0.5, ea.STATE_SET)
.withLocalTemperature(ea.STATE)
.withPreset(['schedule', 'holiday', 'manual', 'comfort', 'eco'])
.withSystemMode(['off', 'heat'], ea.STATE)
.withLocalTemperatureCalibration(-3, 3, 1, ea.STATE_SET),
...tuya.exposes.scheduleAllDays(ea.STATE_SET, 'HH:MM/C HH:MM/C HH:MM/C HH:MM/C HH:MM/C HH:MM/C'),
e.holiday_temperature().withValueMin(5).withValueMax(30),
e.comfort_temperature().withValueMin(5).withValueMax(30),
e.eco_temperature().withValueMin(5).withValueMax(30),
e.binary('scale_protection', ea.STATE_SET, 'ON', 'OFF').withDescription('If the heat sink is not fully opened within ' +
'two weeks or is not used for a long time, the valve will be blocked due to silting up and the heat sink will not be ' +
'able to be used. To ensure normal use of the heat sink, the controller will automatically open the valve fully every ' +
'two weeks. It will run for 30 seconds per time with the screen displaying "Ad", then return to its normal working state ' +
'again.'),
e.binary('frost_protection', ea.STATE_SET, 'ON', 'OFF').withDescription('When the room temperature is lower than ' +
'5 °C, the valve opens; when the temperature rises to 8 °C, the valve closes.'),
e.numeric('error', ea.STATE).withDescription('If NTC is damaged, "Er" will be on the TRV display.'),
e.binary('boost_heating', ea.STATE_SET, 'ON', 'OFF')
.withDescription('Boost Heating: the device will enter the boost heating mode.'),
],
meta: {
tuyaDatapoints: [
[2, 'preset', tuya.valueConverterBasic.lookup(
{'schedule': tuya.enum(0), 'holiday': tuya.enum(1), 'manual': tuya.enum(2), 'comfort': tuya.enum(3), 'eco': tuya.enum(4)})],
[4, 'current_heating_setpoint', tuya.valueConverter.divideBy10],
[5, 'local_temperature', tuya.valueConverter.divideBy10],
[6, 'battery', tuya.valueConverter.raw],
[7, 'child_lock', tuya.valueConverter.lockUnlock],
[21, 'holiday_temperature', tuya.valueConverter.divideBy10],
[24, 'comfort_temperature', tuya.valueConverter.divideBy10],
[25, 'eco_temperature', tuya.valueConverter.divideBy10],
[28, 'schedule_monday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(1)],
[29, 'schedule_tuesday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(2)],
[30, 'schedule_wednesday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(3)],
[31, 'schedule_thursday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(4)],
[32, 'schedule_friday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(5)],
[33, 'schedule_saturday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(6)],
[34, 'schedule_sunday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(7)],
[35, 'fault_alarm', tuya.valueConverter.errorOrBatteryLow],
[36, 'frost_protection', tuya.valueConverter.onOff],
[37, 'boost_heating', tuya.valueConverter.onOff],
[39, 'scale_protection', tuya.valueConverter.onOff],
[47, 'local_temperature_calibration', tuya.valueConverter.localTempCalibration2],
[49, 'system_mode', tuya.valueConverterBasic.lookup({'off': tuya.enum(0), 'heat': tuya.enum(1)})],
],
},
}, |
@elf0heart I tried tonight to convert from @jim-fx zigbee2mqtt converter to a zha quirk but it seems that is a bit above my skill limit. My quirk loads but no entity appears. As of now the only solution seem to be using zigbee2mqtt :( |
Thanks for the try : ) I try to gather some information I found through my other research. I was in the same situation with another thermostat valve, topic discussed here : Link. After putting the custom quirk "beca", detailed by @Rofo, @R1DEN , got the 20 entities showing up in ZHA. Not sure if anyone can help more on this topic ? @Rofo, @R1DEN . I understand it takes a substantial amount of time developing such quirks, but could anyone share the method to get there ? Thx ! Would a modification of the ts0601_trv_beca.py file make the trick ? I got scared of the 1000+ lines of code... |
@T0ytoy @elf0heart I also used the already known tuya quirks but they do not work so far. |
@GigaDive these quirks wouldn't work as they do not define MODELS_INFO for the TVR this thread is about (TS0601_TZE204_pcdmj88b). For reference this class loads (because I set the signature to match) :
The difficult part is to define which replacement clusters to use, and write respective classes that interpret "tuya format" and convert it to zha-understandable format. That remains a bit out of reach for me, sadly. |
Hello, Very experimental patch (and very ugly), just add these lines at the end of file ts0601_trv.py:
|
Thanks for looking at the issue @Teka101 . I incorporated the few lines of code in the quirk, it's getting better, got the battery as a sensor, as well as the thermostat, see printscreens below. However, seems there is still a lot of entities missing. It seems that the thermostat card can only 'reads' what the physical TRV is showing. At the moment, I can not set the temperature for instance or get the % opening of the TRV. THanks anyways, this is good progress ! |
@elf0heart yes it's only work for reading... i'm working on it 💪 |
Now reading is in better shape but i'm unable to find why i can't change mode or temperature :( Code is available at : https://github.com/Teka101/zha-device-handlers/blob/support_tze204_pcdmj88b/zhaquirks/tuya/ts0601_trv_tze204.py |
Thank you for your efforts so far! It's a pity that it is so hard to get it work. Looking forward that you'll get it done! |
Thanks for trying @Teka101 , indeed every time the temperature is changed on the thermostat card, the heating setpoint comes back to what it was previously. Can't help much, sorry... |
@elf0heart ok i can change temperature and preset now. Can you try if it's okay on your installation ? |
@Teka101 , just tried. I confirm that the heating setpoint can now be set through home assistant, works in writing now ! Thanks for that. However the 'switch', whenever turned on in home assistant, comes back to 'off' a few seconds later. FOr my usage I do not mind, since I am using each TRV with the scheduler custom card (i always use it in 'heating mode', by just changing the heating setpoints from 16 to 20 °C for instaance). |
@elf0heart switch is for "boost mode" but it doesn't work yet :( |
@Teka101 , yes you are right, this model is only off or on, didn't realize that -> they are less accurate than the previous ones I bought (TS0601 _TZE200_b6wax7g0). User manual states that the following function are availabe : child lock, AF antifreeze mode->set to 8°C the temperature, BS: quick heat->TRV full open for 5 min, CC : offset temperature -> to adjust internal temperature sensor, EE: blind spot ->adjust heating point by offseting, DP: open window detection, HS : thermal stop -> fully closed. To me, all of those functions are useless when using scheduler card. |
@Teka101 well, that is outstanding, thank you for your work :) I have another of those TRV working with zigbee2mqtt at the same time, the implementation has a few more entities available as shown below: I would say the most important ones are Again, thank you very much for your work, and please let me know if you're interested in any details regarding those TVR using Z2M. |
@elf0heart yes there is more to do :) @T0ytoy preset can be change with group At this time, you can only change:
And in read only, we have :
I'm still working on it PS: je vois des français partout ^_^ |
@Teka101 how did you find out attributes identifiers? Ex:
I'm trying to add temperature_calibration, this is the value I guessed:
I added it to attributes.update in
at the end of the If you have any clue, I would love to hear about it :) |
Hello @T0ytoy You need to add entry in attributes (variable
Maybe you need to divide by 10 temperature before send it, i don't know... If still doesn't work maybe the prefix 512 applied on PCDM_TEMPERATURE_CORRECTION_ATTR is not the good one... |
I think i did already:
I'll try different prefixes, thx. |
@T0ytoy when i look at other quirks, |
@Teka101 well it seems it did the trick, I have access to the calibration value now! it doesn't appear as an entity yet though, it only works through zha interface "write attribute", but it works! I tried to limit the range of value you cane use from -12 to +12 Here is the converter I'm testing:
I'm still wondering how to make it show up as an entity, but there is progress! |
@T0ytoy ok thank you for your code. I just publish a new version with: window detection mode and temperature calibration |
@Teka101 I was finally able to test you update, it seems to work thank you! In the home assistant zha UI, boost mode and window detection mode are both switches without a name, so it isn't clear which does what at first glance, but it's not a big problem. If I have some time this week-end, I'll try to implement the right class so that temprature calibration gets it's own numeric entity in home assistant, so that it can be used easily. I use the calibration feature (it has an entity on the z2m integration) to correct the device internal temperature to the temperature of an external zigbee thermometer: that way when the radiator heats up, the TVR temperature does not increase just because it's too close to the radiator. It is done home assistant side, that is why I'm deseperately trying to get that entity :D I'll let you know if I'm getting anything done. Thank you! |
Nice work @Teka101! Curious; why didn't you create a PR or is it not fully ready yet? For now I'm using the custom quirk |
@Teka101 good news, I was able to make the temperature offset (or calibration) have it's own entity in Home Assistant. It seems to work well enough, and was the feature I wanted the most :) Here is the code : code
The important part is the class 'PcdmTemperatureOffset', and be careful to add 'self.temperature_calibration_bus = Bus()' to the init method of class 'PcdmTrv'. I made a home assistant blueprint that takes a climate entity, it's local temperature attribute, it's calibration entity, and an external thermometer entity, and hacks its way to make the TVR temperature follow the external temperature : Feel free to try it if you are interested. Last feature I'd like to see is entities for presets (switch to enable/disable them, and a number entitiy for each preset to set target temperature), let me know if you start working on it, otherwise I may or may not try it myself later (I need a break right now 😄 ) |
@royduin i'm trying to check if all features implemented works and after i will submit a PR :) @T0yto great ! i'll check code asap (i only work 1 or 2 hours by week on this project, so sorry for delay in response) Really good job for your blueprint ! |
@T0ytoy thanks for the hard work, i am testing your latest changes and it does indeed show the offset as an entity, it does however appear to have no effect when changed, at least on my thermostats (i have 4 of these running). I may be doing something incorrect so if that is the case please correct me but if not i am happy to test |
@ed-wright it takes about ~35 seconds for it to be applied to the current temperature. After moving the calibration slider, can you chek the 'PcdmManufTrvCluster' cluster calibration attribute (using ZHA) and make sure the read value is equal to the slider value? |
@T0ytoy i get the following
|
@ed-wright I just checked, the quirk I have running on my HA and the one I linked above are exactly the same, and it's working fine for me, so I don't really know what to think. Could you maybe have a different version of the TRV? Mine came in a blue box, the user manuel front page says "Model: BAB-1413Pro-E". I guess since the quirk is loaded and would only do so with EDIT: alternatively you can try and put some |
@T0ytoy i have confirmed the quirk it running, mine did come in a blue box anoyingly i dont have the box to hand.
It also reads correctly, but as before the hard work you have done to add the number entity has no input :( On the debugging side It looks like the number is being generated correctly Interestingly i cannot see the debug messages i put in |
@T0ytoy can i ask a really dim question, is the version you have in git the same as the one in your post above? Again, thanks for the hard work and helping debug! |
@ed-wright I never see What do you mean by "the git" ? I only shared my version on the post above, under the spoiler tag "code". Could you clarify? |
perfect clarification, just wanted to check that the version you had and the version in this thread was the same, thanks! |
@T0ytoy i have also tried changing the str(int(float(value))) and removed the str to see if it works, it did not work |
What version of home assistant are you running? I am running 2023.12.3,maybe there was a change to how number is handled, I don't know? |
I was on 2023.12.1, i am updating to 2023.12.3. Edit: It made no difference :( |
@T0ytoy i have found the box and they are the same Model: BAB-1413Pro-E |
@T0ytoy Ah! I got it working, I deleted the unit in HA entirely and readded it and it has now magically started working, i have no idea why as I did tell HA to reconfigure the device. Thanks for the troubleshoting work and hard work creating the quirk! Many Thanks |
@ed-wright Good news! It kinda make sense: the issue was probably on the zigbee association side, I'm glad there is no intricated technical issue with the python code, as I'm really not comfortable debugging advanced issues in this context 😄 To give credit to where it's due: 890% of the work was done by @Teka101, I mostly just worked on the calibration feature. Many thanks to him :) As a side note, I'm currently experimenting with using an average value over ~5-10 minutes instead of the raw "0.5 °C resolution shit data" locale temperature data from the TVR to feed the blueprint I made, I think it might be working a bit better since the raw temperature is jumping +-1°C all the time and the automation blueprint reacts a lot to try to compensate. I'm hoping it will generate less spikes above and below target temperature. |
@T0ytoy looks like I may have spoken too soon I can see in ZHA that the number is being set but it still looks like the actual offset is not, I will debug |
Hello, I've made an update of my code (@T0ytoy now slider for temperature calibration is working, thank for your code). Maybe someone can check if boost works ? Because i think, it's broken on this feature :/ |
PR: #2873 |
Hello all, May a noob ask, where I can find the latest version of the code? Thx in advance! |
Hello @synchronierer, Last version of code is in pull request : #2873 |
@ Teka101: I use the lastest code for the custom quirk and to them to be controllable. I even set up a heating program with Scheduler und Scheduler Card from HACS, but it's still not very intuitive. |
@synchronierer thank you. |
Problem description
I bought some Zigbee TRVs, they show up in home assistant as TS0601_TZE204_pcdmj88b but although they are pairing, no entity for control or sensor reading is showing up.
Model link for reference: https://fr.aliexpress.com/item/1005006191259938.html?spm=a2g0o.productlist.main.3.2de8kzSokzSoTw&algo_pvid=fc119493-da4b-462c-86bd-2d78585444c8&algo_exp_id=fc119493-da4b-462c-86bd-2d78585444c8-1&pdp_npi=4%40dis%21EUR%2132.60%2114.67%21%21%2132.60%21%21%402103834816991401988737073e38b3%2112000036203052461%21sea%21FR%21769762047%21&curPageLogUid=sWvhl7kLhrPV
I tried some custom quirks I found (for Moes or Zonnsmart TRVs) but obviously nothing good came out of it.
Solution description
I never used or debugged custom quirks before, but I'm willing to provide help if someone needs more information to create a custom quirks for this model. Thanks a lot!
Screenshots/Video
No response
Device signature
Device signature
Diagnostic information
No response
Logs
No response
Custom quirk
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: