zigpy / zha-device-handlers

ZHA device handlers bridge the functionality gap created when manufacturers deviate from the ZCL specification, handling deviations and exceptions by parsing custom messages to and from Zigbee devices.
Apache License 2.0
734 stars 673 forks source link

Avatto_me167 / TZE200_bvu2wnxz TS0601 #1818

Open MS-Turbo opened 1 year ago

MS-Turbo commented 1 year ago

Is your feature request related to a problem? Please describe. I bought 5 ZigBee Thermostatic Radiator Valves but they are not recognized properly in ZHA. Running ZHA with conbee II stick

Describe the solution you'd like ZHA support for TZE200_bvu2wnxz TS0601

Device signature ```yaml { "node_descriptor": "NodeDescriptor(logical_type=, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=, mac_capability_flags=, manufacturer_code=4098, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=, *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": 260, "device_type": "0x0051", "in_clusters": [ "0x0000", "0x0004", "0x0005", "0xef00" ], "out_clusters": [ "0x000a", "0x0019" ] } }, "manufacturer": "_TZE200_bvu2wnxz", "model": "TS0601", "class": "zigpy.device.Device" } ```
Diagnostic information ```yaml { "home_assistant": { "installation_type": "Home Assistant OS", "version": "2022.10.2", "dev": false, "hassio": true, "virtualenv": false, "python_version": "3.10.5", "docker": true, "arch": "x86_64", "timezone": "Europe/Oslo", "os_name": "Linux", "os_version": "5.15.67", "supervisor": "2022.10.0", "host_os": "Home Assistant OS 9.0", "docker_version": "20.10.17", "chassis": "embedded", "run_as_root": true }, "custom_components": { "fullykiosk": { "version": "1.1.0", "requirements": [ "python-fullykiosk==0.0.11" ] }, "scheduler": { "version": "v0.0.0", "requirements": [] }, "hacs": { "version": "1.28.0", "requirements": [ "aiogithubapi>=22.2.4" ] }, "localtuya": { "version": "4.1.0", "requirements": [] }, "smartthinq_sensors": { "version": "0.24.2", "requirements": [ "pycountry>=20.7.3", "xmltodict>=0.12.0", "cchardet>=2.1.7" ] }, "tahoma": { "version": "2.13.0", "requirements": [ "pyoverkiz==1.3.6" ] } }, "integration_manifest": { "domain": "zha", "name": "Zigbee Home Automation", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/zha", "requirements": [ "bellows==0.34.2", "pyserial==3.5", "pyserial-asyncio==0.6", "zha-quirks==0.0.82", "zigpy-deconz==0.19.0", "zigpy==0.51.3", "zigpy-xbee==0.16.1", "zigpy-zigate==0.10.1", "zigpy-znp==0.9.1" ], "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": 1039, "manufacturer": "_TZE200_bvu2wnxz", "model": "TS0601", "name": "_TZE200_bvu2wnxz TS0601", "quirk_applied": false, "quirk_class": "zigpy.device.Device", "manufacturer_code": 4098, "power_source": "Battery or Unknown", "lqi": 255, "rssi": -52, "last_seen": "2022-10-10T21:54:49", "available": true, "device_type": "EndDevice", "signature": { "node_descriptor": "NodeDescriptor(logical_type=, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=, mac_capability_flags=, manufacturer_code=4098, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=, *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": 260, "device_type": "0x0051", "in_clusters": [ "0x0000", "0x0004", "0x0005", "0xef00" ], "out_clusters": [ "0x000a", "0x0019" ] } } }, "active_coordinator": false, "entities": [], "neighbors": [], "endpoint_names": [ { "name": "SMART_PLUG" } ], "user_given_name": null, "device_reg_id": "7690cf5b3470d5c4d12e1a1ebe29116c", "area_id": "470a6d223c514495b1a20eedbb94db8f", "cluster_details": { "1": { "device_type": { "name": "SMART_PLUG", "id": 81 }, "profile_id": 260, "in_clusters": { "0x0000": { "endpoint_attribute": "basic", "attributes": { "0x0001": { "attribute_name": "app_version", "value": 65 }, "0x0004": { "attribute_name": "manufacturer", "value": "_TZE200_bvu2wnxz" }, "0x0005": { "attribute_name": "model", "value": "TS0601" } }, "unsupported_attributes": {} }, "0x0004": { "endpoint_attribute": "groups", "attributes": {}, "unsupported_attributes": {} }, "0x0005": { "endpoint_attribute": "scenes", "attributes": {}, "unsupported_attributes": {} }, "0xef00": { "endpoint_attribute": null, "attributes": {}, "unsupported_attributes": {} } }, "out_clusters": { "0x0019": { "endpoint_attribute": "ota", "attributes": {}, "unsupported_attributes": {} }, "0x000a": { "endpoint_attribute": "time", "attributes": {}, "unsupported_attributes": {} } } } } } } ```
Additional logs ``` Paste any additional debug logs here. Don't remove the extra line breaks outside the ``` marks. ```

Additional context Link to device: https://www.alibaba.com/product-detail/Tuya-Version-Wi-Fi-ZIGBEE-Smart_1600398708828.html https://www.aliexpress.com/i/1005003468882163.html

MattWestb commented 1 year ago

Then doing changes in the local quirk is important deleting the __pycache__ directory before restarting HA so the system is not reusing some old code that is changed / deleted.

jacekk015 commented 1 year ago

As for battery level - could someone check in Device Cluster Management image Cluster: ME167ManufCluster Attribute: battery_state Click Read Attribute and paste here screenshot??

and also: image Cluster: TuyaPowerConfigurationCluster Attribute: battery_percentage_remaining Click Read Attribute

MS-Turbo commented 1 year ago

Then doing changes in the local quirk is important deleting the __pycache__ directory before restarting HA so the system is not reusing some old code that is changed / deleted.

Where can i find the local pycache ? There is no other file in /config/custom_zha_quirks

Skjermbilde 2022-10-22 kl  19 40 57
challs commented 1 year ago

@MS-Turbo wrote:

Is this git branch from challs to be seen as the master from both your work?

@jacekk015 isn't completely working off my branch at the moment but I am attempting to track his changes in there.

I have imported the latest changes from @jacekk015, great work thank you!

For me the battery status was showing in the interface as 127%, so I have added a further commit to change that to 100% instead.

Version with fixed battery percentage:

ts0601_trv_me167.zip

My device appears to expect the power calibration in units of 1, not tenths. With the current version, setting the calibration to +4.9C ends up with the device reporting that the current temperature is 49 degrees higher:

image

challs commented 1 year ago

@MS-Turbo

Where can i find the local pycache ? There is no other file in /config/custom_zha_quirks

I don't seem to have a pycache folder under the zha custom folder. I do have one under custom_components though. As far as I can see, the custom zha python files aren't being cached for some reason.

MattWestb commented 1 year ago

I just tested and its one hidden folder and the HA file editor is not showing it. If using SSH to the HA you can finding it here /usr/share/hassio/homeassistant/custom_zha_quirks/__pycache__/ Also in core container is mapped /config/custom_zha_quirks/__pycache__/ if you can assessing the container CLI.

MS-Turbo commented 1 year ago

@MS-Turbo wrote:

Is this git branch from challs to be seen as the master from both your work?

@jacekk015 isn't completely working off my branch at the moment but I am attempting to track his changes in there.

I have imported the latest changes from @jacekk015, great work thank you!

For me the battery status was showing in the interface as 127%, so I have added a further commit to change that to 100% instead.

Version with fixed battery percentage:

ts0601_trv_me167.zip

My device appears to expect the power calibration in units of 1, not tenths. With the current version, setting the calibration to +4.9C ends up with the device reporting that the current temperature is 49 degrees higher:

image

I have the same issue when calibration temperature ![Uploading Skjermbilde 2022-10-22 kl. 22.32.35.png…]()

jacekk015 commented 1 year ago

@MS-Turbo Logs are needed. I need to see data of attribute 0x022F First change it from zero to some value.

MS-Turbo commented 1 year ago

@MS-Turbo Logs are needed. I need to see data of attribute 0x022F First change it from zero to some value.

Skjermbilde 2022-10-22 kl  23 55 30
dmulcahey commented 1 year ago

@jacekk015 are you going to PR the changes from all of these zip files I see in my notifications?

MS-Turbo commented 1 year ago

Int the last seven lines i adjusted the temperature offset slider in tenths 0,1 - 0,2 - 0,3 in the thermostats and it offset the temp shown in with 1 - 2 - 3 "whole" degrees

2022-10-22 22:29:01.433 ERROR (MainThread) [zigpy.zcl] [0x7F37:1:0xef00] Failed to convert attribute 0x022F from -44.0 (<class 'float'>) to type <class 'zigpy.types.basic.uint32_t'>: -44 is not an unsigned 32 bit integer 2022-10-22 22:29:10.207 DEBUG (MainThread) [zhaquirks.tuya] [0x7f37:1:0xef00] Received value [0, 0, 0, 20] for attribute 0x022f (command 0x0002) 2022-10-22 22:29:33.507 DEBUG (MainThread) [zhaquirks.tuya] [0x7f37:1:0xef00] Received value [0, 0, 0, 1] for attribute 0x022f (command 0x0002) 2022-10-22 22:29:51.921 DEBUG (MainThread) [zhaquirks.tuya] [0x7f37:1:0xef00] Received value [0, 0, 0, 9] for attribute 0x022f (command 0x0002) 2022-10-22 22:30:05.302 DEBUG (MainThread) [zhaquirks.tuya] [0x7f37:1:0xef00] Received value [0, 0, 0, 1] for attribute 0x022f (command 0x0002) 2022-10-22 22:32:19.567 DEBUG (MainThread) [zhaquirks.tuya] [0x7f37:1:0xef00] Received value [0, 0, 0, 26] for attribute 0x022f (command 0x0002) 2022-10-22 22:33:13.142 DEBUG (MainThread) [zhaquirks.tuya] [0x7f37:1:0xef00] Received value [0, 0, 0, 1] for attribute 0x022f (command 0x0002) 2022-10-22 23:48:22.026 ERROR (MainThread) [zigpy.zcl] [0xF557:1:0xef00] Failed to convert attribute 0x022F from -24.0 (<class 'float'>) to type <class 'zigpy.types.basic.uint32_t'>: -24 is not an unsigned 32 bit integer 2022-10-22 23:48:29.830 DEBUG (MainThread) [zhaquirks.tuya] [0xf557:1:0xef00] Received value [0, 0, 0, 1] for attribute 0x022f (command 0x0002) 2022-10-22 23:48:45.643 DEBUG (MainThread) [zhaquirks.tuya] [0xf557:1:0xef00] Received value [0, 0, 0, 2] for attribute 0x022f (command 0x0002) 2022-10-22 23:49:32.487 DEBUG (MainThread) [zhaquirks.tuya] [0x7f37:1:0xef00] Received value [0, 0, 0, 2] for attribute 0x022f (command 0x0002) 2022-10-22 23:50:15.353 DEBUG (MainThread) [zhaquirks.tuya] [0x6615:1:0xef00] Received value [0, 0, 0, 1] for attribute 0x022f (command 0x0002) 2022-10-22 23:51:01.002 DEBUG (MainThread) [zhaquirks.tuya] [0x6615:1:0xef00] Received value [0, 0, 0, 2] for attribute 0x022f (command 0x0002) 2022-10-22 23:51:49.547 DEBUG (MainThread) [zhaquirks.tuya] [0x6615:1:0xef00] Received value [0, 0, 0, 3] for attribute 0x022f (command 0x0002) 2022-10-22 23:52:05.405 DEBUG (MainThread) [zhaquirks.tuya] [0xf557:1:0xef00] Received value [0, 0, 0, 3] for attribute 0x022f (command 0x0002)

jacekk015 commented 1 year ago

@MS-Turbo can you, on the TRV device, do correction in tenths or full degrees? Adjust it on the TRV only and post the logs.

Z2M code looks like they coded only full degrees in calibration https://github.com/twhittock/avatto_me167/blob/main/me167.js#L303

MS-Turbo commented 1 year ago

Sorry, but is currently in my cabin in the mountains and not back at the apartment before Tuesday

MattWestb commented 1 year ago

@dmulcahey Normally in the end its one working quirk then @jacekk015 have getting all things in place but one the road its very much try and error for getting understanding how the TRV /tuya MCU is doing all the things and "translating" it to Zigbee standard.

With brave user and good logs is normally fast done if the device is not doing extreme strange things.

dmulcahey commented 1 year ago

@dmulcahey Normally in the end its one working quirk then @jacekk015 have getting all things in place but one the road its very much try and error for getting understanding how the TRV /tuya MCU is doing all the things and "translating" it to Zigbee standard.

With brave user and good logs is normally fast done if the device is not doing extreme strange things.

I understand. I just want to make sure we don’t lose all of his work!

cannabarman commented 1 year ago

@MS-Turbo can you, on the TRV device, do correction in tenths or full degrees? Adjust it on the TRV only and post the logs.

Z2M code looks like they coded only full degrees in calibration https://github.com/twhittock/avatto_me167/blob/main/me167.js#L303

I'm not sure we can adjust it directly on the TRV, I tried but without instructions manual, I didn't succeed... However, all adjustments I saw on the TRV are in full degrees.

jacekk015 commented 1 year ago

As for error "Failed to convert attribute" it's just that I wrongly used unsigned int as value holder. Corrected version below. Also changed the resolution of calibration to 1 full degree. ts0601_trv_me167.py.zip

Most of the time all temperature values are sent as a Integers and the divided by 10. That's how from value 205 we've got 20,5 degrees.

I need to see example communication when someone manipulate TRV device and that is sent by Zigbee to HA. But I start to feel that there's bug in the firmware that don't divide the value send by Zigbee in the TRV itself.

It can be only tested by the TRV user so I can't do it myself.

challs commented 1 year ago

Thanks @jacekk015 those fixes seem to do the trick and the calibration now works.

Attached is a log where I set the calibration to 10 degrees and then back to zero.

me167_temperature_calibration_plus10_then_zero.log

jacekk015 commented 1 year ago

Thanks to Chinese engineers you can forget about decimal places. You're still better than Beca users. They even can't set target temp through HA 0.5 degree resolution. Chinese dev made, for TRV device, support to work with 0.5 resolution, but through Zigbee you can only get/send full degrees. 21,5 on the TRV goes as 21 to HA ;-) https://github.com/zigpy/zha-device-handlers/issues/1123#issuecomment-1288201764

challs commented 1 year ago

Yeah I guessed these devices don't have much temperature resolution. Shame, otherwise they are ok for the price.

I have tried to control the programming mode by writing the programing_oper_mode attribute in the interface, but am getting this error:

[homeassistant.core] Bus:Handling <Event call_service[L]: domain=zha, service=set_zigbee_cluster_attribute, service_data=ieee=84:ba:20:ff:fe:9a:67:35, endpoint_id=1, cluster_id=513, cluster_type=in, attribute=37, value=ProgrammingOperationMode.Simple>
[zigpy.zcl] [0x92EE:1:0x0201] Failed to convert attribute 0x0025 from ProgrammingOperationMode.Simple (<class 'str'>) to type <enum 'ProgrammingOperationMode'>: 'ProgrammingOperationMode.Simple' is not a valid Thermostat.ProgrammingOperationMode
[homeassistant.components.zha.core.device] [0x92EE](TS0601): set: ProgrammingOperationMode.Simple for attr: 37 to cluster: 513 for ept: 1 - res: [[WriteAttributesStatusRecord(status=<Status.SUCCESS: 0>)]]
[homeassistant.components.zha.api] Set attribute for: cluster_id: [513] cluster_type: [in] endpoint_id: [1] attribute: [37] value: [ProgrammingOperationMode.Simple] manufacturer: [None] response: [[[WriteAttributesStatusRecord(status=<Status.SUCCESS: 0>)]]]

Do you have an idea of what will be causing that without me having to resort to trace through all the code to see what is going on?

jacekk015 commented 1 year ago

Types mismatch error. I do have them also in my logs. Didn't see it earlier when did a quirk for my TRVs. Some zigpy code updates made a mismatch.

ma4er commented 1 year ago

Hi, i had the same Problems with missing Entities. Your solution works! THX ! But one thing doesn´t work. I can turn the power off, it works fine. But on the other side i can´t turn it on. If i push the Power button, nothing happens. Anyone else the same Problems?

hi there,

someone else with this problem?

jacekk015 commented 1 year ago

What problem? Power on/off what?? TRV device?

MattWestb commented 1 year ago

Is the Avatto having one real power off without frost protection / away mode ? If not its shall not having off function in the GUI then its false and is not the mode if the TRV is working.

Normal TRVs is not having one real off mode then they is still living and is heating if the temperature is too low (frost protection) and also other functions like anticalc and legionella is still active = its not "power off" is idle / away mode.

ma4er commented 1 year ago

Welches Problem? Ein-/Ausschalten was?? TRV-Gerät?

I have some of these TZE200_bvu2wnxz. And i can´t turn the Power on in HA. image When the TRV is on, i can turn the power of when i push the Power button in HA. But when the power is off, i can´t turn it on ageain. When i pushed the button in HA, nothing happens.

I have installed the newest File from @jacekk015 .

challs commented 1 year ago

I have installed the newest File from @jacekk015 .

That's odd, I have two controls:

Screenshot_20221029_164728

Does your device also report both hvac_modes?

Screenshot_20221029_165336

I can also see those modes in the state update log message:

[homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=climate.tze200_bvu2wnxz_ts0601_thermostat, old_state=<state climate.tze200_bvu2wnxz_ts0601_thermostat=off; hvac_modes=[<HVACMode.OFF: 'off'>, <HVACMode.HEAT: 'heat'>], min_temp=5.0, max_temp=35.0, current_temperature=20.0, temperature=None, hvac_action=off, system_mode=[<SystemMode.Off: 0>]/off, occupancy=Occupancy.Occupied, occupied_heating_setpoint=1100, friendly_name=_TZE200_bvu2wnxz TS0601 Thermostat, supported_features=ClimateEntityFeature.TARGET_TEMPERATURE @ 2022-10-29T16:45:28.156823+02:00>, new_state=<state climate.tze200_bvu2wnxz_ts0601_thermostat=heat; hvac_modes=[<HVACMode.OFF: 'off'>, <HVACMode.HEAT: 'heat'>], min_temp=5.0, max_temp=35.0, current_temperature=20.0, temperature=11.0, hvac_action=idle, system_mode=[<SystemMode.Heat: 4>]/heat, occupancy=Occupancy.Occupied, occupied_heating_setpoint=1100, friendly_name=_TZE200_bvu2wnxz TS0601 Thermostat, supported_features=ClimateEntityFeature.TARGET_TEMPERATURE @ 2022-10-29T16:45:33.567210+02:00>>

If not, maybe try deleting the device and repairing to see if that helps.

ma4er commented 1 year ago

@challs hvac_modes : heat isn´t available. Also after reinstall the Thermostat. image

challs commented 1 year ago

hvac_modes : heat isn´t available.

Hello. I saw this problem too on one of my devices. But restarting Homeassistant was enough to clear the problem for me.

Also after reinstall the Thermostat.

Did you also try deleting the device first before you paired it again?

thprim commented 1 year ago

Thanks a lot, got my device _TZE200_bvu2wnxz up and running with the latest ts0601_trv_me167.py.zip file. Really appreciated

spakka commented 1 year ago

This got my Avatto TRV06 / ME167 / _TZE200_bvu2wnxz up and running straight away, with the latest posted .zip file. Thank you for the efforts! Screenshot 2022-11-15 at 22 54 49

Miraculix666 commented 1 year ago

Are there any problems with the device atm? I got it multiple times, running deconz (me167 not working) and also tuya bridge for the me167 atm. I 'm planning to migrate to zha and could provide Tuya debug if needed. But soon I don't have the Tuya bridge anymore, it must be quickly done.

challs commented 1 year ago

Are there any problems with the device atm?

Thanks for the offer. I'm not aware of any problems with what we have working so far. Schedule support isn't implemented yet but I think we understand the messages. What I am wondering is whether we can control everything there is. I am aware of controls for temperature, schedule mode and temperatures and child lock enable / disable. Is there anything else you can control from the app?

Miraculix666 commented 1 year ago

There is a rescaling option, but I don't know if it's a setting in the TVR, or if the command comes from the cloud.Screenshot_2022-11-20-10-13-09-392_com.tuya.smartlife.jpg Screenshot_2022-11-20-10-12-56-087_com.tuya.smartlife.jpg Screenshot_2022-11-20-10-10-08-307_com.tuya.smartlife.jpg Screenshot_2022-11-20-10-09-44-959_com.tuya.smartlife.jpg

Some screenshots from the smart life settings

Squitoense commented 1 year ago

Thanks to everyone contributing to the code here, I have implemented it yesterday and was glad that I now receive data from my radiator valve. Unfortunately I pushed the Off-button in the "Better Thermostat" Card and cannot turn it on again. I also have the "auto" option enabled and had set the temperature to 16 °C. Last night it automatically set to 23 °C. Today I manually put it back to 16 °C using the knob on the radiator. At some point it turned it self to 23 °C again. The easiest way to correct this problem for me would be to disconnect and reconnect my device, and never push the Off-button again, right? I still wanted to report the problem and would like to ask if you know why it increased the temperature. Is this expected behaviour and I just don´t understand it or is this an issue?

MattWestb commented 1 year ago

The TRV is changing the set point temperature is coming from that the TRV is having some schedule in it after being retested and its overriding your manual set point temperature. Some tuya versions some user have putting in the quirk to deleting this and then its not doing the automatic changes all the time. I dont knowing the device so i dont knowing if its possible deleting them local on the device or not.

Nuares commented 1 year ago

Hi, I am new and I am trying to solve the problem I have with ME167 I tested a controller valve and I believe there is a problem with the software. I try to explain what happens

T room = 19

If I Set 20 (Tuya app, auto mode, knob) -> the controller opens the valve (correct)

After opening if I set 18 the controller has different actions depending on HOW I set the temperature, in fact:

Close partially also when the T-room reaches (or exceed) the set temperature.

I am a very beginner, I need to understand how get in the controller (which hardware and software I need). I am pretty sure that there are some thread that explain it but I don't know what "words" I need to search. Thanks

Miraculix666 commented 1 year ago

You can deactivate the schedule at the TVR, I think it's long pressing while temperature is shown, but I don't know if I remember right, take a look at the manual

Squitoense @.***> schrieb am Di., 29. Nov. 2022, 20:45:

Thanks to everyone contributing to the code here, I have implemented it yesterday and was glad that I now receive data from my radiator valve. Unfortunately I pushed the Off-button in the "Better Thermostat" Card and cannot turn it on again. I also have the "auto" option enabled and had set the temperature to 16 °C. Last night it automatically set to 23 °C. Today I manually put it back to 16 °C using the knob on the radiator. At some point it turned it self to 23 °C again. The easiest way to correct this problem for me would be to disconnect and reconnect my device, and never push the Off-button again, right? I still wanted to report the problem and would like to ask if you know why it increased the temperature. Is this expected behaviour and I just don´t understand it or is this an issue?

— Reply to this email directly, view it on GitHub https://github.com/zigpy/zha-device-handlers/issues/1818#issuecomment-1331201969, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANVSUMQHVIITWFDW2RVDXADWKZMMFANCNFSM6AAAAAARBWUR3M . You are receiving this because you commented.Message ID: @.***>

Squitoense commented 1 year ago

Thanks for the comments. Long pressing the button while temperature is displayed puts the device in "child lock" mode. The manual doesn´t explain how to deactivate the schedule mode.

JuMi2006 commented 1 year ago

Short press toggles between heat and schedule (a clock is shown).

StrongholdIII commented 1 year ago

Thank you guys for your work, with the latest .zip i have successfully added my ME167 to HASS! Unfortunately my radiator won't turn off completely when the target temperature is reached or even when the heating is turned off. Any tips for me how to calibrate the valve actuator correctly?

It seems, that there is a solution for a similar device: https://community.home-assistant.io/t/tuya-tv02-trv-valve-not-closing-completely/406707/7 Unfortunately the ME167 does not have these additional buttons

Edit: I cannot reconstruct the behavior from above. In my case the valve gets never closed, independent form setting the target temperature with HASS or with the knob.

Tanks!

IvanRebroff commented 1 year ago

@StrongholdIII I have the same problem, but not with all of my 5 TRV's. Two are working perfect. Sometimes, after fresh install on the heating-valve, they all work for a few hours and the heating is cold when it should. But then again three heatings always stays warm. I think this cheap shi* is to weak for some old heating-valves...

Miraculix666 commented 1 year ago

Simple you remove the batteries and repeat the installation procedure that had helped in my cases

IvanRebroff @.***> schrieb am So., 4. Dez. 2022, 15:30:

@StrongholdIII https://github.com/StrongholdIII I have the same problem, but not with all of my 5 TRV's. Two are working perfect. Sometimes, after fresh install on the heating-valve, they all work for a few hours and the heating is cold when it should. But then again three heatings always stays warm. I think this cheap shi* is to weak for some old heating-valves...

— Reply to this email directly, view it on GitHub https://github.com/zigpy/zha-device-handlers/issues/1818#issuecomment-1336427118, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANVSUMVFG2R4VAQNH46MKQTWLSTKDANCNFSM6AAAAAARBWUR3M . You are receiving this because you commented.Message ID: @.***>

StrongholdIII commented 1 year ago

@IvanRebroff Yes, exactly same behavior here. I assume, that i will try another model.

@Miraculix666 I have tried this a few times. Always with the same result: Valve does not close completely after the first open and close cycle of the init process

derpuma commented 1 year ago

I recieved my 5x Avatto TS0601 _TZE200_bvu2wnxz last week and installed them over the weekend. I have some problems with the valve not closing completly.

After a battery reset, the pin moves out the claimed 6mm. After Installation, the valve starts not to push the pin full out for a complete close. I would say at least 2mm are missing. Battery reset with the mounted valve helps a bit, but after changing temperature for a couple of times up and down, it does ot push out the pin to it's full lenght again. Any ideas?

I am using the quirks from the zip file from @jacekk015 /config/zha_quirks/ts0601_trv_me167.py

The readings so far are all plausible and the devices react like they should!

BUT.... I found this other post, with a similar problem and TVR Valves. Not sure if this could be the reason. IvanRebroff mentioned that they might be to weak to push some old valves in, which I doubt. Anyone else with this problem? Any suggestions?

IvanRebroff commented 1 year ago

I recieved my 5x Avatto TS0601 _TZE200_bvu2wnxz last week and installed them over the weekend. I have some problems with the valve not closing completly.

After a battery reset, the pin moves out the claimed 6mm. After Installation, the valve starts not to push the pin full out for a complete close. I would say at least 2mm are missing. Battery reset with the mounted valve helps a bit, but after changing temperature for a couple of times up and down, it does ot push out the pin to it's full lenght again. Any ideas?

I am using the quirks from the zip file from @jacekk015 /config/zha_quirks/ts0601_trv_me167.py

The readings so far are all plausible and the devices react like they should!

BUT.... I found this other post, with a similar problem and TVR Valves. Not sure if this could be the reason. IvanRebroff mentioned that they might be to weak to push some old valves in, which I doubt. Anyone else with this problem? Any suggestions?

That they are too weak is just an explanation for myself, because on two of my heatings they work fine with my automation. The valves are closed completely when the target temp is reached. I didn't test the working ones on other heatings yet. Maybe they work fine also. If so, then I think there's a problem within the production. I don't bought them all together. Or is it a firmware problem? Is it possible to do a firmware update with a Tuya Gateway and the origin App?

derpuma commented 1 year ago

Usually this cheaper devices from china do not get any firmware updates, as long as they are not hackable with 3rd party firmware.

Lets see what others write. I am thinking about switching to the MOES TRV Zigbee Devices as the send more entities and it looks like they have 5 different valve positions from 0, 25, 50, 75 to 100%, close to open.

And so far I do not see any schedule ability for the Avattos in HA, am I right?

derpuma commented 1 year ago

Little Update. I think it was not an issue of the TVRs. Maybe they are weaker than others, but I think they do their job. I sprayed my heating valves over night with WD40 and cleaned them again in the morning. I looks like they move back and return easier now, either I cleaned them before I installed the TRVs for the first time. Now they open and close the valve fine like they should.

One Question about scheduling: Is there a way to setup any scheduled timer for the TVRs? Am I right, when I say, that now, the TRVs drain a lot of power as they are constantly in heating mode? It might be best solution is to work with the temperature and keep the operation in status but unfortunately I guess this drains the battery as the TRV remains active? How long will the batteries last if so? I do see only 1 HVAC action which is heat (at least for these TRVs).

Any suggestions how to create plans or a template for this TVRs?

JuMi2006 commented 1 year ago

I use a helper (schedule) and an automation.

alias: logic_heizung_wohnen
description: Regelt die Temperatur mit Zeitschaltuhr (schedule.heizung_wohnen).
trigger:
  - platform: state
    entity_id:
      - schedule.heizung_wohnen
condition: []
action:
  - if:
      - condition: state
        entity_id: schedule.heizung_wohnen
        state: "on"
    then:
      - service: climate.set_temperature
        data:
          temperature: 20
        target:
          device_id:
            - 9ec2a9fe7e8fdffb95c2291ba64fa114
            - 6903b065c96ea8bbd535ce6721425031
            - 55d5e57e791b89e87b56467f3dd08450
    else:
      - service: climate.set_temperature
        data:
          temperature: 18
        target:
          device_id:
            - 9ec2a9fe7e8fdffb95c2291ba64fa114
            - 6903b065c96ea8bbd535ce6721425031
            - 55d5e57e791b89e87b56467f3dd08450
mode: single

The schedule you can set over the GUI also. https://www.home-assistant.io/integrations/schedule/

Master-Osiris commented 1 year ago

obviously i am not very familiar with Github :( I copied the code from zha-device-handlers/blob/dev/zhaquirks/tuya/ts0601_trv.py to a local python script and added the line for TZE200_bvu2wnxz and uploaded it to the custom qurik folder in HA. i can also find the radiator via ZHA now, but have the same issue with no values showing up.

as i went through the thread, i learned that there ist a "special" quirk from @jacekk015 /config/zha_quirks/ts0601_trv_me167.py but where can i download it / see the code?

thanks guys!

evgeni commented 1 year ago

@challs I too have one of these devices that only report hvac_modes: ['off'] and neither restarting HA nor restarting the device seems to help. Otherwise your quirk seems to to everything as expected.

One thing that would be probably a cool addition: the switch that gets exported is the "children lock" switch, but that's not part of the default name in HA and makes it a bit confusing in the beginning, is there a way to set a better default name?