-
Notifications
You must be signed in to change notification settings - Fork 750
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] Saswell Tuya Thremostat Family Improved Quirk #1189
Comments
This is great! Thank you. I'm curious though, I still see no mention of the "Valve Position" attribute, or the ability to force the valve position. Zigbee2MQTT has been able to both read and set the valve position on the TS0601 series for quite a long time which makes it a lot more powerful for creating heating control systems in HA. Can you take a look into this? https://www.zigbee2mqtt.io/devices/TS0601_thermostat.html#controlling-device-specific-features |
@supersebbo TS0601 is a very wide family of products. AFAIK on Moes likes you have valve position reporting. Saswell and clones do not report valve position in any way. Even in the original tuya app. Also there is no endpoint that reports it as it changes so no way to implement it. |
Thanks. So the only way to 'control' these clone valves is by manipulating the set-point? Do you by any chance know the internal logic? It seems like they only open the valve if the set-point is >1 degree over the TRV measured temperature, but I don't know if this is true for all cases. I am trying to work out if it's more efficient in terms of Zigbee traffic to keep changing the set-point in order to meet the heat demand of my room temperature sensors i.e. { TRV_set_point = TRV_measured + (Room_set_point - Room_measured) }, or whether to apply the "temperature correction" based on the room sensor. |
@supersebbo what is the device signature for your device ? By manipulating one TRV by forcing the valve you is braking the regulation algorithm and you cant getting it working well (its takes days for one good TRV getting it self calibrated and working well). By manipulating the local temperature calibrating in small steps you can still getting the TRV working well but is not easy getting it right and if you is doing it it too large steps its losing the calibrations for its algorithm. I think the best is getting one good offset for the local temperature and then letting the TRV doing there work and calculating the heat demand from how much the TRV heating from val % reported or if not possible software calculated as being done for the Site TRVs. |
"manufacturer": "_TZE200_c88teujp", It's not performing badly in the current weather using the set-point manipulation quoted above. But I suspect when the weather changes this will cause some big over-shoots. |
I have one Siterwell in my kitchen for nearly one year but its little complicated then its in 2 levels and 3 hearings and 2 have normal mechanical ones and the Siterwell is doing the "fin work" and have working very well only one time getting the valve jammed. The Saswell can also being off / on / auto mode but using on / off its cant using the algorithms for getting good regulation so better using the setpoint changing. Testing and see how its working but i think if its not have to less heating it shall work OK or its getting problem then need heating and cant getting the heating from the heating system. |
The ciritcal thing is that the offset from the actual room temperature is not constant. Look the purple line versus the blue line. When the radiator is off the TRV temperature is almost the same as the Room temperature, but when the radiator is on, the TRV temperature is as much as 10 degrees hotter than the room temperature. The TRV does a good job tracking it's own temperature sensor (light-blue vs purple line) but this is no-where near the actual room temperature. |
@supersebbo to be honest I am not very satisfied with how this TRV performs. I can compare it to netatmo and netatmo performs much better so far. I have just started testing it on the radiator, before I was just developing the quirk so it was easier to have it on the table. My general remark is that you should not be forced to manipulate the setpoint, you should just set the temperature and it should work as set and more or less keep the temperature. I mean the non-connected TRVs do it pretty well so why the intelligent one should not be capable of doing it equally well? If you have to set it all the time then for me it means... find another TRV... but that's just me. |
My impression is that the TRVs are deliberately quite ‘dumb’ and I expect a lot of processing, learning and feedback happens within the Tuya App that you do not get when using them as raw Zigbee devices. These TRVs are actually quite good at controlling and tracking the TRV measured temperature against the TRV set-point. See graph below, the light-blue and purple lines around 6am each day, the TRV measured temperature tracks the TRV set-point almost exactly, with an approx. 1°C tolerance. This is effectively what a dumb TRV does mechanically. However, the temperature at the TRV is vastly different to room ambient temperature. The reason for the need to manipulate the set-point is because of the non-linear relationship between the room ambient temperature and the TRV measured temperature. Radiators, by their very nature, radiate heat as a point-source which has a complex interaction with the air and objects in the room, but what is very clear is that as the TRV is so close to the heat source its internal measurement is heavily affected by the heat from the radiator. When the radiator is on, the temperature measured at the TRV can be up to 10°C hotter than the ambient temperature measured in the middle of the room (see 27th Nov 08:00 on graph). Yet when the radiator is cold, the TRV measured temperature is very close to the room ambient temperature (see 27th Nov 12:00 on graph). For this reason, you cannot simply apply a fixed offset to the TRV to try and compensate for this. Here’s why, let’s say in this scenario you want the room ambient temperature to be 18°C. It would be trivial to conduct a simple experiment to heat the room and see what the TRV temperature was when the ambient sensor hits 18°C. In my plot above, you can see when the room (dark blue) line gets close to 18°C during the 6am heat cycle, the TRV measured temperature is 24°C. This would imply an offset of 6°C. However, move along the graph a little to around the 12:00 time, you see that now because the radiator is at a lower output setting and the room has absorbed a lot of heat, the room ambient temperature and the TRV measured temperature are the same. If you applied the same 6°C offset here, it would cause the TRV to open and start heating the room again, when it’s not needed. I believe the only way to achieve proper ambient room temperature control is to use a feedback loop that manipulates the TRV set-point based on the ambient measurement. This is what I’ve tried to implement here, the aim is to get the amient room temperature (dark-blue line) to be as stable as possible around the ambient room set-point by manipulating the TRV set-point (light blue) and as you can see, this achieves it quite well for a first attempt. |
Only PID can probably make it to work properly. |
CN-Hysen "Moes" HY366, HY 367, HY368 an HY369 is having PID if looking on some data from http://www.xmhysen.com/ProductInfoCategory?categoryId=126920 |
That's actually not true, most of them has PID and need to still work without Tuya gateway. It's nothing new that the TRV is mounted on a heat source. Standard TRVs are also working same. |
We are saying the same thing. As I showed above, the PID control on the TRV is quite good, it is able to control the temperature at the TRV accurately and consistently, but it can only do PID with the inputs it knows about, which for a TRV on it's own is just the valve position, the set-point and the temperature measured at the TRV. There is no way the TRV on it's own can know about the temperature in other parts of the room it is heating. The Tuya app allows you to add additional temperature sensors and assign them to rooms to help the TRV, in this case it must be the Tuya app doing the additional processing, or at the very least forwarding set-points/corrections values to the TRV based on the in-room temperature sensors. |
@supersebbo TBH I have sniffed this TRV with ZBOSS on the original tuya gateway with tuya app and seeing how quiet the device is zigbee-wise I am not so sure it does anything more with tuya app. I'm not sure it is able to have any use from external thermometer, even if you assign one to the same "area" in tuya app as the temp correction settings are in the range -6 to +6 degrees with a full degree step. It is also not possible to send data to device on the room temp endpoint and this is what one would expect in case of such "external thermometer" adjustment. It even does not report the valve position. What you could do with the HA automation is you could read external thermometer, compare with TRV readout and send correction as the difference of the two up to a degree of precision using the temp correction setting BUT... please bear in mind that device reports temperature rather seldom, and constantly sending it zigbee traffic will impact battery life. You could also just forget it has its own thermometer and just based on the room temp send it a full ON setting (30C setpoint) and when hot enough send it an OFF command based solely on the external thermometer. And probably this would work best. EDIT: It does report when it was heating (valve open) to the tuya app but it does so retrospectively like every hour or so. The history in the tuya app is not immediately available as well. So not usefull for the device adjustments. |
Hello guys, I really appreciate your work here. My _TZE200_yw7cahqs starts working like I would expect it to work, specially with that calibration entity. Anyway is there a way, how to force the quirk to send to TRV decimal numbers? I just tested to set resolution to 0.5deg and set manually the value to like 1.5deg, TRV enregister it. But When trying to do the same using Home Assistant, it sends to TRV just rounded values. Update: Not supported by device |
So this is consistent with what I've seen. I started to do the control by calcuting the difference between the room set point and the room measured temperature and adding this difference to the TRV mesured temperature - creating a 'virtual' demand signal at the TRV which takes into account the radiated heat from the radiator. This resulted in the TRV making very frequent on/off cycles (which are easy to hear because these TRVs are pretty noisy) as often as every 2-3 minutes. This is in line with what you observed as while the TRV is 'quiet' and doesn't send the temperature very often, the TRV does respond immediately to commanded temperature changes. This latency in the feedback loop actually induces the very frequent on/off cycles as the feedback from the TRV is out of cadence with the input. This fine grained control would be very beneficial if the valve was clever enough to modulate the supply based on the proximity to the target temperature, however it doesn't do this, it's just full off or full on. So as you suggested, the most 'efficient' way to use these TRVs as part of an integrated heating system is to command them full-on (30 degrees) and full off (5 degrees) purely based on the room heating demand signal from the room thermometer and thermostat, and ignore the TRV measured temperature entirely. Of course you still need to apply some smoothing to this otherwise it would rapidly on/off as the room entered the hysterisis cycle as it gets close to, then overshoots the target temp, cools down and so on, but this is fairly simple to encode in HA automations. |
@pticon91 You also have to change resolution of the GUI field
to
|
@jacekk015 , yeah, that's done, but thank you for additional info. It will be definitely handy to have this info here, when someone else would like to achieve the same result. |
Since version HA2022.4 the quirk does not work properly for my Hama _TZE200_yw7cahqs & _TYST11_yw7cahqs devices. I had to adjust line 159 in the Saswell.py file to get ZHA to work at all. (change var name from "manufacturer_attributes" to "attributes") |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions. |
I have 9 Hama _TZE200_yw7cahqs devices. I have not installed this quirk but judging from what @dieneuser wrote, it's not worth trying at this point. Any chance someone can look into this ? I would really like to get all the modes working. Thanks in advance. |
@zillion42 That quirk code wasn't modified to apply HA code changes made in April. |
Sounds promising... thx a lot ! |
Someone need to test the quirk. |
Hello @jacekk015, Thank you for the effort. |
For me it also works perfectly. If i compare the attributes: |
Keep in mind that the childlock switch will only enable the childlock function on the thermostat (e.g. holding down the button for 3 seconds). It won’t activate the lock itself. Quite a stupid way of controlling but that’s how a Hama technician told me how it works. |
Yeah, there's def much more they can improve. Unfortunately Hama itself doesn't know completely how these TRVs work, as they are not a manufacturer. I had some chat with them too. But I like this product more and more since I finally create a sufficient automation / functionality workaround in nodered. Am just disapointed that Hama does not distinguish the versioning when selling this devices. I have 6 of those in (probably) v1 and now I bought 3 others this Christmas and it's v3 and obviously not compatible with existing quirk. Seems like they changed manufacturer, I've asked them to provide us some change log, let's see what they'll reply - however using Tuya gateway and App I do not see any difference. |
@pticon91 True, Hama only acts as a reseller. They even don't have any technical documents (which I don't believe since they made the decision to sell this stuff in the first place by probably looking at some datasheets rather than throwing dices). One thermostat is working fine so far but another one I bought from a private seller just stepped out of my zigbee network on random occasions. Hence aside of one Hama thermostat I installed 3 from Aqara (which also still are buggy e.g. no batter status etc.). But at least they do their job and respond much faster to commands than the Hama ones. Too bad you can not flash the firmware of a zigbee device like you can with Tasmota. |
Probably there's something wrong with manufacturers ID. |
Just for your info, i was also disappointed of how they work so i started to contribute on the "better thermostat" integration. And now I'm pretty happy because i have now like a tolerance of 0.1 to 0.3 for the temperature to target temperature. |
Hello gents, I've managed to make the _TZE200_h4cgnbzg work, for more info please see this comment. |
Updated quirk below. NO changes in file below needed - all needed changes are embedded in the quirk itself: |
Warning: The latest HA version (2023.2) seems to break this quirk, thus making Zigbee impossible to start: Error setting up entry Sonoff Zigbee 3.0 USB Dongle Plus - Sonoff Zigbee 3.0 USB Dongle Plus, s/n: 0001 - Silicon Labs for zha
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 382, in async_setup
result = await component.async_setup_entry(hass, self)
File "/usr/src/homeassistant/homeassistant/components/zha/__init__.py", line 100, in async_setup_entry
setup_quirks(config)
File "/usr/local/lib/python3.10/site-packages/zhaquirks/__init__.py", line 409, in setup
importer.find_module(modname).load_module(modname)
File "<frozen importlib._bootstrap_external>", line 548, in _check_name_wrapper
File "<frozen importlib._bootstrap_external>", line 1063, in load_module
File "<frozen importlib._bootstrap_external>", line 888, in load_module
File "<frozen importlib._bootstrap>", line 290, in _load_module_shim
File "<frozen importlib._bootstrap>", line 719, in _load
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/config/quirks/trv_saswell.py", line 57, in <module>
class CustomTuyaOnOff(LocalDataCluster, OnOff):
File "/config/quirks/trv_saswell.py", line 115, in CustomTuyaOnOff
command_id: Union[foundation.Command, int, t.uint8_t],
AttributeError: module 'zigpy.zcl.foundation' has no attribute 'Command' |
@jzielke84 See #1061 (comment) on how to fix custom quirks. |
All quirks will be corrected, later evening. |
Quirk corrected |
Thanks man!
Kind regards,
Julian
From: Jacek Kończewski ***@***.***>
Reply to: zigpy/zha-device-handlers ***@***.***>
Date: Monday, 9. January 2023 at 20:59
To: zigpy/zha-device-handlers ***@***.***>
Cc: Julian Zielke ***@***.***>, Mention ***@***.***>
Subject: Re: [zigpy/zha-device-handlers] [Device Support Request] Saswell Tuya Thremostat Family Improved Quirk (Issue #1189)
Quirk corrected
trv_saswell.py.zip<https://github.com/zigpy/zha-device-handlers/files/10376449/trv_saswell.py.zip>
—
Reply to this email directly, view it on GitHub<#1189 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADGTG2Q5YHH7CUTDHKODTCTWRRUYVANCNFSM5I5L7IJQ>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Thank you for your awesome work!! 🦸♂️ |
I have the trv _TZE200_h4cgnbzg, but the quirk ist not working for setting the temperature. It shows in HA the manual changes at the TRV, but changig the heat from HASS ist still not working despite the several hints and modifications in the published quirk files. |
@thprim If you have same TRV it cannot work for few users and don't work for you. There's no need to do modification - code is corrected. Did you:
To tell you more you need to enable debug logging and post the FULL HA logs from pairing process +10 minutes. configuration.yaml
You need to restart HA after changes above. |
I tried to change the heat value round the timestamp between 03:00 and 05:00 |
What I see:
Here you set the temp to 19 degrees
Here is response from TRV - with ERROR: UNSUP_MANUF_CLUSTER_COMMAND
That error was repaired in latest quirk - so you cant use newest version. If you would use it that line below:
would have is_manufacturer_specific=False instead of true. That line of quirk code is responsible for that:
Moreover - that lines says you don't use any custom quirk probably:
You are using: So - start using my custom quirk and then you will be good. |
I installed now your latest version and it seems now that it works fine for me. Temperature can now be changed which was the main goal for me. btw: any idea how to get the on/off button functional? But honestly, that's not a showstopper or an urgent issue. It's also not working for the other 4 trv's I have with the standard zha implementation. |
Yes - switch it on/off on the TRV and post the logs. |
@thprim From what I know is that they need some time between changing from on to off. Also after being switched on, changing the temperature requires like 5 seconds to be in active 'on' state. I guess that's because they change to 16°C first when being switched on, regardless of the set temperature in HA. I have created a workaround in node red: The wait node waits for hvac_mode to be 'heating' You can import those If you like to: [
{
"id": "b42e1d5c6cda0d9a",
"type": "api-current-state",
"z": "404303a28a34c76c",
"name": "check office radiator hvac mode is off",
"server": "c2541c0c.8532",
"version": 3,
"outputs": 2,
"halt_if": "off",
"halt_if_type": "re",
"halt_if_compare": "is",
"entity_id": "sensor.heizung_arbeitszimmer_hvac_action",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}, {
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 1090,
"y": 160,
"wires": [["630619a7fccb2739"], ["ee6e87880c707f93"]]
}, {
"id": "630619a7fccb2739",
"type": "api-call-service",
"z": "404303a28a34c76c",
"name": "set hvac_mode to heat",
"server": "c2541c0c.8532",
"version": 5,
"debugenabled": false,
"domain": "climate",
"service": "set_hvac_mode",
"areaId": [],
"deviceId": [],
"entityId": [
"climate.heizung_arbeitszimmer_thermostat", "climate.heizung_bad_thermostat", "climate.heizung_kueche_thermostat", "climate.heizung_wohnzimmer_thermostat"
],
"data": "{\"hvac_mode\":\"heat\"}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"x": 1460,
"y": 100,
"wires": [
["9da6a3133c846f19"]
]
}, {
"id": "9da6a3133c846f19",
"type": "ha-wait-until",
"z": "404303a28a34c76c",
"name": "wait for thermostat office",
"server": "c2541c0c.8532",
"version": 2,
"outputs": 2,
"entityId": "sensor.heizung_arbeitszimmer_hvac_action",
"entityIdFilterType": "exact",
"property": "state",
"comparator": "is",
"value": "heating",
"valueType": "str",
"timeout": "30",
"timeoutType": "num",
"timeoutUnits": "seconds",
"checkCurrentState": true,
"blockInputOverrides": true,
"outputProperties": [],
"entityLocation": "data",
"entityLocationType": "none",
"x": 1730,
"y": 100,
"wires": [["80e1a54c16f75faa"], []]
}, {
"id": "80e1a54c16f75faa",
"type": "delay",
"z": "404303a28a34c76c",
"name": "wait 5 sec",
"pauseType": "delay",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1980,
"y": 100,
"wires": [
["ee6e87880c707f93"]
]
}, {
"id": "ee6e87880c707f93",
"type": "api-current-state",
"z": "404303a28a34c76c",
"name": "get day temperature",
"server": "c2541c0c.8532",
"version": 3,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "input_number.tagestemperatur",
"state_type": "num",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 1460,
"y": 180,
"wires": [
["6e8296f80eac1624"]
]
}, {
"id": "6e8296f80eac1624",
"type": "api-call-service",
"z": "404303a28a34c76c",
"name": "set temperature",
"server": "c2541c0c.8532",
"version": 5,
"debugenabled": false,
"domain": "climate",
"service": "set_temperature",
"areaId": [],
"deviceId": [],
"entityId": [
"climate.heizung_arbeitszimmer_thermostat", "climate.heizung_bad_thermostat", "climate.heizung_kueche_thermostat", "climate.heizung_wohnzimmer_thermostat"
],
"data": "{\"temperature\":\"{{payload}}\"}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"x": 2000,
"y": 180,
"wires": [
[]
]
}, {
"id": "c2541c0c.8532",
"type": "server",
"name": "Home Assistant",
"addon": true,
"rejectUnauthorizedCerts": true,
"ha_boolean": "",
"connectionDelay": false,
"cacheJson": true,
"heartbeat": true,
"heartbeatInterval": "30",
"areaSelector": "friendlyName",
"deviceSelector": "friendlyName",
"entitySelector": "friendlyName",
"statusSeparator": "",
"statusYear": "2-digit",
"statusMonth": "2-digit",
"statusDay": "2-digit",
"statusHourCycle": "h23",
"statusTimeFormat": "h:m:s",
"enableGlobalContextStore": false
}
] Keep in mind you have to change the properties of each node corresponding to your setup and probably ditch |
If they switch ON to 16deg automatically you have probably 'schedule' mode on - clock icon will be shining on the TRV. To turn it off double tap the TRV button. None of my TRV's turn ON automatically to 16deg or resets to 16deg if the schedule mode is off. |
See my comment in my reply. Everything is working now with the new quirk. |
Hi @jacekk015, I've edited the quirk file to make it so when TRV is off, it doesn't report as "heating" when temperature goes below target, could you add this patch to your code, please?
I've tested this a bit and seems to work fine. Btw do you think you could create a Github repository for the quirk file? It would make it easier to track the latest version and we could send pull requests with changes like these :) |
@zv0n |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions. |
github-actions bot closed this as not planned 11 minutes ago Let's re-open this... Thx jacekk015 |
This quirk supports following devices:
Saswell | SEA801 | _TYST11_KGbxAXL2 | GbxAXL2 | ✅ Sas II | 798
Saswell | SEA802 | _TZE200_c88teujp | TS0601 | ✅ Sas I | 576
Saswell | SEA802 | _TYST11_c88teujp | 88teujp | ✅ Sas II | 576
HiHome | WZB-TRVL | _TZE200_zuhszj9s | TS0601 | ✅ Sas I | 1064
HiHome | WZB-TRVL | _TYST11_zuhszj9s | uhszj9s | ✅ Sas II | 798
Hama | 00176592 | _TZE200_yw7cahqs | TS0601 | ✅ Sas I | 923
Hama | 00176592 | _TYST11_yw7cahqs | w7cahqs | ✅ Sas II | 798
RTX | ZB-RT1 | _TZE200_azqp6ssj | TS0601 | ✅ Sas I | 923
RTX | ZB-RT1 | _TYST11_azqp6ssj | zqp6ssj | ✅ Sas II | 1064
Sanico | - | _TZE200_9gvruqf5 | TS0601 | ✅ Sas I | 1064
Sanico | - | _TYST11_9gvruqf5 | gvruqf5 | ✅ Sas II | 1064
Saswell | SEA802 | TZE200_zr9c0day | TS0601 | ✅ Sas I
This quirk is experimental and supports following functions of the TRV:
Not implemented:
The quirk:
Saswell.zip
How to activate the quirk: #693 (comment)
Please re-pair the device after new quirk is used.
Since currently we are not able to change names of on_off entities below is the description:
Please test and provide feedback. Especially the _TYST11 lineage since my device is _TZE200 based.
Special thanks to @MattWestb @jacekk015
The text was updated successfully, but these errors were encountered: