Repository: zigpy/zha-device-handlers

Issue:
[Device Support Request] Immax neo smart 07732l TRV
**Is your feature request related to a problem? Please describe.**
Got an Immax neo smart 07732l TRV (https://zigbee.blakadder.com/Tuya_HY367.html) paired, but got no control over it.

**Describe the solution you'd like**
Would it be possible to add support for this TRV

**Device signature - this can be acquired by removing the device from ZHA and pairing it again from the add devices screen. Be sure to add the entire content of the log panel after pairing the device to a code block below this line.**
_TZE200_4eeyebrt TS0601

```
2021-12-04 14:01:37 INFO (MainThread) [zigpy.device] [0xc7f3] Read model 'TS0601' and manufacturer '_TZE200_4eeyebrt' from <Endpoint id=1 in=[basic:0x0000, groups:0x0004, scenes:0x0005, None:0xEF00] out=[ota:0x0019, time:0x000A] status=<Status.ZDO_INIT: 1>>
2021-12-04 14:01:37 INFO (MainThread) [zigpy.device] [0xc7f3] Discovered basic device information for <Device model='TS0601' manuf='_TZE200_4eeyebrt' nwk=0xC7F3 ieee=84:fd:27:ff:fe:a2:52:84 is_initialized=True>
2021-12-04 14:01:37 DEBUG (MainThread) [zigpy.application] Device is initialized <Device model='TS0601' manuf='_TZE200_4eeyebrt' nwk=0xC7F3 ieee=84:fd:27:ff:fe:a2:52:84 is_initialized=True>
2021-12-04 14:01:37 DEBUG (MainThread) [zigpy.quirks.registry] Checking quirks for _TZE200_4eeyebrt TS0601 (84:fd:27:ff:fe:a2:52:84)
2021-12-04 14:01:37 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.xbee.xbee_io.XBeeSensor'>
2021-12-04 14:01:37 DEBUG (MainThread) [zigpy.quirks.registry] Fail because endpoint list mismatch: {232, 230} {1}
2021-12-04 14:01:37 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.xbee.xbee3_io.XBee3Sensor'>
2021-12-04 14:01:37 DEBUG (MainThread) [zigpy.quirks.registry] Fail because endpoint list mismatch: {232, 230} {1}
2021-12-04 14:01:37 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.smartthings.tag_v4.SmartThingsTagV4'>
2021-12-04 14:01:37 DEBUG (MainThread) [zigpy.quirks.registry] Fail because device_type mismatch on at least one endpoint
2021-12-04 14:01:37 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.smartthings.multi.SmartthingsMultiPurposeSensor'>
2021-12-04 14:01:37 DEBUG (MainThread) [zigpy.quirks.registry] Fail because device_type mismatch on at least one endpoint
2021-12-04 14:01:37 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.netvox.z308e3ed.Z308E3ED'>
2021-12-04 14:01:37 DEBUG (MainThread) [zigpy.quirks.registry] Fail because device_type mismatch on at least one endpoint
2021-12-04 14:01:37 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.gledopto.soposhgu10.SoposhGU10'>
2021-12-04 14:01:37 DEBUG (MainThread) [zigpy.quirks.registry] Fail because endpoint list mismatch: {11, 13} {1}
2021-12-04 14:01:37 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'bellows.zigbee.application.EZSPCoordinator'>
2021-12-04 14:01:37 DEBUG (MainThread) [zigpy.quirks.registry] Fail because device_type mismatch on at least one endpoint
2021-12-04 14:01:37 DEBUG (MainThread) [homeassistant.components.zha.core.gateway] device - 0xC7F3:84:fd:27:ff:fe:a2:52:84 entering async_device_initialized - is_new_join: True
2021-12-04 14:01:37 DEBUG (MainThread) [homeassistant.components.zha.core.gateway] device - 0xC7F3:84:fd:27:ff:fe:a2:52:84 has joined the ZHA zigbee network
2021-12-04 14:01:37 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0xC7F3](TS0601): started configuration
2021-12-04 14:01:37 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0xC7F3:ZDO](TS0601): 'async_configure' stage succeeded
2021-12-04 14:01:37 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0xC7F3:1:0x0000]: finished channel configuration
2021-12-04 14:01:37 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0xC7F3:1:0x0019]: finished channel configuration
2021-12-04 14:01:37 DEBUG (MainThread) [zigpy.appdb] Error handling '_save_attribute' event with (84:fd:27:ff:fe:a2:52:84, 1, 0, 4, '_TZE200_4eeyebrt') params: FOREIGN KEY constraint failed
2021-12-04 14:01:37 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0xC7F3:1:0x0000]: 'async_configure' stage succeeded
2021-12-04 14:01:37 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0xC7F3:1:0x0019]: 'async_configure' stage succeeded
2021-12-04 14:01:37 DEBUG (MainThread) [zigpy.appdb] Error handling '_save_attribute' event with (84:fd:27:ff:fe:a2:52:84, 1, 0, 5, 'TS0601') params: FOREIGN KEY constraint failed
2021-12-04 14:01:37 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0xC7F3](TS0601): completed configuration
2021-12-04 14:01:37 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0xC7F3](TS0601): stored in registry: ZhaDeviceEntry(name='_TZE200_4eeyebrt TS0601', ieee='84:fd:27:ff:fe:a2:52:84', last_seen=1638622897.299663)
2021-12-04 14:01:37 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0xC7F3](TS0601): started initialization
2021-12-04 14:01:37 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0xC7F3:ZDO](TS0601): 'async_initialize' stage succeeded
2021-12-04 14:01:37 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0xC7F3:1:0x0000]: initializing channel: from_cache: False
2021-12-04 14:01:37 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0xC7F3:1:0x0000]: finished channel initialization
2021-12-04 14:01:37 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0xC7F3:1:0x0019]: initializing channel: from_cache: False
2021-12-04 14:01:37 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0xC7F3:1:0x0019]: finished channel initialization
2021-12-04 14:01:37 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0xC7F3:1:0x0000]: 'async_initialize' stage succeeded
2021-12-04 14:01:37 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0xC7F3:1:0x0019]: 'async_initialize' stage succeeded
2021-12-04 14:01:37 ERROR (MainThread) [frontend.js.latest.202111090] http://192.168.0.141:8123/frontend_latest/e4759b05.js:246:519 Uncaught TypeError: Cannot read properties of undefined (reading 'get')
2021-12-04 14:01:37 ERROR (MainThread) [frontend.js.latest.202111090] http://192.168.0.141:8123/frontend_latest/e4759b05.js:246:519 Uncaught TypeError: Cannot read properties of undefined (reading 'get')
2021-12-04 14:01:37 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0xC7F3](TS0601): power source: Battery or Unknown
2021-12-04 14:01:37 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0xC7F3](TS0601): completed initialization
```

**Additional context**
I was trying around to add it but im noob in this



Discussion:
I have making 2 files with added your device ID that shall making it  working.
[ts0601_trv.zip](https://github.com/zigpy/zha-device-handlers/files/7654014/ts0601_trv.zip)
First you need configuring local quirks in HA https://github.com/zigpy/zha-device-handlers/discussions/693#discussioncomment-857274 and then copy the unzipped `ts0601_trv.py` the your new mande local quirk forder.

Then you also need copy the `climate.py` in to the HA docker container or the presets is not working. 
First copy the unzipped `climate.py` to your HA configuration directory.
Then copy it in to the container with this commands from the HA docker container CLI:
```
cp /config/climate.py  /usr/src/homeassistant/homeassistant/components/zha/climate.py 
```
and restarting HA and you shall getting one TRV in your device card.

Instruction how open one CLI in HA docker container https://github.com/zigpy/zha-device-handlers#testing-quirks-in-development-in-docker-based-install.

This is the normal quirk but one user is making one new with more setting that you can trying if you like if this is working well.


By the was CN-Hysen (manufacturer of this device) have before using the same device ID for all devices but this is the 3 new in 2 weeks so its looks they have changing strategy.

Do you have one brand and model name of this device  and also one link if you can finding it.

Edit: you have the brand and name in the topic :-))
It is working now, many thanks for your help
## Great !!
I making one PR for adding it in ZHA so you and other user dont need doing the addin after updating HA.
If you like testing one new quirk with more functions look at this post https://github.com/zigpy/zha-device-handlers/issues/1178#issuecomment-980294492.
Its need more testing but is trying getting all out if the TRV in ZHA GUI.

(its needs the `climate.py` that you have installing but you shall deleting the custom quirrk `ts0601_trv.py` if you is using the new one so you dont  getting collisions)
Sure ill look into it im quite new to HA and ZHA, but i would like to get into it. thx once more
I like brave users !!!

If you is testing you can always going back to the first version if you like and shall not being any problems only need restart HA between :-)))

Resolving patch:
diff --git a/zhaquirks/tuya/ts0601_trv.py b/zhaquirks/tuya/ts0601_trv.py
--- a/zhaquirks/tuya/ts0601_trv.py
+++ b/zhaquirks/tuya/ts0601_trv.py
@@ -1062,6 +1062,8 @@ def __init__(self, *args, **kwargs):
             ("_TZE200_ywdxldoj", "TS0601"),
             ("_TZE200_cwnjrr72", "TS0601"),
             ("_TZE200_2atgpdho", "TS0601"),
+            ("_TZE200_pvvbommb", "TS0601"),
+            ("_TZE200_4eeyebrt", "TS0601"),
         ],
         ENDPOINTS: {
             1: {


Test patch: