Closed jclsn closed 1 year ago
I'm sorry to say I'm not familiar with TRVs, but we're going to help where we can.
The TRV device don't use the 'MCU approach' (not in the same way that other implementations) so you will not find any DPToAttributeMapping
here 🤷🏻♂️
As you have reported, it seems that in Z2M it is possible to configure the saswell_thermostat_calibration
. This part is done here:
As you have stated, the DP value for the attribute is saswellTempCalibration: 27,
in hexadecimal will be 0x1B
.
Let's see how is it in ZHA...
Your device is already loading a quirk (zhaquirks.tuya.ts0601_trv_sas.Thermostat_TZE200_c88teujp
)
Most of the magic happens here:
and here:
...but no reference to any calibration
attribute.
Interestingly, I did find a reference to the attribute elsewhere:
Right name and right DP, that can not be a coincidence.
So the ZonnsmartTV01_ZG
seems to implement the temperature calibration:
Since it doesn't seem like this quirk can be used for your device, I guess the functionality should be implemented in the Thermostat_TZE200_c88teujp
quirk.
That would be more or less:
ZONNSMART_TEMPERATURE_CALIBRATION_ATTR
TEMPERATURE_CALIBRATION_ATTR = 0x021B
ManufacturerThermostatCluster
class_update_attribute
the new attributeself.temperature_calibration_bus = Bus()
in Thermostat_TZE200_c88teujp
ZONNSMARTTemperatureOffset
:
I hope it's enough to guide you
Yeah thanks, that is plenty. I will see if I can implement this when I find the time.
How can I test this after implementing?
Also: Is it possible to expose this as a HA entity? It would be much easier to find for people.
How can I test this after implementing?
Enable the local quirk folder in your instalation and put inside the new version of the quirk (the full file). Restart HA and check if the device signature changes.
Is it possible to expose this as a HA entity?
That is the function of the ZONNSMARTTemperatureOffset
class.
So I got it kinda working. Seems like only values from -6 to 6 are accepted. I can only calibrate the temperature in steps of full degrees, which does not make sense.
Also: What is the first byte of the values? The value is 0x1B
, but in the ZHA file it is 0x021B
.
This is what I have so far. Maybe my scaling is wrong somehow? I can't image that there are just steps of 1. If there really are, I guess the DIRECT_MAPPED_ATTRS section is redundant. This was used in the ZONNSMART example for scaling. I can scale the slider alright, but the values accepted by the temperature_calibration
data endpoint only range from -6 to 6 = -6°C to 6°C, which is weird because for the heating_setpoint
and local_temperature
endpoints 6 = 0.6°C.
Is your feature request related to a problem? Please describe. I would like to set a temperature offset for the Saswell TRVs. It seems there needs to be a data point mapping implemented. The model is listed here
https://github.com/Koenkk/zigbee-herdsman-converters/blob/927f352c9dc848f716c23abf9d2a0a56c13a9f67/devices/saswell.js#L11
and here
https://github.com/Koenkk/zigbee-herdsman-converters/blob/927f352c9dc848f716c23abf9d2a0a56c13a9f67/lib/tuya.js#L516
but I have no idea how to implement a mapping here
https://github.com/zigpy/zha-device-handlers/blob/c2b2893d027fdcd3a225996fdf382d2ac72ff799/zhaquirks/tuya/ts0601_valve.py#L161
@javicalle dmulcahey said to mention you here ;)
Describe the solution you'd like Implement a data point mapping for a given model
Device signature
```yaml { "node_descriptor": "NodeDescriptor(logical_type=Diagnostic information
```yaml { "home_assistant": { "installation_type": "Home Assistant OS", "version": "2022.12.7", "dev": false, "hassio": true, "virtualenv": false, "python_version": "3.10.7", "docker": true, "arch": "aarch64", "timezone": "Europe/Berlin", "os_name": "Linux", "os_version": "5.15.76-v8", "supervisor": "2022.11.2", "host_os": "Home Assistant OS 9.4", "docker_version": "20.10.19", "chassis": "embedded", "run_as_root": true }, "custom_components": { "tuya_v2": { "version": "1.5.0", "requirements": [ "tuya-iot-py-sdk==0.4.1" ] }, "hacs": { "version": "1.29.0", "requirements": [ "aiogithubapi>=22.10.1" ] }, "openweathermap_all": { "version": "0.0.1", "requirements": [ "owm2json==0.1.89" ] } }, "integration_manifest": { "domain": "zha", "name": "Zigbee Home Automation", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/zha", "requirements": [ "bellows==0.34.5", "pyserial==3.5", "pyserial-asyncio==0.6", "zha-quirks==0.0.89", "zigpy-deconz==0.19.2", "zigpy==0.52.3", "zigpy-xbee==0.16.2", "zigpy-zigate==0.10.3", "zigpy-znp==0.9.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" ] } ], "codeowners": [ "@dmulcahey", "@adminiuga", "@puddly" ], "zeroconf": [ { "type": "_esphomelib._tcp.local.", "name": "tube*" }, { "type": "_zigate-zigbee-gateway._tcp.local.", "name": "*zigate*" }, { "type": "_zigstar_gw._tcp.local.", "name": "*zigstar*" } ], "dependencies": [ "file_upload" ], "after_dependencies": [ "onboarding", "usb", "zeroconf" ], "iot_class": "local_polling", "loggers": [ "aiosqlite", "bellows", "crccheck", "pure_pcapy3", "zhaquirks", "zigpy", "zigpy_deconz", "zigpy_xbee", "zigpy_zigate", "zigpy_znp" ], "is_built_in": true }, "data": { "ieee": "**REDACTED**", "nwk": 59604, "manufacturer": "_TZE200_c88teujp", "model": "TS0601", "name": "_TZE200_c88teujp TS0601", "quirk_applied": true, "quirk_class": "zhaquirks.tuya.ts0601_trv_sas.Thermostat_TZE200_c88teujp", "manufacturer_code": 4098, "power_source": "Battery or Unknown", "lqi": 91, "rssi": null, "last_seen": "2022-12-20T14:25:47", "available": true, "device_type": "EndDevice", "signature": { "node_descriptor": "NodeDescriptor(logical_type=Additional logs
``` Paste any additional debug logs here. Don't remove the extra line breaks outside the ``` marks. ```Additional context Add any other context or screenshots about the feature request here.