Skip to content
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] Improving "TS0601" "_TZE200_b6wax7g0" TRV thermostatic radiator valve #1123

Closed
Youpimatin opened this issue Nov 3, 2021 · 387 comments
Labels
stale Issue is inactivate and might get closed soon Tuya Request/PR regarding a Tuya device

Comments

@Youpimatin
Copy link

Youpimatin commented Nov 3, 2021

Hello,
(I didn't know where I should post, so feel free to merge with the relevant subject if there is one in particular, maybe in the discussions, I don't know.)
I bought a dozen of these TRV (on Amazon.fr, Qiumi brand) to install in my house : https://zigbee.blakadder.com/Beca_BRT-100.html
I chose them because I looked at the blackladder page and saw it was supported in ZHA (and Zigbee2MQTT)
In reality it's not the case for all parameters (battery, child lock, window detection)

I used custom_zha_quirk ts0601_trv.py (dated 2021-09-22) "ts0601_trv.MoesHY368_Type1new"

There are 3 entities :

  • Thermostat (Temperature set and sensed in 1°C increments (0.5°C increments on the valve... even if 0.1°C would be more useful for the temperature sensor))
  • on/off switch (I did play with it but don't understand what is it for)
  • power (unkwnown value, maybe updated only when battery voltage is below 1.8V)

I didn't want to install Tuya app on my phone to check if these others parameters are supported, but if the user manual is correct, on the image shown, you can see :

  • battery percentage
  • countdown for the duration of boost heating
  • the mode (Auto / Manual / TempHand(?) / Holidays)
  • weekly programming
  • ...

On the valve, you can also see if it's open or closed (just a LED, it's binary),
in reality I counted a minimum of 5 positions of the motor (maybe 0%, 25%, 50%, 75%, 100%),
this would be really cool if the position was published ! (even more if we could force a position)

Other settings exists in the documentation, you can change or check them in the valve menus :

  • Temperature compensation (-9 to +9°C)
  • Window open detection temperature drop / time
  • Min setting temp (5°C to 15°C)
  • Max setting temp (15°C to 35°C)
  • Boost heating coutdown (100s to 900s)
  • Dead zone (0.5°C to 5°C)
  • Energy saving mode / temp
  • Low temp protection (0°C to 5°C)
  • Standby screen brightness
  • Factory reset
  • Version number

Pairing log :

[0x0000:zdo] ZDO request ZDOCmd.Mgmt_Permit_Joining_req: [60, <Bool.false: 0>]
[0xf01e] Delivery error for seq # 0x65, on endpoint id 0 cluster 0x0034: message send failure
Sending 'zdo_leave_req' failed: [0xf01e:0:0x0034]: Message send failure
Device 0xc7f4 (84:fd:27:ff:fe:a5:a9:fb) joined the network
[0xc7f4] Requesting 'Node Descriptor'
Tries remaining: 2
[0xc7f4] Extending timeout for 0x6a request
Device 0xc7f4 (84:fd:27:ff:fe:a5:a9:fb) joined the network
Skip initialization for existing device 84:fd:27:ff:fe:a5:a9:fb
Device 0xc7f4 (84:fd:27:ff:fe:a5:a9:fb) joined the network
Skip initialization for existing device 84:fd:27:ff:fe:a5:a9:fb
[0xc7f4:zdo] ZDO request ZDOCmd.Device_annce: [0xC7F4, 84:fd:27:ff:fe:a5:a9:fb, 128]
[0xc7f4] Node Descriptor: NodeDescriptor(byte1=2, byte2=64, mac_capability_flags=128, manufacturer_code=4098, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=0, *allocate_address=True, *complex_descriptor_available=False, *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, *is_valid=True, *logical_type=<LogicalType.EndDevice: 2>, *user_descriptor_available=False)
[0xc7f4] Discovering endpoints
Tries remaining: 3
[0xc7f4] Extending timeout for 0x6c request
[0xc7f4] Discovered endpoints: [1]
[0xc7f4:1] Discovering endpoint information
Tries remaining: 3
[0xc7f4] Extending timeout for 0x6e request
[0xc7f4:1] Discovered endpoint information: SizePrefixedSimpleDescriptor(endpoint=1, profile=260, device_type=81, device_version=1, input_clusters=[0, 4, 5, 61184], output_clusters=[25, 10])
Unknown cluster 61184
[0xc7f4] Extending timeout for 0x70 request
[0xc7f4:1:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=112 command_id=Command.Read_Attributes_rsp>
[0xc7f4:1] Manufacturer: _TZE200_b6wax7g0
[0xc7f4:1] Model: TS0601
Checking quirks for _TZE200_b6wax7g0 TS0601 (84:fd:27:ff:fe:a5:a9:fb)
Considering <class 'ts0601_trv.MoesHY368_Type1new'>
Found custom device replacement for 84:fd:27:ff:fe:a5:a9:fb: <class 'ts0601_trv.MoesHY368_Type1new'>
device - 0xC7F4:84:fd:27:ff:fe:a5:a9:fb entering async_device_initialized - is_new_join: True
device - 0xC7F4:84:fd:27:ff:fe:a5:a9:fb has joined the ZHA zigbee network
[0xC7F4](TS0601): started configuration
[0xC7F4:ZDO](TS0601): 'async_configure' stage succeeded
[0xC7F4:1:0x0201]: bound 'thermostat' cluster: Status.SUCCESS
[0xC7F4:1:0x0201]: attr reporting for '{'local_temp': (30, 900, 25), 'occupied_cooling_setpoint': (30, 900, 25), 'occupied_heating_setpoint': (30, 900, 25), 'unoccupied_cooling_setpoint': (30, 900, 25)}' on 'thermostat': ConfigureReportingResponseRecord(status=0)
[0xC7F4:1:0x0201]: attr reporting for '{'unoccupied_heating_setpoint': (30, 900, 25), 'running_mode': (30, 900, 25), 'running_state': (30, 900, 5), 'system_mode': (30, 900, 25)}' on 'thermostat': ConfigureReportingResponseRecord(status=0)
[0xC7F4:1:0x0201]: attr reporting for '{'occupancy': (30, 900, 1), 'pi_cooling_demand': (30, 900, 5), 'pi_heating_demand': (30, 900, 5)}' on 'thermostat': ConfigureReportingResponseRecord(status=0)
[0xC7F4:1:0x0201]: finished channel configuration
[0xC7F4:1:0x0006]: bound 'on_off' cluster: Status.SUCCESS
[0xC7F4:1:0x0006]: reporting 'on_off' attr on 'on_off' cluster: 0/900/1: Result: '[ConfigureReportingResponseRecord(status=0)]'
[0xC7F4:1:0x0000]: finished channel configuration
[0xC7F4:1:0x0001]: bound 'power' cluster: Status.SUCCESS
[0xC7F4:1:0x0001]: reporting 'battery_voltage' attr on 'power' cluster: 3600/10800/1: Result: '[ConfigureReportingResponseRecord(status=0)]'
[0xC7F4:1:0x0019]: finished channel configuration
[0xC7F4:1:0x0201]: 'async_configure' stage succeeded
[0xC7F4:1:0x0006]: 'async_configure' stage failed: 'ConfigureReportingResponseRecord' object is not subscriptable
[0xC7F4:1:0x0000]: 'async_configure' stage succeeded
[0xC7F4:1:0x0001]: 'async_configure' stage failed: 'ConfigureReportingResponseRecord' object is not subscriptable
[0xC7F4:1:0x0019]: 'async_configure' stage succeeded
[0xC7F4](TS0601): completed configuration
[0xC7F4](TS0601): stored in registry: ZhaDeviceEntry(name='_TZE200_b6wax7g0 TS0601', ieee='84:fd:27:ff:fe:a5:a9:fb', last_seen=1635928619.9460387)
[0xC7F4](TS0601): started initialization
[0xC7F4:ZDO](TS0601): 'async_initialize' stage succeeded
[0xC7F4:1:0x0201]: initializing channel: from_cache: False
[0xC7F4:1:0x0201]: Attribute report 'MoesThermostatNew'[system_mode] = SystemMode.Heat
[0xC7F4:1:0x0201]: read attributes: Success: {}. Failed: {'abs_min_heat_setpoint_limit': <Status.UNSUPPORTED_ATTRIBUTE: 134>, 'abs_max_heat_setpoint_limit': <Status.UNSUPPORTED_ATTRIBUTE: 134>, 'abs_min_cool_setpoint_limit': <Status.UNSUPPORTED_ATTRIBUTE: 134>, 'abs_max_cool_setpoint_limit': <Status.UNSUPPORTED_ATTRIBUTE: 134>}
[0xC7F4:1:0x0201]: read attributes: Success: {}. Failed: {'max_cool_setpoint_limit': <Status.UNSUPPORTED_ATTRIBUTE: 134>, 'max_heat_setpoint_limit': <Status.UNSUPPORTED_ATTRIBUTE: 134>, 'min_cool_setpoint_limit': <Status.UNSUPPORTED_ATTRIBUTE: 134>, 'min_heat_setpoint_limit': <Status.UNSUPPORTED_ATTRIBUTE: 134>}
[0xC7F4:1:0x0201]: Attribute report 'MoesThermostatNew'[ctrl_seqe_of_oper] = ControlSequenceOfOperation.Heating_Only
[0xC7F4:1:0x0201]: read attributes: Success: {'ctrl_seqe_of_oper': <ControlSequenceOfOperation.Heating_Only: 2>}. Failed: {'local_temp': <Status.UNSUPPORTED_ATTRIBUTE: 134>, 'occupancy': <Status.UNSUPPORTED_ATTRIBUTE: 134>, 'occupied_cooling_setpoint': <Status.UNSUPPORTED_ATTRIBUTE: 134>}
[0xC7F4:1:0x0201]: read attributes: Success: {}. Failed: {'occupied_heating_setpoint': <Status.UNSUPPORTED_ATTRIBUTE: 134>, 'pi_cooling_demand': <Status.UNSUPPORTED_ATTRIBUTE: 134>, 'pi_heating_demand': <Status.UNSUPPORTED_ATTRIBUTE: 134>, 'running_mode': <Status.UNSUPPORTED_ATTRIBUTE: 134>}
[0xC7F4:1:0x0201]: Attribute report 'MoesThermostatNew'[system_mode] = SystemMode.Heat
[0xC7F4:1:0x0201]: read attributes: Success: {'system_mode': <SystemMode.Heat: 4>}. Failed: {'running_state': <Status.UNSUPPORTED_ATTRIBUTE: 134>, 'unoccupied_heating_setpoint': <Status.UNSUPPORTED_ATTRIBUTE: 134>, 'unoccupied_cooling_setpoint': <Status.UNSUPPORTED_ATTRIBUTE: 134>}
[0xC7F4:1:0x0201]: finished channel configuration
[0xC7F4:1:0x0006]: initializing channel: from_cache: False
[0xC7F4:1:0x0006]: finished channel configuration
[0xC7F4:1:0x0000]: initializing channel: from_cache: False
[0xC7F4:1:0x0000]: finished channel configuration
[0xC7F4:1:0x0001]: initializing channel: from_cache: False
[0xC7F4:1:0x0001]: finished channel configuration
[0xC7F4:1:0x0019]: initializing channel: from_cache: False
[0xC7F4:1:0x0019]: finished channel configuration
[0xC7F4:1:0x0201]: 'async_initialize' stage succeeded
[0xC7F4:1:0x0006]: 'async_initialize' stage succeeded
[0xC7F4:1:0x0000]: 'async_initialize' stage succeeded
[0xC7F4:1:0x0001]: 'async_initialize' stage succeeded
[0xC7F4:1:0x0019]: 'async_initialize' stage succeeded
[0xC7F4](TS0601): power source: Battery or Unknown
[0xC7F4](TS0601): completed initialization
[0xC7F4:1:0x0006]: attempting to update onoff state - from cache: True
[0xc7f4:zdo] ZDO request ZDOCmd.Node_Desc_req: [0x0000]
[0xc7f4:zdo] Unsupported ZDO request:ZDOCmd.Node_Desc_req
[0xc7f4:1:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=38 command_id=Command.Report_Attributes>
[0xc7f4:1:0x0000] ZCL request 0x000a: [[Attribute(attrid=1, value=<TypeValue type=uint8_t, value=64>), Attribute(attrid=65506, value=<TypeValue type=uint8_t, value=31>), Attribute(attrid=65508, value=<TypeValue type=uint8_t, value=0>)]]
[0xc7f4:1:0x0000] Attribute report received: app_version=64, 65506=31, 65508=0
[0x6599:11:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=40 command_id=Command.Report_Attributes>
[0x6599:11:0x0000] ZCL request 0x000a: [[Attribute(attrid=1, value=<TypeValue type=uint8_t, value=66>)]]
[0x6599:11:0x0000] Attribute report received: app_version=66
[0xc7f4:1:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=39 command_id=Command.Report_Attributes>
[0xc7f4:1:0x0000] ZCL request 0x000a: [[Attribute(attrid=65503, value=<TypeValue type=CharacterString, value=5��)�T��)�U��)�>)]]
[0xc7f4:1:0x0000] Attribute report received: 65503=5��)�T��)�U��)�
[0xc7f4:1:0x000a] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=40 command_id=Command.Read_Attributes>
[0xc7f4:1:0x000a] ZCL request 0x0000: [[7]]
[0xc7f4:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=41 command_id=1>
[0xc7f4:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=155, command_id=1025, function=0, data=[1, 1])]
[0xc7f4:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=42 command_id=1>
[0xc7f4:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=156, command_id=514, function=0, data=[4, 0, 0, 0, 15])]
[0xC7F4:1:0x0201]: Attribute report 'MoesThermostatNew'[occupied_heating_setpoint] = 1500
climate.tze200_b6wax7g0_ts0601_fba9a5fe_thermostat: Attribute 'occupied_heating_setpoint' = 1500 update
[0xc7f4:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=43 command_id=1>
[0xc7f4:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=157, command_id=515, function=0, data=[4, 0, 0, 0, 180])]
[0xC7F4:1:0x0201]: Attribute report 'MoesThermostatNew'[local_temp] = 1800
climate.tze200_b6wax7g0_ts0601_fba9a5fe_thermostat: Attribute 'local_temp' = 1800 update
[0xc7f4:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=44 command_id=1>
[0xc7f4:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=158, command_id=260, function=0, data=[1, 0])]
[0xc7f4:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=45 command_id=1>
[0xc7f4:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=159, command_id=517, function=0, data=[4, 0, 0, 0, 0])]
[0xc7f4:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=46 command_id=1>
[0xc7f4:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=160, command_id=1031, function=0, data=[1, 1])]
[0xc7f4:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=47 command_id=1>
[0xc7f4:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=161, command_id=264, function=0, data=[1, 0])]
[0xc7f4:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=48 command_id=1>
[0xc7f4:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=162, command_id=1033, function=0, data=[1, 1])]
[0xc7f4:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=49 command_id=1>
[0xc7f4:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=163, command_id=269, function=0, data=[1, 0])]
[0xc7f4:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=50 command_id=1>
[0xc7f4:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=164, command_id=526, function=0, data=[4, 0, 0, 0, 58])]
[0xc7f4:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=51 command_id=1>
[0xc7f4:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=165, command_id=101, function=0, data=[36, 6, 0, 40, 11, 30, 42, 13, 30, 44, 17, 30, 46, 6, 0, 48, 12, 0, 46, 14, 30, 44, 17, 30, 42, 6, 0, 38, 12, 30, 40, 14, 30, 42, 18, 30, 40])]
[0xc7f4:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=52 command_id=1>
[0xc7f4:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=166, command_id=615, function=0, data=[4, 0, 0, 1, 44])]
[0xC7F4:1:0x0201]: Attribute report 'MoesThermostatNew'[max_heat_setpoint_limit] = 30000
climate.tze200_b6wax7g0_ts0601_fba9a5fe_thermostat: Attribute 'max_heat_setpoint_limit' = 30000 update
[0xc7f4:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=53 command_id=1>
[0xc7f4:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=167, command_id=616, function=0, data=[4, 0, 0, 0, 0])]
[0xc7f4:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=54 command_id=1>
[0xc7f4:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=168, command_id=617, function=0, data=[4, 0, 0, 0, 0])]
[0xC7F4:1:0x0201]: Attribute report 'MoesThermostatNew'[boost_duration_seconds] = 0
climate.tze200_b6wax7g0_ts0601_fba9a5fe_thermostat: Attribute 'boost_duration_seconds' = 0 update
[0xc7f4:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=55 command_id=1>
[0xc7f4:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=169, command_id=362, function=0, data=[1, 0])]
[0xc7f4:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=56 command_id=1>
[0xc7f4:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=170, command_id=619, function=0, data=[4, 0, 0, 0, 20])]
[0xC7F4:1:0x0201]: Attribute report 'MoesThermostatNew'[comfort_heating_setpoint] = 2000
climate.tze200_b6wax7g0_ts0601_fba9a5fe_thermostat: Attribute 'comfort_heating_setpoint' = 2000 update
[0xae6a:1:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=97 command_id=Command.Report_Attributes>
[0xae6a:1:0x0000] ZCL request 0x000a: [[Attribute(attrid=1, value=<TypeValue type=uint8_t, value=69>)]]
[0xae6a:1:0x0000] Attribute report received: app_version=69
[0xc7f4:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=57 command_id=1>
[0xc7f4:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=171, command_id=620, function=0, data=[4, 0, 0, 0, 45])]
[0xC7F4:1:0x0201]: Attribute report 'MoesThermostatNew'[eco_heating_setpoint] = 4500
climate.tze200_b6wax7g0_ts0601_fba9a5fe_thermostat: Attribute 'eco_heating_setpoint' = 4500 update
[0xc7f4:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=58 command_id=1>
[0xc7f4:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=172, command_id=621, function=0, data=[4, 0, 0, 0, 5])]
[0xC7F4:1:0x0201]: Attribute report 'MoesThermostatNew'[valve_open_percentage] = 5
[0xC7F4:1:0x0201]: Attribute report 'MoesThermostatNew'[running_mode] = RunningMode.Heat
[0xC7F4:1:0x0201]: Attribute report 'MoesThermostatNew'[running_state] = RunningState.Heat_State_On
climate.tze200_b6wax7g0_ts0601_fba9a5fe_thermostat: Attribute 'valve_open_percentage' = 5 update
climate.tze200_b6wax7g0_ts0601_fba9a5fe_thermostat: Attribute 'running_mode' = RunningMode.Heat update
climate.tze200_b6wax7g0_ts0601_fba9a5fe_thermostat: Attribute 'running_state' = RunningState.Heat_State_On update
[0xc7f4:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=59 command_id=36>
[0xc7f4:1:0xef00] ZCL request 0x0024: [[0, 155]]
[0xc7f4:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=True is_reply=True disable_default_response=False> manufacturer=4098 tsn=135 command_id=Command.Default_Response>
[0x05a5:1:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=35 command_id=Command.Report_Attributes>
[0x05a5:1:0x0000] ZCL request 0x000a: [[Attribute(attrid=1, value=<TypeValue type=uint8_t, value=69>)]]
[0x05a5:1:0x0000] Attribute report received: app_version=69
[0xc7f4:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=60 command_id=17>
[0xc7f4:1:0xef00] Unknown cluster-specific command 17
[0xc7f4:1:0xef00] ZCL request 0x0011: b'\x00\x9c@'
[0xc7f4:1:0xef00] No handler for cluster command 17
[0xc7f4:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=60 command_id=17>
[0xc7f4:1:0xef00] Unknown cluster-specific command 17
[0xc7f4:1:0xef00] ZCL request 0x0011: b'\x00\x9c@'
[0xc7f4:1:0xef00] No handler for cluster command 17
[0x8e5a:3:0x0006] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=23 command_id=Command.Report_Attributes>
[0x8e5a:3:0x0006] ZCL request 0x000a: [[Attribute(attrid=0, value=<TypeValue type=Bool, value=Bool.false>)]]
[0x8e5a:3:0x0006] Attribute report received: on_off=0
[0xeb95:11:0x0006] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=80 command_id=Command.Report_Attributes>
[0xeb95:11:0x0006] ZCL request 0x000a: [[Attribute(attrid=0, value=<TypeValue type=Bool, value=Bool.false>)]]
[0xeb95:11:0x0006] Attribute report received: on_off=0
[0xb2d6:1:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=120 command_id=Command.Report_Attributes>
[0xb2d6:1:0x0000] ZCL request 0x000a: [[Attribute(attrid=1, value=<TypeValue type=uint8_t, value=69>)]]
[0xb2d6:1:0x0000] Attribute report received: app_version=69
[0xff60:11:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=126 command_id=Command.Report_Attributes>
[0xff60:11:0x0000] ZCL request 0x000a: [[Attribute(attrid=1, value=<TypeValue type=uint8_t, value=66>)]]
[0xff60:11:0x0000] Attribute report received: app_version=66

Device signature :

{
  "node_descriptor": "NodeDescriptor(byte1=2, byte2=64, mac_capability_flags=128, manufacturer_code=4098, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=0, *allocate_address=True, *complex_descriptor_available=False, *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, *is_valid=True, *logical_type=<LogicalType.EndDevice: 2>, *user_descriptor_available=False)",
  "endpoints": {
    "1": {
      "profile_id": 260,
      "device_type": "0x0301",
      "in_clusters": [
        "0x0000",
        "0x0001",
        "0x0004",
        "0x0005",
        "0x0006",
        "0x0201",
        "0x0204",
        "0xef00"
      ],
      "out_clusters": [
        "0x000a",
        "0x0019"
      ]
    }
  },
  "manufacturer": "_TZE200_b6wax7g0",
  "model": "TS0601",
  "class": "ts0601_trv.MoesHY368_Type1new"
}

I don't kow zigbee, and don't know how I can help, but here is the information I can get.
I can test anything to get more information, or modified quirks ...

I don't mind if it breaks temporarily my house heating (I have only two of these valves installed for now)

@MattWestb
Copy link
Contributor

MattWestb commented Nov 3, 2021

I can not answering all your question then i dont have the TRV but some i can.
This TRV is only supporting setting the temperature and reporting it in 1.0° C and its one fix for getting it right in ZHA (it was 10 off) Its one open request for it #1082 merged on 22 October.
The TRV is not reporting battery % only battery low.
Its one TRV and and dont have one "off" mode then its always working and have antifreeze protection but i thing the switch is trying simulating turning it off.
If you like turning the TRV on and off you is loosing algorithm for keeping the temperature in the room (its taking over one day for the TRV to calculating it) and and is better having one manual central valve for you heating and truing it on and off then you like it war or cold.
The TRV mode changes shall being possible doing with presets on the GUI (the . . .) as presets and also Schedule shall being implanted but you must do the setting of it on the cluster and the other things you is missing is implanted on the device clusters so you can using them in automatons.
You need looking on the Moes clusters and finding your functions and how to using them in your automation and implanting them in one custom card you is making for getting all working all the way.

@Youpimatin
Copy link
Author

Thanks for the answers.

There is another problem in the thermostat min-max values, they seem to be off by a factor of 10 (at least the max is 300 when it should be 30 maybe.... for the min I don't know if it should be 7°C or 0.7°C)

Mini-Maxi

I'm surprised for the 1°C increment (maybe the translation of the values is not optimal, does the values come from the valve in tenth of a degree ?)
I must find how to spy on the ZHA communication channel, to see how are the raw values transmitted by the TRV.

I also found this page from zigbee2mqtt : BRT-100-TRV
It is said that the battery values and the valve opening are published in %

@MattWestb
Copy link
Contributor

The min and max setpoint you is setting and reading on the thermostat cluster (0x0201) with attribute 0x0015 and 0x0016.

For see what the TRV is sending and ZHA is sending to it you shall configuring in HA:

    zhaquirks.tuya: debug

The set the min and max on the cluster and see what is possible setting on the TRV and what ZHA is is putting in for limits in the GUI.

With the 1°C is somthing that is made in the TRVs firmware and is out of our control and cant being fixed in our side.

I think your 300.0 °C is because you have setting somthing out of range for the TRV and 7.0°C is standard under limit in ZHA if you not have setting it on the cluster.

PR for fixing not good working functions is more then welcome !!

@jacekk015
Copy link
Contributor

@Youpimatin if you wanna to move this forward please enable debug logging in configuration.yaml

logger:
  default: info
  logs:
    homeassistant.components.zha: debug
    zigpy: debug
    zhaquirks: debug

and the resend pairing log

@MattWestb
Copy link
Contributor

I think the fix is working OK but the implementation is little not so elegant and can being better made then making more or less one new device instead for one If / else and changing the setpoing in the quirk.
#1082

@jacekk015
Copy link
Contributor

jacekk015 commented Nov 7, 2021

The problem is[with temperature] that someone is using uint, which is unsigned int type and try to put a float type in it

2021-07-30 12:39:37 DEBUG (MainThread) [zhaquirks.tuya] [0xda0c:1:0x0201] Mapping standard occupied_heating_setpoint (0x0012) with value 2650 to custom {514: **26.5**}
2021-07-30 12:39:38 DEBUG (MainThread) [zhaquirks.tuya] [0xda0c:1:0xef00] Received value [0, 0, 0, 26] for attribute 0x0202 (command 0x0001)
MOES_TARGET_TEMP_ATTR: ("target_temperature", **t.uint32_t**),

Besides I would like to see a full proper DEBUG log, to exclude any mistakes and misunderstandings.

@Youpimatin
Copy link
Author

Youpimatin commented Nov 8, 2021

OK, I thought i was in debug mode for the log, but here is a new attempt :
(it's the content of the log from the pairing page of ZHA, is it the good one, or do we need the general log from HA?)

[0x0000:zdo] ZDO request ZDOCmd.Mgmt_Permit_Joining_req: [60, <Bool.false: 0>]
Device 0xef69 (84:fd:27:ff:fe:a5:a9:fb) joined the network
[0xef69] Requesting 'Node Descriptor'
Tries remaining: 2
[0xef69] Extending timeout for 0xe1 request
Device 0xef69 (84:fd:27:ff:fe:a5:a9:fb) joined the network
Skip initialization for existing device 84:fd:27:ff:fe:a5:a9:fb
Device 0xef69 (84:fd:27:ff:fe:a5:a9:fb) joined the network
Skip initialization for existing device 84:fd:27:ff:fe:a5:a9:fb
[0xef69:zdo] ZDO request ZDOCmd.Device_annce: [0xEF69, 84:fd:27:ff:fe:a5:a9:fb, 128]
[0xef69] Node Descriptor: NodeDescriptor(byte1=2, byte2=64, mac_capability_flags=128, manufacturer_code=4098, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=0, *allocate_address=True, *complex_descriptor_available=False, *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, *is_valid=True, *logical_type=<LogicalType.EndDevice: 2>, *user_descriptor_available=False)
[0xef69] Discovering endpoints
Tries remaining: 3
[0xef69] Extending timeout for 0xe3 request
[0xef69] Discovered endpoints: [1]
[0xef69:1] Discovering endpoint information
Tries remaining: 3
[0xef69] Extending timeout for 0xe5 request
[0xef69:1] Discovered endpoint information: SizePrefixedSimpleDescriptor(endpoint=1, profile=260, device_type=81, device_version=1, input_clusters=[0, 4, 5, 61184], output_clusters=[25, 10])
Unknown cluster 61184
[0xef69] Extending timeout for 0xe7 request
[0xef69:1:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=231 command_id=Command.Read_Attributes_rsp>
[0xef69:1] Manufacturer: _TZE200_b6wax7g0
[0xef69:1] Model: TS0601
Checking quirks for _TZE200_b6wax7g0 TS0601 (84:fd:27:ff:fe:a5:a9:fb)
Considering <class 'ts0601_trv.MoesHY368_Type1new'>
Found custom device replacement for 84:fd:27:ff:fe:a5:a9:fb: <class 'ts0601_trv.MoesHY368_Type1new'>
device - 0xEF69:84:fd:27:ff:fe:a5:a9:fb entering async_device_initialized - is_new_join: True
device - 0xEF69:84:fd:27:ff:fe:a5:a9:fb has joined the ZHA zigbee network
[0xEF69](TS0601): started configuration
[0xEF69:ZDO](TS0601): 'async_configure' stage succeeded
[0xEF69:1:0x0201]: bound 'thermostat' cluster: Status.SUCCESS
[0xEF69:1:0x0201]: attr reporting for '{'local_temp': (30, 900, 25), 'occupied_cooling_setpoint': (30, 900, 25), 'occupied_heating_setpoint': (30, 900, 25), 'unoccupied_cooling_setpoint': (30, 900, 25)}' on 'thermostat': ConfigureReportingResponseRecord(status=0)
[0xEF69:1:0x0201]: attr reporting for '{'unoccupied_heating_setpoint': (30, 900, 25), 'running_mode': (30, 900, 25), 'running_state': (30, 900, 5), 'system_mode': (30, 900, 25)}' on 'thermostat': ConfigureReportingResponseRecord(status=0)
[0xEF69:1:0x0201]: attr reporting for '{'occupancy': (30, 900, 1), 'pi_cooling_demand': (30, 900, 5), 'pi_heating_demand': (30, 900, 5)}' on 'thermostat': ConfigureReportingResponseRecord(status=0)
[0xEF69:1:0x0201]: finished channel configuration
[0xEF69:1:0x0006]: bound 'on_off' cluster: Status.SUCCESS
[0xEF69:1:0x0006]: reporting 'on_off' attr on 'on_off' cluster: 0/900/1: Result: '[ConfigureReportingResponseRecord(status=0)]'
[0xEF69:1:0x0000]: finished channel configuration
[0xEF69:1:0x0001]: bound 'power' cluster: Status.SUCCESS
[0xEF69:1:0x0001]: reporting 'battery_voltage' attr on 'power' cluster: 3600/10800/1: Result: '[ConfigureReportingResponseRecord(status=0)]'
[0xEF69:1:0x0019]: finished channel configuration
[0xEF69:1:0x0201]: 'async_configure' stage succeeded
[0xEF69:1:0x0006]: 'async_configure' stage failed: 'ConfigureReportingResponseRecord' object is not subscriptable
[0xEF69:1:0x0000]: 'async_configure' stage succeeded
[0xEF69:1:0x0001]: 'async_configure' stage failed: 'ConfigureReportingResponseRecord' object is not subscriptable
[0xEF69:1:0x0019]: 'async_configure' stage succeeded
[0xEF69](TS0601): completed configuration
[0xEF69](TS0601): stored in registry: ZhaDeviceEntry(name='_TZE200_b6wax7g0 TS0601', ieee='84:fd:27:ff:fe:a5:a9:fb', last_seen=1636306009.3184533)
[0xEF69](TS0601): started initialization
[0xEF69:ZDO](TS0601): 'async_initialize' stage succeeded
[0xEF69:1:0x0201]: initializing channel: from_cache: False
[0xEF69:1:0x0201]: Attribute report 'MoesThermostatNew'[system_mode] = SystemMode.Heat
[0xEF69:1:0x0201]: read attributes: Success: {}. Failed: {'abs_min_heat_setpoint_limit': <Status.UNSUPPORTED_ATTRIBUTE: 134>, 'abs_max_heat_setpoint_limit': <Status.UNSUPPORTED_ATTRIBUTE: 134>, 'abs_min_cool_setpoint_limit': <Status.UNSUPPORTED_ATTRIBUTE: 134>, 'abs_max_cool_setpoint_limit': <Status.UNSUPPORTED_ATTRIBUTE: 134>}
[0xEF69:1:0x0201]: read attributes: Success: {}. Failed: {'max_cool_setpoint_limit': <Status.UNSUPPORTED_ATTRIBUTE: 134>, 'max_heat_setpoint_limit': <Status.UNSUPPORTED_ATTRIBUTE: 134>, 'min_cool_setpoint_limit': <Status.UNSUPPORTED_ATTRIBUTE: 134>, 'min_heat_setpoint_limit': <Status.UNSUPPORTED_ATTRIBUTE: 134>}
[0xEF69:1:0x0201]: Attribute report 'MoesThermostatNew'[ctrl_seqe_of_oper] = ControlSequenceOfOperation.Heating_Only
[0xEF69:1:0x0201]: read attributes: Success: {'ctrl_seqe_of_oper': <ControlSequenceOfOperation.Heating_Only: 2>}. Failed: {'local_temp': <Status.UNSUPPORTED_ATTRIBUTE: 134>, 'occupancy': <Status.UNSUPPORTED_ATTRIBUTE: 134>, 'occupied_cooling_setpoint': <Status.UNSUPPORTED_ATTRIBUTE: 134>}
[0xEF69:1:0x0201]: read attributes: Success: {}. Failed: {'occupied_heating_setpoint': <Status.UNSUPPORTED_ATTRIBUTE: 134>, 'pi_cooling_demand': <Status.UNSUPPORTED_ATTRIBUTE: 134>, 'pi_heating_demand': <Status.UNSUPPORTED_ATTRIBUTE: 134>, 'running_mode': <Status.UNSUPPORTED_ATTRIBUTE: 134>}
[0xEF69:1:0x0201]: Attribute report 'MoesThermostatNew'[system_mode] = SystemMode.Heat
[0xEF69:1:0x0201]: read attributes: Success: {'system_mode': <SystemMode.Heat: 4>}. Failed: {'running_state': <Status.UNSUPPORTED_ATTRIBUTE: 134>, 'unoccupied_heating_setpoint': <Status.UNSUPPORTED_ATTRIBUTE: 134>, 'unoccupied_cooling_setpoint': <Status.UNSUPPORTED_ATTRIBUTE: 134>}
[0xEF69:1:0x0201]: finished channel configuration
[0xEF69:1:0x0006]: initializing channel: from_cache: False
[0xEF69:1:0x0006]: finished channel configuration
[0xEF69:1:0x0000]: initializing channel: from_cache: False
[0xEF69:1:0x0000]: finished channel configuration
[0xEF69:1:0x0001]: initializing channel: from_cache: False
[0xEF69:1:0x0001]: finished channel configuration
[0xEF69:1:0x0019]: initializing channel: from_cache: False
[0xEF69:1:0x0019]: finished channel configuration
[0xEF69:1:0x0201]: 'async_initialize' stage succeeded
[0xEF69:1:0x0006]: 'async_initialize' stage succeeded
[0xEF69:1:0x0000]: 'async_initialize' stage succeeded
[0xEF69:1:0x0001]: 'async_initialize' stage succeeded
[0xEF69:1:0x0019]: 'async_initialize' stage succeeded
[0xEF69](TS0601): power source: Battery or Unknown
[0xEF69](TS0601): completed initialization
[0xEF69:1:0x0006]: attempting to update onoff state - from cache: True
[0xef69:zdo] ZDO request ZDOCmd.Node_Desc_req: [0x0000]
[0xef69:zdo] Unsupported ZDO request:ZDOCmd.Node_Desc_req
[0xef69:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=22 command_id=1>
[0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=20, command_id=616, function=0, data=[4, 0, 0, 0, 25])]
[0x4132:11:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=29 command_id=Command.Report_Attributes>
[0x4132:11:0x0000] ZCL request 0x000a: [[Attribute(attrid=1, value=<TypeValue type=uint8_t, value=66>)]]
[0x4132:11:0x0000] Attribute report received: app_version=66
[0xef69:1:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=23 command_id=Command.Report_Attributes>
[0xef69:1:0x0000] ZCL request 0x000a: [[Attribute(attrid=65503, value=<TypeValue type=CharacterString, value=���)����)����)�>)]]
[0xef69:1:0x0000] Attribute report received: 65503=���)����)����)�
[0xef69:1:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=24 command_id=Command.Report_Attributes>
[0xef69:1:0x0000] ZCL request 0x000a: [[Attribute(attrid=1, value=<TypeValue type=uint8_t, value=64>), Attribute(attrid=65506, value=<TypeValue type=uint8_t, value=31>), Attribute(attrid=65508, value=<TypeValue type=uint8_t, value=0>)]]
[0xef69:1:0x0000] Attribute report received: app_version=64, 65506=31, 65508=0
[0xef69:1:0x000a] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=25 command_id=Command.Read_Attributes>
[0xef69:1:0x000a] ZCL request 0x0000: [[7]]
[0xef69:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=26 command_id=1>
[0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=14, command_id=616, function=0, data=[4, 0, 0, 0, 50])]
[0xef69:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=27 command_id=36>
[0xef69:1:0xef00] ZCL request 0x0024: [[0, 14]]
[0xef69:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=True is_reply=True disable_default_response=False> manufacturer=4098 tsn=238 command_id=Command.Default_Response>
[0xef69:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=28 command_id=1>
[0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=14, command_id=616, function=0, data=[4, 0, 0, 0, 25])]
[0xef69:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=29 command_id=1>
[0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=15, command_id=515, function=0, data=[4, 0, 0, 0, 190])]
[0xEF69:1:0x0201]: Attribute report 'MoesThermostatNew'[local_temp] = 1900
climate.tze200_b6wax7g0_ts0601_fba9a5fe_thermostat: Attribute 'local_temp' = 1900 update
[0xef69:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=30 command_id=1>
[0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=16, command_id=526, function=0, data=[4, 0, 0, 0, 61])]
[0xef69:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=31 command_id=1>
[0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=16, command_id=616, function=0, data=[4, 0, 0, 0, 50])]
[0xef69:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=32 command_id=17>
[0xef69:1:0xef00] Unknown cluster-specific command 17
[0xef69:1:0xef00] ZCL request 0x0011: b'\x00\x10@'
[0xef69:1:0xef00] No handler for cluster command 17
[0x05a5:1:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=94 command_id=Command.Report_Attributes>
[0x05a5:1:0x0000] ZCL request 0x000a: [[Attribute(attrid=1, value=<TypeValue type=uint8_t, value=69>)]]
[0x05a5:1:0x0000] Attribute report received: app_version=69
[0xef69:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=32 command_id=17>
[0xef69:1:0xef00] Unknown cluster-specific command 17
[0xef69:1:0xef00] ZCL request 0x0011: b'\x00\x10@'
[0xef69:1:0xef00] No handler for cluster command 17
[0xef69:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=33 command_id=1>
[0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=16, command_id=514, function=0, data=[4, 0, 0, 0, 21])]
[0xEF69:1:0x0201]: Attribute report 'MoesThermostatNew'[occupied_heating_setpoint] = 2100
climate.tze200_b6wax7g0_ts0601_fba9a5fe_thermostat: Attribute 'occupied_heating_setpoint' = 2100 update
[0xef69:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=34 command_id=1>
[0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=17, command_id=517, function=0, data=[4, 0, 0, 0, 0])]
[0xef69:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=35 command_id=1>
[0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=18, command_id=526, function=0, data=[4, 0, 0, 0, 58])]
[0x8e5a:1:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=47 command_id=Command.Report_Attributes>
[0x8e5a:1:0x0000] ZCL request 0x000a: [[Attribute(attrid=1, value=<TypeValue type=uint8_t, value=69>)]]
[0x8e5a:1:0x0000] Attribute report received: app_version=69
[0xb2d6:2:0x0006] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=11 command_id=Command.Report_Attributes>
[0xb2d6:2:0x0006] ZCL request 0x000a: [[Attribute(attrid=0, value=<TypeValue type=Bool, value=Bool.false>)]]
[0xb2d6:2:0x0006] Attribute report received: on_off=0
[0xef69:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=36 command_id=1>
[0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=18, command_id=616, function=0, data=[4, 0, 0, 0, 75])]
[0xef69:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=37 command_id=1>
[0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=18, command_id=514, function=0, data=[4, 0, 0, 0, 21])]
[0xEF69:1:0x0201]: Attribute report 'MoesThermostatNew'[occupied_heating_setpoint] = 2100
climate.tze200_b6wax7g0_ts0601_fba9a5fe_thermostat: Attribute 'occupied_heating_setpoint' = 2100 update
[0xef69:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=38 command_id=1>
[0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=19, command_id=517, function=0, data=[4, 0, 0, 0, 0])]
[0xef69:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=39 command_id=1>
[0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=20, command_id=526, function=0, data=[4, 0, 0, 0, 58])]
[0xef69:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=40 command_id=1>
[0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=20, command_id=514, function=0, data=[4, 0, 0, 0, 20])]
[0xEF69:1:0x0201]: Attribute report 'MoesThermostatNew'[occupied_heating_setpoint] = 2000
climate.tze200_b6wax7g0_ts0601_fba9a5fe_thermostat: Attribute 'occupied_heating_setpoint' = 2000 update
[0xef69:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=41 command_id=1>
[0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=21, command_id=517, function=0, data=[4, 0, 0, 0, 0])]
[0xef69:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=41 command_id=1>
[0xef69:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=42 command_id=1>
[0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=22, command_id=526, function=0, data=[4, 0, 0, 0, 58])]
[0x6937:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=87 command_id=1>
[0x6937:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=190, command_id=515, function=0, data=[4, 0, 0, 0, 170])]
[0x6937:1:0x0201]: Attribute report 'MoesThermostatNew'[local_temp] = 1700
climate.samuel_thermostat: Attribute 'local_temp' = 1700 update
[0x6937:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=88 command_id=1>
[0x6937:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=191, command_id=616, function=0, data=[4, 0, 0, 0, 50])]
[0xef69:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=43 command_id=1>
[0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=22, command_id=616, function=0, data=[4, 0, 0, 0, 50])]
[0xff60:11:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=88 command_id=Command.Report_Attributes>
[0xff60:11:0x0000] ZCL request 0x000a: [[Attribute(attrid=1, value=<TypeValue type=uint8_t, value=66>)]]
[0xff60:11:0x0000] Attribute report received: app_version=66
[0xef69:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=44 command_id=1>
[0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=23, command_id=515, function=0, data=[4, 0, 0, 0, 185])]
[0xEF69:1:0x0201]: Attribute report 'MoesThermostatNew'[local_temp] = 1850
climate.tze200_b6wax7g0_ts0601_fba9a5fe_thermostat: Attribute 'local_temp' = 1850 update
[0xef69:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=45 command_id=1>
[0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=24, command_id=526, function=0, data=[4, 0, 0, 0, 61])]
[0x6599:11:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=21 command_id=Command.Report_Attributes>
[0x6599:11:0x0000] ZCL request 0x000a: [[Attribute(attrid=1, value=<TypeValue type=uint8_t, value=66>)]]
[0x6599:11:0x0000] Attribute report received: app_version=66
[0xb2d6:1:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=12 command_id=Command.Report_Attributes>
[0xb2d6:1:0x0000] ZCL request 0x000a: [[Attribute(attrid=1, value=<TypeValue type=uint8_t, value=69>)]]
[0xb2d6:1:0x0000] Attribute report received: app_version=69

@jacekk015
Copy link
Contributor

OK - that's still wrong. You need to take it from the LOGS, not pairing window.
Values and attributes are better presented there.
You see above from my example - there's DEBUG name.
It shows us better what was mapped where.

Also, since you have the TRV in your hand, and wanna to support new elements it would be nice if you play with TRV values and try to find out which attribute is for which function you wanna to have.
Something like with the room temperature:
TRV keeps it in the 515 attribute which is 0x0203 in the HEX version. Then ZHA quirk maps it to local_temp and then HA GUI shows it as a Room temp.

[0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=15, command_id=515, function=0, data=[4, 0, 0, 0, 190])]
[0xEF69:1:0x0201]: Attribute report 'MoesThermostatNew'[local_temp] = 1900

If you have options that no one other has we cannot know which attribute is responsible for which function.

For example:
Check DEBUG logs, enable Child lock, check debug logs for differences. Some attribute will be switched from [0] to [1]

What works for you now are known[I mean attributes]. Any new function you need to give us a hint which attribute use that function on TRV. We will do the rest.
Original code could be helpful - maybe some attributes are on the same numbers:
https://github.com/zigpy/zha-device-handlers/blob/dev/zhaquirks/tuya/ts0601_trv.py#L136

MOES_TARGET_TEMP_ATTR = 0x0202  # target room temp (decidegree)
MOES_TEMPERATURE_ATTR = 0x0203  # current room temp (decidegree)
MOES_MODE_ATTR = 0x0404  # [0] away [1] scheduled [2] manual [3] comfort [4] eco [5] boost [6] complex
MOES_CHILD_LOCK_ATTR = 0x0107  # [0] unlocked [1] child-locked
MOES_VALVE_DETECT_ATTR = 0x0114  # [0] do not report [1] report
MOES_TEMP_CALIBRATION_ATTR = 0x022C  # temperature calibration (decidegree)
MOES_MIN_TEMPERATURE_ATTR = 0x0266  # minimum limit of temperature setting (decidegree)
MOES_MAX_TEMPERATURE_ATTR = 0x0267  # maximum limit of temperature setting (decidegree)
MOES_WINDOW_DETECT_ATTR = 0x0068  # [0,35,5] on/off, temperature, operating time (min)
MOES_BOOST_TIME_ATTR = 0x0269  # BOOST mode operating time in (sec)
MOES_FORCE_VALVE_ATTR = 0x046A  # [0] normal [1] open [2] close
MOES_COMFORT_TEMP_ATTR = 0x026B  # comfort mode temperaure (decidegree)
MOES_ECO_TEMP_ATTR = 0x026C  # eco mode temperature (decidegree)
MOES_VALVE_STATE_ATTR = 0x026D  # opening percentage
MOES_BATTERY_LOW_ATTR = 0x016E  # battery low warning
MOES_WEEK_FORMAT_ATTR = 0x046F  # [0] 5 days [1] 6 days, [2] 7 days
MOES_AWAY_TEMP_ATTR = 0x0272  # away mode temperature (decidegree)
MOES_AUTO_LOCK_ATTR = 0x0174  # [0] auto [1] manual
MOES_AWAY_DAYS_ATTR = 0x0275  # away mode duration (days)

@Youpimatin
Copy link
Author

Youpimatin commented Nov 8, 2021

OK, here is the data from the log at the time of pairing (I expurged some obvious off-topic lines)
I posted on pastebin since it is too long for the 2^16 byte limit

I'll play with functions on the valve and check the log when i'm back home.

I can see sometimes the temperature is given with 0.5°C resolution :

2021-11-07 18:28:03 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0xEF69:1:0x0201]: Attribute report 'MoesThermostatNew'[local_temp] = 1850
...
2021-11-07 18:28:03 DEBUG (MainThread) [homeassistant.components.zha.entity] climate.tze200_b6wax7g0_ts0601_fba9a5fe_thermostat: Attribute 'local_temp' = 1850 update

@jacekk015
Copy link
Contributor

I've filtered all attributes your TRV has presented[if you didn't cut the log too quick]

2021-11-07 18:26:51 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 25] for attribute 0x0268 (command 0x0001)
2021-11-07 18:26:58 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 50] for attribute 0x0268 (command 0x0001)
2021-11-07 18:27:05 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 25] for attribute 0x0268 (command 0x0001)
2021-11-07 18:27:12 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 190] for attribute 0x0203 (command 0x0001)
2021-11-07 18:27:12 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 61] for attribute 0x020e (command 0x0001)
2021-11-07 18:27:16 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 50] for attribute 0x0268 (command 0x0001)
2021-11-07 18:27:26 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 21] for attribute 0x0202 (command 0x0001)
2021-11-07 18:27:26 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 0] for attribute 0x0205 (command 0x0001)
2021-11-07 18:27:27 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 58] for attribute 0x020e (command 0x0001)
2021-11-07 18:27:34 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 75] for attribute 0x0268 (command 0x0001)
2021-11-07 18:27:38 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 21] for attribute 0x0202 (command 0x0001)
2021-11-07 18:27:38 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 0] for attribute 0x0205 (command 0x0001)
2021-11-07 18:27:38 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 58] for attribute 0x020e (command 0x0001)
2021-11-07 18:27:46 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 20] for attribute 0x0202 (command 0x0001)
2021-11-07 18:27:47 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 0] for attribute 0x0205 (command 0x0001)
2021-11-07 18:27:47 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 58] for attribute 0x020e (command 0x0001)
2021-11-07 18:27:54 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 50] for attribute 0x0268 (command 0x0001)
2021-11-07 18:28:03 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 185] for attribute 0x0203 (command 0x0001)
2021-11-07 18:28:04 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 61] for attribute 0x020e (command 0x0001)
2021-11-07 18:29:01 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 180] for attribute 0x0203 (command 0x0001)
2021-11-07 18:29:01 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 58] for attribute 0x020e (command 0x0001)
2021-11-07 18:29:02 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 180] for attribute 0x0203 (command 0x0001)
2021-11-07 18:29:02 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 61] for attribute 0x020e (command 0x0001)
2021-11-07 18:30:02 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 180] for attribute 0x0203 (command 0x0001)
2021-11-07 18:30:02 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 58] for attribute 0x020e (command 0x0001)
2021-11-07 18:31:02 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 180] for attribute 0x0203 (command 0x0001)
2021-11-07 18:31:02 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 61] for attribute 0x020e (command 0x0001)
2021-11-07 18:31:03 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 180] for attribute 0x0203 (command 0x0001)
2021-11-07 18:31:03 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 58] for attribute 0x020e (command 0x0001)
2021-11-07 18:31:08 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [1] for attribute 0x010d (command 0x0001)
2021-11-07 18:31:09 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [1] for attribute 0x0401 (command 0x0001)
2021-11-07 18:31:10 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 20] for attribute 0x0202 (command 0x0001)
2021-11-07 18:31:10 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 180] for attribute 0x0203 (command 0x0001)
2021-11-07 18:31:10 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0] for attribute 0x0104 (command 0x0001)
2021-11-07 18:31:11 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 0] for attribute 0x0205 (command 0x0001)
2021-11-07 18:31:11 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0] for attribute 0x0407 (command 0x0001)
2021-11-07 18:31:11 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0] for attribute 0x0108 (command 0x0001)
2021-11-07 18:31:12 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [1] for attribute 0x0409 (command 0x0001)
2021-11-07 18:31:12 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [1] for attribute 0x010d (command 0x0001)
2021-11-07 18:31:12 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 58] for attribute 0x020e (command 0x0001)
2021-11-07 18:31:12 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [6, 0, 40, 11, 30, 42, 13, 30, 44, 17, 30, 46, 6, 0, 48, 12, 0, 46, 14, 30, 44, 17, 30, 42, 6, 0, 38, 12, 30, 40, 14, 30, 42, 18, 30, 40] for attribute 0x0065 (command 0x0001)
2021-11-07 18:31:12 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 1, 44] for attribute 0x0267 (command 0x0001)
2021-11-07 18:31:13 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 50] for attribute 0x0268 (command 0x0001)
2021-11-07 18:31:13 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 0] for attribute 0x0269 (command 0x0001)
2021-11-07 18:31:13 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0] for attribute 0x016a (command 0x0001)
2021-11-07 18:31:14 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 20] for attribute 0x026b (command 0x0001)
2021-11-07 18:31:14 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 45] for attribute 0x026c (command 0x0001)
2021-11-07 18:31:14 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 5] for attribute 0x026d (command 0x0001)
2021-11-07 18:31:16 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 20] for attribute 0x0202 (command 0x0001)
2021-11-07 18:31:17 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 0] for attribute 0x0205 (command 0x0001)
2021-11-07 18:31:17 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 61] for attribute 0x020e (command 0x0001)
2021-11-07 18:31:18 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [1] for attribute 0x0409 (command 0x0001)
2021-11-07 18:31:18 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0] for attribute 0x0104 (command 0x0001)
2021-11-07 18:31:19 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0] for attribute 0x010d (command 0x0001)
2021-11-07 18:31:27 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 19] for attribute 0x0202 (command 0x0001)
2021-11-07 18:31:27 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 0] for attribute 0x0205 (command 0x0001)
2021-11-07 18:31:27 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 58] for attribute 0x020e (command 0x0001)
2021-11-07 18:31:34 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 25] for attribute 0x0268 (command 0x0001)

@Youpimatin
Copy link
Author

Nice ! thanks.
Let's see if i did cut the log too quick :

2021-11-07 18:31:34 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 25] for attribute 0x0268 (command 0x0001)
2021-11-07 18:37:03 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 180] for attribute 0x0203 (command 0x0001)
2021-11-07 18:53:04 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 170] for attribute 0x0203 (command 0x0001)
2021-11-07 18:53:04 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 50] for attribute 0x0268 (command 0x0001)
2021-11-07 20:07:54 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 61] for attribute 0x020e (command 0x0001)
2021-11-07 20:07:55 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [1] for attribute 0x0409 (command 0x0001)
2021-11-07 20:07:55 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0] for attribute 0x0104 (command 0x0001)
2021-11-07 21:17:23 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 75] for attribute 0x0268 (command 0x0001)
2021-11-07 21:22:47 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 160] for attribute 0x0203 (command 0x0001)
2021-11-07 21:34:42 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 20] for attribute 0x0202 (command 0x0001)
2021-11-07 21:34:51 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 18] for attribute 0x0202 (command 0x0001)
2021-11-07 21:35:05 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 19] for attribute 0x0202 (command 0x0001)
2021-11-07 21:35:05 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 19] for attribute 0x0202 (command 0x0001)
2021-11-07 21:35:20 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 18] for attribute 0x0202 (command 0x0001)
2021-11-07 21:41:10 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 170] for attribute 0x0203 (command 0x0001)
2021-11-07 21:41:11 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 25] for attribute 0x0268 (command 0x0001)
2021-11-07 21:52:47 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 21] for attribute 0x0202 (command 0x0001)
2021-11-07 22:15:29 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 19] for attribute 0x0202 (command 0x0001)
2021-11-07 22:21:19 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 180] for attribute 0x0203 (command 0x0001)
2021-11-07 22:21:20 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 25] for attribute 0x0268 (command 0x0001)
2021-11-07 23:25:25 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 170] for attribute 0x0203 (command 0x0001)
2021-11-07 23:25:25 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 50] for attribute 0x0268 (command 0x0001)
2021-11-08 00:18:53 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 61] for attribute 0x020e (command 0x0001)
2021-11-08 00:18:53 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [1] for attribute 0x0409 (command 0x0001)
2021-11-08 00:18:53 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0] for attribute 0x0104 (command 0x0001)
2021-11-08 01:49:42 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 75] for attribute 0x0268 (command 0x0001)
2021-11-08 01:55:06 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 160] for attribute 0x0203 (command 0x0001)
2021-11-08 04:19:25 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 58] for attribute 0x020e (command 0x0001)
2021-11-08 04:19:25 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [1] for attribute 0x0409 (command 0x0001)
2021-11-08 04:19:25 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0] for attribute 0x0104 (command 0x0001)
2021-11-08 05:29:00 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 100] for attribute 0x0268 (command 0x0001)
2021-11-08 05:34:24 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 150] for attribute 0x0203 (command 0x0001)
2021-11-08 07:00:04 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 160] for attribute 0x0203 (command 0x0001)
2021-11-08 07:00:04 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 75] for attribute 0x0268 (command 0x0001)
2021-11-08 08:20:21 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 58] for attribute 0x020e (command 0x0001)
2021-11-08 08:20:22 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [1] for attribute 0x0409 (command 0x0001)
2021-11-08 08:20:22 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0] for attribute 0x0104 (command 0x0001)
2021-11-08 08:47:25 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 18] for attribute 0x0202 (command 0x0001)

@jacekk015
Copy link
Contributor

I've used https://onlinetexttools.com/filter-text
firstly used "for attribute 0x" pattern then copied Filtered text to Text field and then used the pattern "0xef69" to filter only that device.
Each time you pair device ID is changing.

@Youpimatin
Copy link
Author

Youpimatin commented Nov 8, 2021

From my log, I can identify attributes :
0x0202 # target room temp (in degree, NOT in decidegree)
0x0203 # current room temp (decidegree)

and maybe :
0x0268 # opening percentage ? (values of 25 / 50 / 75 / 100 influenced by target and current temperatures)
0x020e # battery percentage ? (58 or 61 for one TRV, 55 or 58 for my second one, updated every 4 hours )

unidentified attributes :
0x0065 ( [6, 0, 40, 11, 30, 42, 13, 30, 44, 17, 30, 46, 6, 0, 48, 12, 0, 46, 14, 30, 44, 17, 30, 42, 6, 0, 38, 12, 30, 40, 14, 30, 42, 18, 30, 40] )
0x0104 (0)
0x0108 (0)
0x010d (1 or 0)
0x016a (0)
0x0205 ( [0, 0, 0, 0] )
0x0401 (1)
0x0407 (0)
0x0409 (1)

@jacekk015
Copy link
Contributor

Do you use newest HomeAssistant version?? I see differences in DEBUG LOGS between yours and mine.
Mine logs are giving DPs from Tuya, and I can find those DPs i Zigbee2Mqtt to check which attribute is which.
I has to be some difference.

Since they declare kind of support so I could just easily match those DPs to attributes.
https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/devices/moes.js#L193

My log:

2021-09-24 15:01:13 DEBUG (MainThread) [zigpy.zcl] [0xddeb:1:0xef00] ZCL request 0x0002: [Command(status=0, tsn=24, command_id=536, function=0, data=[4, 0, 0, 0, 233])]
2021-09-24 15:01:13 DEBUG (MainThread) [zhaquirks.tuya] [0xddeb:1:0xef00] Received value [0, 0, 0, 233] for attribute 0x0218 (command 0x0002)

tsn=24 = DP 24 from Z2M which is current room temp, which is attribute 0x0218

@MattWestb
Copy link
Contributor

@jacekk015 You is having debug for zigpy.zcl that is doing more raw commands but still is tsn Tansaction Numbe in the underlying network that is for flirting duplicate messages or reseeding one that is lost (missed ack or default response).

I was thinking the attribute 0x0218 from the tuya quirk is the "decoded" DP from the string you is getting from the zigpyc.zcl data string:
[Command(status=0, tsn=24, command_id=536, function=0, data=[4, 0, 0, 0, 233])]

@Youpimatin
Copy link
Author

Youpimatin commented Nov 8, 2021

No I'm not using the latest version of HA, I'm using core-2021.6.6
( because I loose too much usability and functionality with newer versions :

  • this (Graph colors and huge legends with hideous colors above)
  • I'm loosing digits in new history (now x.xx, and before x.xxx), and it's important for some of my custom devices
  • number being changed is hidden by the previous entitity when you use an input slider
  • NMAP yaml deprecated, when the integration is horrible, I loose some functionality, it's much more work that a basic text file, I can no longer see easily in which order devices were connected (they could let the yaml working, they choose to break things)
  • history loadings takes an "infinite" time (and sometimes it never loads)
  • other things I don't have in mind for the moment... )

If it helps by providing more data, I can set the last version of HA to debug (but I will definitely downgrade after to the last good version for me.)

@jacekk015
Copy link
Contributor

jacekk015 commented Nov 8, 2021

@MattWestb Funny is that this is wrong. In reality tsn returns for debug a DP

tsn=24 local temp
tsn=34 battery
tsn=16 target temp in manual mode
tsn=30 child lock
... and so on

2021-09-24 15:01:03 DEBUG (MainThread) [zigpy.zcl] [0xddeb:1:0xef00] ZCL request 0x0002: [Command(status=0, tsn=16, command_id=528, function=0, data=[4, 0, 0, 0, 34])]
2021-09-24 15:01:03 DEBUG (MainThread) [zhaquirks.tuya] [0xddeb:1:0xef00] Received value [0, 0, 0, 34] for attribute 0x0210 (command 0x0002)
2021-09-24 15:01:13 DEBUG (MainThread) [zigpy.zcl] [0xddeb:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=8 command_id=2>
2021-09-24 15:01:13 DEBUG (MainThread) [zigpy.zcl] [0xddeb:1:0xef00] ZCL request 0x0002: [Command(status=0, tsn=24, command_id=536, function=0, data=[4, 0, 0, 0, 233])]
2021-09-24 15:01:13 DEBUG (MainThread) [zhaquirks.tuya] [0xddeb:1:0xef00] Received value [0, 0, 0, 233] for attribute 0x0218 (command 0x0002)
2021-09-24 15:01:14 DEBUG (MainThread) [zigpy.zcl] [0xddeb:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=9 command_id=2>
2021-09-24 15:01:14 DEBUG (MainThread) [zigpy.zcl] [0xddeb:1:0xef00] ZCL request 0x0002: [Command(status=0, tsn=30, command_id=286, function=0, data=[1, 0])]
2021-09-24 15:01:14 DEBUG (MainThread) [zhaquirks.tuya] [0xddeb:1:0xef00] Received value [0] for attribute 0x011e (command 0x0002)
2021-09-24 15:01:14 DEBUG (MainThread) [zigpy.zcl] [0xddeb:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=10 command_id=2>
2021-09-24 15:01:14 DEBUG (MainThread) [zigpy.zcl] [0xddeb:1:0xef00] ZCL request 0x0002: [Command(status=0, tsn=34, command_id=546, function=0, data=[4, 0, 0, 0, 131])]
2021-09-24 15:01:14 DEBUG (MainThread) [zhaquirks.tuya] [0xddeb:1:0xef00] Received value [0, 0, 0, 131] for attribute 0x0222 (command 0x0002)
2021-09-24 15:01:25 DEBUG (MainThread) [zigpy.zcl] [0xddeb:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=11 command_id=2>
2021-09-24 15:01:25 DEBUG (MainThread) [zigpy.zcl] [0xddeb:1:0xef00] ZCL request 0x0002: [Command(status=0, tsn=101, command_id=613, function=0, data=[4, 0, 0, 0, 42])]
2021-09-24 15:01:25 DEBUG (MainThread) [zhaquirks.tuya] [0xddeb:1:0xef00] Received value [0, 0, 0, 42] for attribute 0x0265 (command 0x0002)
2021-09-24 15:01:35 DEBUG (MainThread) [zigpy.zcl] [0xddeb:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=12 command_id=2>
2021-09-24 15:01:35 DEBUG (MainThread) [zigpy.zcl] [0xddeb:1:0xef00] ZCL request 0x0002: [Command(status=0, tsn=102, command_id=614, function=0, data=[4, 0, 0, 0, 34])]
2021-09-24 15:01:35 DEBUG (MainThread) [zhaquirks.tuya] [0xddeb:1:0xef00] Received value [0, 0, 0, 34] for attribute 0x0266 (command 0x0002)
2021-09-24 15:01:35 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0xDDEB:1:0x0201]: Attribute report 'MoesThermostat'[min_heat_setpoint_limit] = 3400
2021-09-24 15:01:35 DEBUG (MainThread) [homeassistant.components.zha.entity] climate.tze200_qc4fpmcn_ts0601_3e02dbfe_thermostat: Attribute 'min_heat_setpoint_limit' = 3400 update
2021-09-24 15:01:46 DEBUG (MainThread) [zigpy.zcl] [0xddeb:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=13 command_id=2>
2021-09-24 15:01:46 DEBUG (MainThread) [zigpy.zcl] [0xddeb:1:0xef00] ZCL request 0x0002: [Command(status=0, tsn=103, command_id=103, function=0, data=[8, 19, 1, 1, 0, 0, 34, 0, 0])]
2021-09-24 15:01:46 DEBUG (MainThread) [zhaquirks.tuya] [0xddeb:1:0xef00] Received value [19, 1, 1, 0, 0, 34, 0, 0] for attribute 0x0067 (command 0x0002)
2021-09-24 15:01:56 DEBUG (MainThread) [zigpy.zcl] [0xddeb:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=14 command_id=2>
2021-09-24 15:01:56 DEBUG (MainThread) [zigpy.zcl] [0xddeb:1:0xef00] ZCL request 0x0002: [Command(status=0, tsn=104, command_id=616, function=0, data=[4, 0, 0, 0, 0])]
2021-09-24 15:01:56 DEBUG (MainThread) [zhaquirks.tuya] [0xddeb:1:0xef00] Received value [0, 0, 0, 0] for attribute 0x0268 (command 0x0002)
2021-09-24 15:02:01 DEBUG (MainThread) [zigpy.device] [0xddeb] Delivery error for seq # 0x0e, on endpoint id 1 cluster 0xef00: message send failure
2021-09-24 15:02:07 DEBUG (MainThread) [zigpy.zcl] [0xddeb:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=15 command_id=2>
2021-09-24 15:02:07 DEBUG (MainThread) [zigpy.zcl] [0xddeb:1:0xef00] ZCL request 0x0002: [Command(status=0, tsn=105, command_id=617, function=0, data=[4, 0, 0, 0, 42])]
2021-09-24 15:02:07 DEBUG (MainThread) [zhaquirks.tuya] [0xddeb:1:0xef00] Received value [0, 0, 0, 42] for attribute 0x0269 (command 0x0002)
2021-09-24 15:02:07 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0xDDEB:1:0x0201]: Attribute report 'MoesThermostat'[boost_duration_seconds] = 42
2021-09-24 15:02:07 DEBUG (MainThread) [homeassistant.components.zha.entity] climate.tze200_qc4fpmcn_ts0601_3e02dbfe_thermostat: Attribute 'boost_duration_seconds' = 42 update

From Z2M [part of it]:

DEBUG: Received Zigbee message from '0x5c0272fffedb023e', type 'commandSetDataResponse', cluster 'manuSpecificTuya', data '{"data":{"data":[0,0,0,48],"type":"Buffer"},"datatype":2,"dp":16,"fn":0,"status":0,"transid":16}' from endpoint 1 with groupID 0
DEBUG: Received Zigbee message from '0x5c0272fffedb023e', type 'commandSetDataResponse', cluster 'manuSpecificTuya', data '{"data":{"data":[0,0,0,44],"type":"Buffer"},"datatype":2,"dp":105,"fn":0,"status":0,"transid":105}' from endpoint 1 with groupID 0
DEBUG: Received Zigbee message from '0x5c0272fffedb023e', type 'commandSetDataResponse', cluster 'manuSpecificTuya', data '{"data":{"data":[1],"type":"Buffer"},"datatype":1,"dp":30,"fn":0,"status":0,"transid":30}' from endpoint 1 with groupID 0
DEBUG: Received Zigbee message from '0x5c0272fffedb023e', type 'commandSetDataResponse', cluster 'manuSpecificTuya', data '{"data":{"data":[0,0,0,44],"type":"Buffer"},"datatype":2,"dp":105,"fn":0,"status":0,"transid":105}' from endpoint 1 with groupID 0

Compare DP with tsn above. Funny but that's true.
That's why it's easy to migrate code from Z2M, if there is a support. You can easily map DPs to attributes
Maybe it's a BUG - but that's how it works.

@MattWestb
Copy link
Contributor

Can being that the "tuya converter" is doing that in the conversion but then it good that is not being used for other devices then its being little crazy like this:

2021-11-08 01:10:34 DEBUG (MainThread) [zigpy.zcl] [0xde47:1:0x0020] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=105 command_id=0>
2021-11-08 01:10:34 DEBUG (MainThread) [zigpy.zcl] [0xde47:1:0x0020] ZCL request 0x0000: []
2021-11-08 01:10:34 DEBUG (MainThread) [zigpy.zcl] [0xde47:1:0x0020] No handler for cluster command 0
2021-11-08 01:10:34 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0xDE47:1:0x0020]: Received 105 tsn command 'checkin': []
2021-11-08 01:10:34 DEBUG (MainThread) [zigpy.device] [0xde47] Extending timeout for 0x69 request
2021-11-08 01:10:36 DEBUG (MainThread) [zigpy.zcl] [0xde47:1:0x0020] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=105 command_id=Command.Default_Response>
2021-11-08 01:10:36 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0xDE47:1:0x0020]: executed 'checkin_response' command with args: '(True, 8)' kwargs: '{'tsn': 105}' result: [0, <Status.SUCCESS: 0>]
2021-11-08 01:10:36 DEBUG (MainThread) [zigpy.device] [0xde47] Extending timeout for 0xe2 request
2021-11-08 01:10:38 DEBUG (MainThread) [zigpy.zcl] [0xde47:1:0x0020] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=226 command_id=Command.Default_Response>
2021-11-08 01:10:38 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0xDE47:1:0x0020]: executed 'fast_poll_stop' command with args: '()' kwargs: '{}' result: [1, <Status.TIMEOUT: 148>]

Its one old IKEA Dimmer (the round one with gyro) that is doing on checking to its parent.
And its using DP 226 . . . .

If the tuya decoder is putting the tsn as tuya DPs then i understand way you is liking it very much but is on the border to sheeting !!
(i think its little bad using the same name for different system fuctions)

And then it shall having zigpy.zcl and zhaquirks.tuya as debug for getting the right information.

I shall doing it on the test network with the TRV and looking little more :-)))

Is this TRV sending wrong data or is Zpgpy using it wrong and loosing the preposition of the setpoint ?
I think its possible doing one if / else for the setpoint in the quirk and not need doing on new device class for it like is being done but its looks working.

@jacekk015
Copy link
Contributor

jacekk015 commented Nov 8, 2021

OK - I got the calculation for attribute -> DP
Example - local temp for Maxsmart:
tsn=24, command_id=536 attribute 0x0218
0x0218 -> 0x18 -> 24 decimal :-))
us as a HEX only last two elements

Maxsmart Window detect:
tsn=107, command_id=363 attribute 0x016b
0x016b -> 0x6b -> 107 decimal

SITERWELL_TARGET_TEMP_ATTR = 0x0202
0x0202 -> 0x02 -> 2 decimal
Let's go to Z2M Siterwell
https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/devices/siterwell.js#L13
https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/devices/siterwell.js#L21
fz.tuya_thermostat
https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/converters/fromZigbee.js#L3856
case tuya.dataPoints.heatingSetpoint:
https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/converters/fromZigbee.js#L3906
heatingSetpoint: 2,
https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/lib/tuya.js#L190

Easy :-)

@MattWestb
Copy link
Contributor

Not importing but i was playing little with away mode temperature up and down and was getting one log:

2021-11-08 22:28:57 DEBUG (MainThread) [zigpy.zcl] [0xa419:1:0xef00] ZCL request 0x0001: [Command(status=2, tsn=67, command_id=514, function=0, data=[4, 0, 0, 0, 50])]
2021-11-08 22:28:57 DEBUG (MainThread) [zhaquirks.tuya] [0xa419:1:0xef00] Received value [0, 0, 0, 50] for attribute 0x0202 (command 0x0001)
2021-11-08 22:28:57 DEBUG (MainThread) [zigpy.zcl] [0xa419:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=10 command_id=1>
2021-11-08 22:28:57 DEBUG (MainThread) [zigpy.zcl] [0xa419:1:0xef00] ZCL request 0x0001: [Command(status=2, tsn=68, command_id=514, function=0, data=[4, 0, 0, 0, 50])]
2021-11-08 22:28:57 DEBUG (MainThread) [zhaquirks.tuya] [0xa419:1:0xef00] Received value [0, 0, 0, 50] for attribute 0x0202 (command 0x0001)
2021-11-08 22:29:01 DEBUG (MainThread) [zigpy.zcl] [0xa419:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=11 command_id=1>
2021-11-08 22:29:01 DEBUG (MainThread) [zigpy.zcl] [0xa419:1:0xef00] ZCL request 0x0001: [Command(status=2, tsn=69, command_id=514, function=0, data=[4, 0, 0, 0, 50])]
2021-11-08 22:29:01 DEBUG (MainThread) [zhaquirks.tuya] [0xa419:1:0xef00] Received value [0, 0, 0, 50] for attribute 0x0202 (command 0x0001)
2021-11-08 22:29:02 DEBUG (MainThread) [zigpy.zcl] [0xa419:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=12 command_id=1>
2021-11-08 22:29:02 DEBUG (MainThread) [zigpy.zcl] [0xa419:1:0xef00] ZCL request 0x0001: [Command(status=2, tsn=70, command_id=514, function=0, data=[4, 0, 0, 0, 50])]
2021-11-08 22:29:02 DEBUG (MainThread) [zhaquirks.tuya] [0xa419:1:0xef00] Received value [0, 0, 0, 50] for attribute 0x0202 (command 0x0001)
2021-11-08 22:29:03 DEBUG (MainThread) [zigpy.zcl] [0xa419:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=13 command_id=1>
2021-11-08 22:29:03 DEBUG (MainThread) [zigpy.zcl] [0xa419:1:0xef00] ZCL request 0x0001: [Command(status=2, tsn=70, command_id=514, function=0, data=[4, 0, 0, 0, 50])]
2021-11-08 22:29:03 DEBUG (MainThread) [zhaquirks.tuya] [0xa419:1:0xef00] Received value [0, 0, 0, 50] for attribute 0x0202 (command 0x0001)
2021-11-08 22:29:04 DEBUG (MainThread) [zigpy.zcl] [0xa419:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=14 command_id=1>
2021-11-08 22:29:04 DEBUG (MainThread) [zigpy.zcl] [0xa419:1:0xef00] ZCL request 0x0001: [Command(status=2, tsn=70, command_id=514, function=0, data=[4, 0, 0, 0, 50])]
2021-11-08 22:29:04 DEBUG (MainThread) [zhaquirks.tuya] [0xa419:1:0xef00] Received value [0, 0, 0, 50] for attribute 0x0202 (command 0x0001)
2021-11-08 22:29:05 DEBUG (MainThread) [zigpy.zcl] [0xa419:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=15 command_id=1>
2021-11-08 22:29:05 DEBUG (MainThread) [zigpy.zcl] [0xa419:1:0xef00] ZCL request 0x0001: [Command(status=2, tsn=71, command_id=514, function=0, data=[4, 0, 0, 0, 50])]
2021-11-08 22:29:05 DEBUG (MainThread) [zhaquirks.tuya] [0xa419:1:0xef00] Received value [0, 0, 0, 50] for attribute 0x0202 (command 0x0001)
2021-11-08 22:29:06 DEBUG (MainThread) [zigpy.zcl] [0xa419:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=16 command_id=1>
2021-11-08 22:29:06 DEBUG (MainThread) [zigpy.zcl] [0xa419:1:0xef00] ZCL request 0x0001: [Command(status=2, tsn=72, command_id=514, function=0, data=[4, 0, 0, 0, 55])]
2021-11-08 22:29:06 DEBUG (MainThread) [zhaquirks.tuya] [0xa419:1:0xef00] Received value [0, 0, 0, 55] for attribute 0x0202 (command 0x0001)
2021-11-08 22:29:07 DEBUG (MainThread) [zigpy.zcl] [0xa419:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=17 command_id=1>
2021-11-08 22:29:07 DEBUG (MainThread) [zigpy.zcl] [0xa419:1:0xef00] ZCL request 0x0001: [Command(status=2, tsn=72, command_id=514, function=0, data=[4, 0, 0, 0, 55])]
2021-11-08 22:29:07 DEBUG (MainThread) [zhaquirks.tuya] [0xa419:1:0xef00] Received value [0, 0, 0, 55] for attribute 0x0202 (command 0x0001)
2021-11-08 22:29:08 DEBUG (MainThread) [zigpy.zcl] [0xa419:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=18 command_id=1>
2021-11-08 22:29:08 DEBUG (MainThread) [zigpy.zcl] [0xa419:1:0xef00] ZCL request 0x0001: [Command(status=2, tsn=73, command_id=514, function=0, data=[4, 0, 0, 0, 55])]
2021-11-08 22:29:08 DEBUG (MainThread) [zhaquirks.tuya] [0xa419:1:0xef00] Received value [0, 0, 0, 55] for attribute 0x0202 (command 0x0001)
2021-11-08 22:29:09 DEBUG (MainThread) [zigpy.zcl] [0xa419:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=19 command_id=1>
2021-11-08 22:29:09 DEBUG (MainThread) [zigpy.zcl] [0xa419:1:0xef00] ZCL request 0x0001: [Command(status=2, tsn=73, command_id=514, function=0, data=[4, 0, 0, 0, 55])]
2021-11-08 22:29:09 DEBUG (MainThread) [zhaquirks.tuya] [0xa419:1:0xef00] Received value [0, 0, 0, 55] for attribute 0x0202 (command 0x0001)
2021-11-08 22:29:10 DEBUG (MainThread) [zigpy.zcl] [0xa419:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=20 command_id=1>
2021-11-08 22:29:10 DEBUG (MainThread) [zigpy.zcl] [0xa419:1:0xef00] ZCL request 0x0001: [Command(status=2, tsn=74, command_id=514, function=0, data=[4, 0, 0, 0, 50])]
2021-11-08 22:29:10 DEBUG (MainThread) [zhaquirks.tuya] [0xa419:1:0xef00] Received value [0, 0, 0, 50] for attribute 0x0202 (command 0x0001)
2021-11-08 22:29:11 DEBUG (MainThread) [zigpy.zcl] [0xa419:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=21 command_id=1>
2021-11-08 22:29:11 DEBUG (MainThread) [zigpy.zcl] [0xa419:1:0xef00] ZCL request 0x0001: [Command(status=2, tsn=74, command_id=514, function=0, data=[4, 0, 0, 0, 50])]
2021-11-08 22:29:11 DEBUG (MainThread) [zhaquirks.tuya] [0xa419:1:0xef00] Received value [0, 0, 0, 50] for attribute 0x0202 (command 0x0001)

Attribute 0x202 is the same then changing the temperature but not the tsn is increasing with the transactions the device is sending.

Can being that my TRV is using one old Zigbee module (TYST11) that is doing it "normal Zigbee way" and newer is making it tuya way = tsn = DP that i think it not bad and shall working well then sending different DP but if sending the same DP (changing the temp and the TRV is sending multiple different temperatures with same DP) it can being little strange for the Zigbee network stack and the underlying IEEE network that is using tsn logic for acking frames and reseeding them is they is being lost and double transmitting.

If its working with TZE200 then its great but dont forgetting its looks not working with devices that having TYST11 Zigbee modules.

tuya is still tuya !!
:-))))

@jacekk015
Copy link
Contributor

You have ZCL request 0x0001:
I have ZCL request 0x0002:
The only difference I see

@Youpimatin
Copy link
Author

Youpimatin commented Nov 8, 2021

Identified attributes :
0x0065 # programmable schedule (Received value [6, 0, 40, 11, 30, 42, 13, 30, 44, 17, 30, 46, 6, 0, 48, 12, 0, 46, 14, 30, 44, 17, 30, 42, 6, 0, 38, 12, 30, 40, 14, 30, 42, 18, 30, 40] for :

  • Monday to friday : 06:00 20°C / 11:30 21°C / 13:30 22°C / 17:30 23°C
  • Saturday : 06:00 24°C / 12:00 23°C / 14:30 22°C / 17:30 21°C
  • Sunday : 06:00 19°C / 12:30 20°C / 14:30 21°C / 18:30 20°C )

0x0104 # Boost heating (Received value 0:off / 1:in progress)
0x0108 # Open window detection MODE (Received value 0:function disabled / 1:function enabled)
0x010d # child lock ( Received value 0:unlocked / 1:locked)
0x016a # Energy saving mode (Received value 0:off / 1:on)
0x0202 # target room temp (in degree, NOT in decidegree)
0x0203 # current room temp (decidegree)
0x020e # battery percentage (updated every 4 hours )
0x0267 # Boost heating countdown in second (Received value [0, 0, 1, 44] for 300)
0x0268 # opening percentage (values of 0 / 25 / 50 / 75 / 100)
0x0269 # Temperature compensation ( Received value [255, 255, 255, 255] for -1)
0x026b # Energy saving mode temperature ( Received value [0, 0, 0, 15] )
0x026c # Max target temp ( Received value [0, 0, 0, 35] )
0x026d # Min target temp (Received value [0, 0, 0, 5])
0x0401 # Mode (Received value 0:Manual / 1:Holiday / 2:Temporary Manual Mode / 3:Prog)

Unidentified attributes :
0x0205 ( [0, 0, 0, 0] / [0, 0, 0, 5] )
0x0407 (0 / 1) changes when current temp crosses target temp...
0x0409 (1)

@MattWestb
Copy link
Contributor

0x205 looks have one temperature and one more data, Away with temperature and date or holiday ?
0x40x frost, window, valve jammed alarm ?

@jacekk015
Copy link
Contributor

jacekk015 commented Nov 8, 2021

You need to specify 0x0401 for modes mapping Schedule, Manual...
[0], [1]...

You have two Window functions. Clarification is needed
moesSwindowDetection: 9,
0x0409 (1)

moesSwindowDetectionFunktion_A2: 8,
0x0108 # Open window detection (Received value 0:off / 1:on)

moesSheatingSetpoint: 2,
0x0202 # target room temp (in degree, NOT in decidegree)
2021-11-07 18:27:38 DEBUG (MainThread) [zigpy.zcl] [0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=18, command_id=514, function=0, data=[4, 0, 0, 0, 21])]
2021-11-07 18:27:38 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 21] for attribute 0x0202 (command 0x0001)
****************************************

moesSlocalTemp: 3,
0x0203 # current room temp (decidegree)
2021-11-07 18:27:48 DEBUG (MainThread) [zigpy.zcl] [0x6937:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=190, command_id=515, function=0, data=[4, 0, 0, 0, 170])]
2021-11-07 18:27:48 DEBUG (MainThread) [zhaquirks.tuya] [0x6937:1:0xef00] Received value [0, 0, 0, 170] for attribute 0x0203 (command 0x0001)
****************************************

moesSvalvePosition: 104,
0x0268 # opening percentage (values of 0 / 25 / 50 / 75 / 100)
2021-11-07 18:27:48 DEBUG (MainThread) [zigpy.zcl] [0x6937:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=191, command_id=616, function=0, data=[4, 0, 0, 0, 50])]
2021-11-07 18:27:48 DEBUG (MainThread) [zhaquirks.tuya] [0x6937:1:0xef00] Received value [0, 0, 0, 50] for attribute 0x0268 (command 0x0001)
****************************************

moesSbattery: 14,
0x020e # battery percentage (updated every 4 hours )
2021-11-07 18:28:04 DEBUG (MainThread) [zigpy.zcl] [0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=24, command_id=526, function=0, data=[4, 0, 0, 0, 61])]
2021-11-07 18:28:04 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 61] for attribute 0x020e (command 0x0001)
****************************************

moesSschedule: 101,
0x0065 # programmable schedule (Received value [6, 0, 40, 11, 30, 42, 13, 30, 44, 17, 30, 46, 6, 0, 48, 12, 0, 46, 14, 30, 44, 17, 30, 42, 6, 0, 38, 12, 30, 40, 14, 30, 42, 18, 30, 40] for :
Monday to friday : 06:00 20°C / 11:30 21°C / 13:30 22°C / 17:30 23°C
Saturday : 06:00 24°C / 12:00 23°C / 14:30 22°C / 17:30 21°C
Sunday : 06:00 19°C / 12:30 20°C / 14:30 21°C / 18:30 20°C )
2021-11-07 18:31:12 DEBUG (MainThread) [zigpy.zcl] [0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=44, command_id=101, function=0, data=[36, 6, 0, 40, 11, 30, 42, 13, 30, 44, 17, 30, 46, 6, 0, 48, 12, 0, 46, 14, 30, 44, 17, 30, 42, 6, 0, 38, 12, 30, 40, 14, 30, 42, 18, 30, 40])]
2021-11-07 18:31:12 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [6, 0, 40, 11, 30, 42, 13, 30, 44, 17, 30, 46, 6, 0, 48, 12, 0, 46, 14, 30, 44, 17, 30, 42, 6, 0, 38, 12, 30, 40, 14, 30, 42, 18, 30, 40] for attribute 0x0065 (command 0x0001)
****************************************

moesSboostHeating: 4,
0x0104 # Boost heating (Received value 0:off / 1:in progress)
2021-11-07 18:31:18 DEBUG (MainThread) [zigpy.zcl] [0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=55, command_id=260, function=0, data=[1, 0])]
2021-11-07 18:31:18 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0] for attribute 0x0104 (command 0x0001)
****************************************

moesSwindowDetectionFunktion_A2: 8,
0x0108 # Open window detection (Received value 0:off / 1:on)
2021-11-07 18:31:11 DEBUG (MainThread) [zigpy.zcl] [0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=40, command_id=264, function=0, data=[1, 0])]
2021-11-07 18:31:11 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0] for attribute 0x0108 (command 0x0001)
****************************************

moesSchildLock: 13,
0x010d # child lock ( Received value 0:unlocked / 1:locked)
2021-11-07 18:31:12 DEBUG (MainThread) [zigpy.zcl] [0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=42, command_id=269, function=0, data=[1, 1])]
2021-11-07 18:31:12 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [1] for attribute 0x010d (command 0x0001)
****************************************

moesSecoMode: 106,
0x016a # Energy saving mode (Received value 0:off / 1:on)
2021-11-07 18:31:13 DEBUG (MainThread) [zigpy.zcl] [0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=48, command_id=362, function=0, data=[1, 0])]
2021-11-07 18:31:13 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0] for attribute 0x016a (command 0x0001)
****************************************

moesSboostHeatingCountdownTimeSet: 103,
0x0267 # Boost heating countdown in second (Received value [0, 0, 1, 44] for 300)
2021-11-07 18:31:12 DEBUG (MainThread) [zigpy.zcl] [0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=45, command_id=615, function=0, data=[4, 0, 0, 1, 44])]
2021-11-07 18:31:12 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 1, 44] for attribute 0x0267 (command 0x0001)
****************************************

moesScompensationTempSet: 105,
0x0269 # Temperature compensation ( Received value [255, 255, 255, 255] for -1)
2021-11-07 18:31:13 DEBUG (MainThread) [zigpy.zcl] [0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=47, command_id=617, function=0, data=[4, 0, 0, 0, 0])]
2021-11-07 18:31:13 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 0] for attribute 0x0269 (command 0x0001)
****************************************

moesSecoModeTempSet: 107,
0x026b # Energy saving mode temperature ( Received value [0, 0, 0, 15] )
2021-11-07 18:31:14 DEBUG (MainThread) [zigpy.zcl] [0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=49, command_id=619, function=0, data=[4, 0, 0, 0, 20])]
2021-11-07 18:31:14 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 20] for attribute 0x026b (command 0x0001)
****************************************

moesSmaxTempSet: 108,
0x026c # Max target temp ( Received value [0, 0, 0, 35] )
2021-11-07 18:31:14 DEBUG (MainThread) [zigpy.zcl] [0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=50, command_id=620, function=0, data=[4, 0, 0, 0, 45])]
2021-11-07 18:31:14 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 45] for attribute 0x026c (command 0x0001)
****************************************

moesSminTempSet: 109,
0x026d # Min target temp (Received value [0, 0, 0, 5])
2021-11-07 18:31:14 DEBUG (MainThread) [zigpy.zcl] [0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=51, command_id=621, function=0, data=[4, 0, 0, 0, 5])]
2021-11-07 18:31:14 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 5] for attribute 0x026d (command 0x0001)
****************************************

moesSboostHeatingCountdown: 5,
0x0205 ( [0, 0, 0, 0] / [0, 0, 0, 5] )
2021-11-07 18:31:17 DEBUG (MainThread) [zigpy.zcl] [0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=52, command_id=517, function=0, data=[4, 0, 0, 0, 0])]
2021-11-07 18:31:17 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0, 0, 0, 0] for attribute 0x0205 (command 0x0001)
****************************************

moesSsystemMode: 1,
0x0401 (1)
2021-11-07 18:31:09 DEBUG (MainThread) [zigpy.zcl] [0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=34, command_id=1025, function=0, data=[1, 1])]
2021-11-07 18:31:09 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [1] for attribute 0x0401 (command 0x0001)
****************************************

moesSreset: 7,
0x0407 (0)
2021-11-07 18:31:11 DEBUG (MainThread) [zigpy.zcl] [0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=39, command_id=1031, function=0, data=[1, 0])]
2021-11-07 18:31:11 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [0] for attribute 0x0407 (command 0x0001)
****************************************

moesSwindowDetection: 9,
0x0409 (1)
2021-11-07 18:31:12 DEBUG (MainThread) [zigpy.zcl] [0xef69:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=41, command_id=1033, function=0, data=[1, 1])]
2021-11-07 18:31:12 DEBUG (MainThread) [zhaquirks.tuya] [0xef69:1:0xef00] Received value [1] for attribute 0x0409 (command 0x0001)

@MattWestb
Copy link
Contributor

The 0x0409 is the alarm and the 0x0108 is the enable / disabling the windows detection like on the Siterwell is doing.

@jacekk015
Copy link
Contributor

User needs to confirm this. Tricky, because manual says something else?

Zrzut ekranu z 2021-11-08 23-44-23
BRT-100 User manual.pdf

@Youpimatin
Copy link
Author

Youpimatin commented Nov 8, 2021

I edited, 0x0108 is the mode (function A2 in the manual)
0x0108 # Open window detection MODE (Received value 0:function disabled / 1:function enabled)

No effect on zigbee when I change A3 or A4

@jacekk015
Copy link
Contributor

So 0x0409 could be the window alarm, but pastebin logs shows already [1] there
also
0x0401 needs explanation which mode has which value

@Youpimatin
Copy link
Author

Youpimatin commented Nov 8, 2021

0x0401 :
0 : Manual Mode
1 : Holiday Mode
2 : Temporary Manual Mode (will return to Schedule mode at the next schedule time)
3 : Schedule Programming Mode
(I don't know if other values are possible, these are the only ones i log when I change mode with the 'Home' button)

I'm pretty happy with what I listed already.

It's cold outside, let's go for a window opening detection...
hmm...0x409 stays at 1 even as low as 4°C
and valve stayed wide open at 100% from 20°C to 4°C... I must have missed something, maybe the A2 setting must be 0, not 1
...
nop, 0 or 1, nothing
Ok, I don't know how to get window detection to work properly...

@witjojo
Copy link

witjojo commented Feb 3, 2023

@dkwireless

After activating it for the first time, and physically clicking on TRV (activating display), battery percentage appeared.

My problem is not the battery percentage, my problem is the valve state from TRV.

@jacekk015
Copy link
Contributor

@witjojo That's the firmware on the TRV. Quirk has nothing to do about it.
Attributes were originally clarified by the @Youpimatin user
#1123

I don't remember such problems, but only user that has that TRV can confirm that.
So I can say nothing about specific TRV behavior.
Maybe try to connect it via Tuya hub and check if there's a newer firmware available.

@Nobber1066
Copy link

Nobber1066 commented Feb 14, 2023

Hello, I have a couple of BRT-100 Moes House TRV's I have installed the beca.py which has exposed a number of entitles which is great thank you manually every works works but when I create a scene to set the temp say 24 degrees and another scene to set at 15 degrees, I cant seem to get the TRV to change the temp setting...

any clue as to what I have done wrong or missed
thanks

@Nobber1066
Copy link

Ok Scratch the above please - sorry I can just run with an automation and not a scene, that works fine

@jacekk015
Copy link
Contributor

What does it mean: doesn't work?
Picture comes from Z2M not ZHA

@mdzhigarov
Copy link

nvm, disregard my last comment

@witjojo
Copy link

witjojo commented Jul 18, 2023

Hello everyone,

I have recently received the following error message:

2023-07-18 03:14:03.746 ERROR (MainThread) [zhaquirks] Unexpected exception importing custom quirk 'ts0601_trv_beca'
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/zhaquirks/init.py", line 454, in setup
importer.find_module(modname).load_module(modname)
File "", line 605, in _check_name_wrapper
File "", line 1120, in load_module
File "", line 945, in load_module
File "", line 290, in _load_module_shim
File "", line 721, in _load
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/config/custom_zha_quirks/ts0601_trv_beca.py", line 69, in
class BecaManufCluster(TuyaManufClusterAttributes):
File "/usr/local/lib/python3.11/site-packages/zigpy/zcl/init.py", line 165, in init_subclass
raise TypeError(f"Duplicate definitions exist for {duplicates}")
TypeError: Duplicate definitions exist for ['boost_duration_seconds']

Can someone help?

@jacekk015
Copy link
Contributor

@witjojo It was fixed already at:
https://github.com/jacekk015/zha_quirks

@matlar83
Copy link
Contributor

Hi @jacekk015,
I have a problem with the Quirk:

as I try to turn on or off any switch in the device I got this error, even if the command is correctly processed on the TRV:

`
Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:226
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 11:06:57 (6 occurrences)
Last logged: 11:10:17

[547470550976] Failed to turn on: [WriteAttributesStatusRecord(status=<Status.SUCCESS: 0>)]
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 226, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 2012, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2049, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
return await service.entity_service_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call
response_data = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/zha/switch.py", line 88, in async_turn_on
await self._on_off_cluster_handler.turn_on()
File "/usr/src/homeassistant/homeassistant/components/zha/core/cluster_handlers/general.py", line 390, in turn_on
raise HomeAssistantError(f"Failed to turn on: {result[1]}")
homeassistant.exceptions.HomeAssistantError: Failed to turn on: [WriteAttributesStatusRecord(status=<Status.SUCCESS: 0>)]
`

For example, if I turn on child lock switch, I get this error, but the child lock is correctly turned on.

Can you please help with this?

@jacekk015
Copy link
Contributor

jacekk015 commented Oct 23, 2023

@matlar83 OK - I know where the bug is. Today evening I will correct that.

@matlar83
Copy link
Contributor

Thank you very much! Very appreciated!

@jacekk015
Copy link
Contributor

@matlar83 Quirk updated. Replace and restart HA to use new version.

@matlar83
Copy link
Contributor

Seems to work great! thank you

@matlar83
Copy link
Contributor

matlar83 commented Oct 26, 2023

@jacekk015 ,

how I see this error in HomeAssistant logs:

Logger: homeassistant.core
Source: core.py:2028
First occurred: 24 ottobre 2023 alle ore 08:30:00 (89 occurrences)
Last logged: 16:00:00

Error executing service: <ServiceCall climate.set_temperature (c:01HDNE7QS3CZ2R3QK6H4K6PWX3): hvac_mode=heat, temperature=18.0, entity_id=['climate.trv_bagnetto_thermostat']>
Error executing service: <ServiceCall climate.set_temperature (c:01HDP4HTR7AHBAE2GXN4ACGYDK): hvac_mode=heat, temperature=20.0, entity_id=['climate.trv_bagnetto_thermostat']>
Error executing service: <ServiceCall climate.set_temperature (c:01HDP4HTRGJ3VX2KAEBGTF5CXK): hvac_mode=heat, temperature=19.0, entity_id=['climate.trv_bagno_thermostat']>
Error executing service: <ServiceCall climate.set_temperature (c:01HDP4HV8PGDV52FQD84PV9601): hvac_mode=heat, temperature=19.0, entity_id=['climate.trv_bagno_thermostat']>
Error executing service: <ServiceCall climate.set_temperature (c:01HDP4HV9RXE6Y4V9SN4KD091A): hvac_mode=heat, temperature=20.0, entity_id=['climate.trv_bagnetto_thermostat']>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 2028, in _run_service_call_catch_exceptions
    await coro_or_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 2049, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call
    response_data = await _handle_entity_call(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 632, in async_service_temperature_set
    await entity.async_set_temperature(**kwargs)
  File "/usr/src/homeassistant/homeassistant/components/zha/climate.py", line 437, in async_set_temperature
    await self.async_set_hvac_mode(hvac_mode)
  File "/usr/src/homeassistant/homeassistant/components/zha/climate.py", line 408, in async_set_hvac_mode
    if await self._thrm.async_set_operation_mode(HVAC_MODE_2_SYSTEM[hvac_mode]):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/zha/core/cluster_handlers/hvac.py", line 243, in async_set_operation_mode
    await self.write_attributes_safe({"system_mode": mode})
  File "/usr/src/homeassistant/homeassistant/components/zha/core/cluster_handlers/__init__.py", line 518, in write_attributes_safe
    res = await self.write_attributes(attributes, manufacturer=manufacturer)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/zha/core/cluster_handlers/__init__.py", line 84, in wrapper
    return await RETRYABLE_REQUEST_DECORATOR(func)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/zigpy/util.py", line 132, in retry
    return await func()
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/zhaquirks/tuya/__init__.py", line 729, in write_attributes
    manufacturer_attrs.update(new_attrs)
TypeError: 'NoneType' object is not iterable

Do you have any idea?

@jacekk015
Copy link
Contributor

That's probably you're sending command "heat".
TRV can only heat so normally system mode like: heat/auto/off/cool etc.. isn't supported.
That TRV even don't have itself an off functionality.
So if you remove hvac_mode=heat from your automation all should be good.
It won't ever cool so sending "heat" isn't neceserry.

TBH that device has an attribute:
BECA_VALVE_STATE_ONOFF_ATTR = 0x0407 # [0] closed [1] opened

Since that's an old quirk I don't even remember if that's read-only or TRV can react to signal send.
You can check it yourself.
image

Go to 3-dot menu of the TRV
Select cluster: BecaManufCluster 0xef00
Select attribute: valve_state_onoff
Click read.
For open [heating] you should get value of 1
Now change value to 0 and click Save attribute.
If I remember correctly that should be sent directly to TRV.
Check how TRV behaves.
Sometimes parameter is read-only and can't be changed.

@R1DEN
Copy link

R1DEN commented Nov 15, 2023

@jacekk015 hey, I have a similar trace, but the original error message is different:

Logger: custom_components.better_thermostat.utils.controlling
Source: custom_components/better_thermostat/utils/controlling.py:46
Integration: Better Thermostat ([documentation](https://github.com/KartoffelToby/better_thermostat), [issues](https://github.com/KartoffelToby/better_thermostat/issues))
First occurred: 00:12:38 (134 occurrences)
Last logged: 14:49:14

better_thermostat Bedroom Thermostat: ERROR controlling: climate.bedroom_trv_thermostat
better_thermostat Living Room Thermostat: ERROR controlling: climate.living_room_trv_thermostat
better_thermostat Hallway Thermostat: ERROR controlling: climate.hallway_trv_thermostat
Traceback (most recent call last):
  File "/config/custom_components/better_thermostat/utils/controlling.py", line 46, in control_queue
    _temp = await control_trv(self, trv)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/better_thermostat/utils/controlling.py", line 249, in control_trv
    await set_offset(self, heater_entity_id, _calibration)
  File "/config/custom_components/better_thermostat/utils/bridge.py", line 91, in set_offset
    return await self.real_trvs[entity_id]["adapter"].set_offset(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/better_thermostat/adapters/generic.py", line 160, in set_offset
    await set_hvac_mode(
  File "/config/custom_components/better_thermostat/adapters/generic.py", line 122, in set_hvac_mode
    await self.hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 2035, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2072, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call
    response_data = await _handle_entity_call(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/zha/climate.py", line 408, in async_set_hvac_mode
    if await self._thrm.async_set_operation_mode(HVAC_MODE_2_SYSTEM[hvac_mode]):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/zha/core/cluster_handlers/hvac.py", line 243, in async_set_operation_mode
    await self.write_attributes_safe({"system_mode": mode})
  File "/usr/src/homeassistant/homeassistant/components/zha/core/cluster_handlers/__init__.py", line 518, in write_attributes_safe
    res = await self.write_attributes(attributes, manufacturer=manufacturer)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/zha/core/cluster_handlers/__init__.py", line 84, in wrapper
    return await RETRYABLE_REQUEST_DECORATOR(func)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/zigpy/util.py", line 138, in retry
    return await func()
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/zhaquirks/tuya/__init__.py", line 729, in write_attributes
    manufacturer_attrs.update(new_attrs)
TypeError: 'NoneType' object is not iterable

BetterThermostat tries to change the offset, but apparently can't

@jacekk015
Copy link
Contributor

jacekk015 commented Nov 16, 2023

Again - that TRV doesn't have OFF mode. So how you want to turn it OFF???
From ZHA quirk code:

BECA_MODE_ATTR = 0x0401  # [0] schedule [1] manual [2] temporary manual [3] away

From Z2M code
https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/src/devices/moes.ts#L307C14-L314

 .withPreset(['programming', 'manual', 'temporary_manual', 'holiday'],

Check the paper manual. Is there any info about OFF mode???
Or, go to TRV device and turn it off. How do you do that?
If that's possible send me DEBUG logs of that action.

@R1DEN
Copy link

R1DEN commented Nov 17, 2023

Hm, that's really strange as I've explicitly told BetterThermostat that there is no OFF mode in it:
image

Looks like a BetterThermostat bug then?

@witjojo
Copy link

witjojo commented Nov 18, 2023

Hi, I also tested BetterThermostat with this TRV "TS0601" "_TZE200_b6wax7g0". And I also select without OFF mode.
But it does not work. The temperature values were completely confused.
Too bad because I wanted to use BetterThermostat with external temperature sensors.

I think the problem is not BetterThermostat but the TRV's. Maybe jacekk015 can test BetherThermostat.

@jacekk015
Copy link
Contributor

Debug logs please. It's all there.

@R1DEN
Copy link

R1DEN commented Dec 1, 2023

Here are the debug logs right after trying to enable the device in BetterThermostat using the offset mode:

2023-12-01 15:31:00.860 DEBUG (MainThread) [zigpy.util] Tries remaining: 3
2023-12-01 15:31:00.861 DEBUG (MainThread) [zigpy.zcl] [0xF27D:1:0xef00] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.CLUSTER_COMMAND: 1>, is_manufacturer_specific=False, direction=<Direction.Server_to_Client: 0>, disable_default_response=0, reserved=0, *is_cluster=True, *is_general=False), tsn=20, command_id=0, *direction=<Direction.Server_to_Client: 0>)
2023-12-01 15:31:00.861 DEBUG (MainThread) [zigpy.zcl] [0xF27D:1:0xef00] Sending request: set_data(param=Command(status=0, tsn=20, command_id=617, function=0, data=3))
2023-12-01 15:31:00.861 DEBUG (MainThread) [zigpy_znp.zigbee.application] Sending packet ZigbeePacket(timestamp=datetime.datetime(2023, 12, 1, 13, 31, 0, 861595, tzinfo=datetime.timezone.utc), src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0xF27D), dst_ep=1, source_route=None, extended_timeout=False, tsn=20, profile_id=260, cluster_id=61184, data=Serialized[b'\x01\x14\x00\x00\x14i\x02\x00\x04\x00\x00\x00\x03'], tx_options=<TransmitOptions.ACK: 1>, radius=0, non_member_radius=0, lqi=None, rssi=None)
2023-12-01 15:31:00.863 DEBUG (MainThread) [zigpy_znp.api] Sending request: AF.DataRequestExt.Req(DstAddrModeAddress=AddrModeAddress(mode=<AddrMode.NWK: 2>, address=0xF27D), DstEndpoint=1, DstPanId=0x0000, SrcEndpoint=1, ClusterId=61184, TSN=20, Options=<TransmitOptions.ACK_REQUEST|SUPPRESS_ROUTE_DISC_NETWORK: 48>, Radius=0, Data=b'\x01\x14\x00\x00\x14\x69\x02\x00\x04\x00\x00\x00\x03')
2023-12-01 15:31:00.868 DEBUG (MainThread) [zigpy_znp.api] Received command: AF.DataRequestExt.Rsp(Status=<Status.SUCCESS: 0>)
2023-12-01 15:31:02.689 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0xA067](lumi.sensor_magnet.aq2): Device seen - marking the device available and resetting counter
2023-12-01 15:31:02.689 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0xA067](lumi.sensor_magnet.aq2): Update device availability -  device available: True - new availability: True - changed: False
2023-12-01 15:31:02.695 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0xEF86](lumi.sensor_magnet.aq2): Device seen - marking the device available and resetting counter
2023-12-01 15:31:02.695 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0xEF86](lumi.sensor_magnet.aq2): Update device availability -  device available: True - new availability: True - changed: False
2023-12-01 15:31:02.715 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x568E](TS0601): Device seen - marking the device available and resetting counter
2023-12-01 15:31:02.716 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x568E](TS0601): Update device availability -  device available: True - new availability: True - changed: False
2023-12-01 15:31:05.840 DEBUG (MainThread) [zigpy_znp.api] Received command: AF.DataConfirm.Callback(Status=<Status.SUCCESS: 0>, Endpoint=1, TSN=20)
2023-12-01 15:31:05.842 DEBUG (MainThread) [zigpy_znp.api] Received command: AF.IncomingMsg.Callback(GroupId=0x0000, ClusterId=61184, SrcAddr=0xF27D, SrcEndpoint=1, DstEndpoint=1, WasBroadcast=<Bool.false: 0>, LQI=99, SecurityUse=<Bool.false: 0>, TimeStamp=4558858, TSN=0, Data=b'\x18\x14\x0B\x00\x00', MacSrcAddr=0xF27D, MsgResultRadius=29)
2023-12-01 15:31:05.843 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(timestamp=datetime.datetime(2023, 12, 1, 13, 31, 5, 843477, tzinfo=datetime.timezone.utc), src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0xF27D), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=0, profile_id=260, cluster_id=61184, data=Serialized[b'\x18\x14\x0b\x00\x00'], tx_options=<TransmitOptions.NONE: 0>, radius=29, non_member_radius=0, lqi=99, rssi=None)
2023-12-01 15:31:05.844 DEBUG (MainThread) [zigpy.zcl] [0xF27D:1:0xef00] Received ZCL frame: b'\x18\x14\x0b\x00\x00'
2023-12-01 15:31:05.845 DEBUG (MainThread) [zigpy.zcl] [0xF27D:1:0xef00] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, direction=<Direction.Client_to_Server: 1>, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=20, command_id=11, *direction=<Direction.Client_to_Server: 1>)
2023-12-01 15:31:05.845 DEBUG (MainThread) [zigpy.zcl] [0xF27D:1:0xef00] Decoded ZCL frame: BecaManufCluster:Default_Response(command_id=0, status=<Status.SUCCESS: 0>)
2023-12-01 15:31:05.846 DEBUG (MainThread) [zigpy.zcl] [0xF27D:1:0xef00] Received command 0x0B (TSN 20): Default_Response(command_id=0, status=<Status.SUCCESS: 0>)
2023-12-01 15:31:06.029 DEBUG (MainThread) [zigpy_znp.api] Received command: AF.IncomingMsg.Callback(GroupId=0x0000, ClusterId=61184, SrcAddr=0xF27D, SrcEndpoint=1, DstEndpoint=1, WasBroadcast=<Bool.false: 0>, LQI=96, SecurityUse=<Bool.false: 0>, TimeStamp=4570688, TSN=0, Data=b'\x09\x5D\x02\x00\x14\x69\x02\x00\x04\x00\x00\x00\x03', MacSrcAddr=0xF27D, MsgResultRadius=29)
2023-12-01 15:31:06.030 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(timestamp=datetime.datetime(2023, 12, 1, 13, 31, 6, 30204, tzinfo=datetime.timezone.utc), src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0xF27D), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=0, profile_id=260, cluster_id=61184, data=Serialized[b'\t]\x02\x00\x14i\x02\x00\x04\x00\x00\x00\x03'], tx_options=<TransmitOptions.NONE: 0>, radius=29, non_member_radius=0, lqi=96, rssi=None)
2023-12-01 15:31:06.031 DEBUG (MainThread) [zigpy.zcl] [0xF27D:1:0xef00] Received ZCL frame: b'\t]\x02\x00\x14i\x02\x00\x04\x00\x00\x00\x03'
2023-12-01 15:31:06.031 DEBUG (MainThread) [zigpy.zcl] [0xF27D:1:0xef00] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.CLUSTER_COMMAND: 1>, is_manufacturer_specific=0, direction=<Direction.Client_to_Server: 1>, disable_default_response=0, reserved=0, *is_cluster=True, *is_general=False), tsn=93, command_id=2, *direction=<Direction.Client_to_Server: 1>)
2023-12-01 15:31:06.032 DEBUG (MainThread) [zigpy.zcl] [0xF27D:1:0xef00] Decoded ZCL frame: BecaManufCluster:set_data_response(param=Command(status=0, tsn=20, command_id=617, function=0, data=[4, 0, 0, 0, 3]))
2023-12-01 15:31:06.033 DEBUG (MainThread) [zigpy.zcl] [0xF27D:1:0xef00] Received command 0x02 (TSN 93): set_data_response(param=Command(status=0, tsn=20, command_id=617, function=0, data=[4, 0, 0, 0, 3]))
2023-12-01 15:31:06.033 DEBUG (MainThread) [zhaquirks.tuya] [0xf27d:1:0xef00] Received value [0, 0, 0, 3] for attribute 0x0269 (command 0x0002)
2023-12-01 15:31:06.033 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0xF27D:1:0x0201]: Attribute report 'BecaThermostat'[local_temperature_calibration] = 3
2023-12-01 15:31:06.034 DEBUG (MainThread) [zigpy.zcl] [0xF27D:1:0xef00] Sending reply header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, direction=<Direction.Client_to_Server: 1>, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=93, command_id=<GeneralCommand.Default_Response: 11>, *direction=<Direction.Client_to_Server: 1>)
2023-12-01 15:31:06.034 DEBUG (MainThread) [zigpy.zcl] [0xF27D:1:0xef00] Sending reply: Default_Response(command_id=2, status=<Status.SUCCESS: 0>)
2023-12-01 15:31:06.034 DEBUG (MainThread) [zigpy_znp.zigbee.application] Sending packet ZigbeePacket(timestamp=datetime.datetime(2023, 12, 1, 13, 31, 6, 34536, tzinfo=datetime.timezone.utc), src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0xF27D), dst_ep=1, source_route=None, extended_timeout=False, tsn=93, profile_id=260, cluster_id=61184, data=Serialized[b'\x18]\x0b\x02\x00'], tx_options=<TransmitOptions.ACK: 1>, radius=0, non_member_radius=0, lqi=None, rssi=None)
2023-12-01 15:31:06.034 DEBUG (MainThread) [homeassistant.components.zha.entity] climate.bedroom_trv_thermostat: Attribute 'local_temperature_calibration' = 3 update
2023-12-01 15:31:06.036 DEBUG (MainThread) [zigpy_znp.api] Sending request: AF.DataRequestExt.Req(DstAddrModeAddress=AddrModeAddress(mode=<AddrMode.NWK: 2>, address=0xF27D), DstEndpoint=1, DstPanId=0x0000, SrcEndpoint=1, ClusterId=61184, TSN=93, Options=<TransmitOptions.ACK_REQUEST|SUPPRESS_ROUTE_DISC_NETWORK: 48>, Radius=0, Data=b'\x18\x5D\x0B\x02\x00')
2023-12-01 15:31:06.041 DEBUG (MainThread) [zigpy_znp.api] Received command: AF.DataRequestExt.Rsp(Status=<Status.SUCCESS: 0>)
2023-12-01 15:31:06.139 DEBUG (MainThread) [zigpy_znp.api] Received command: AF.DataConfirm.Callback(Status=<Status.SUCCESS: 0>, Endpoint=1, TSN=93)
2023-12-01 15:31:08.842 DEBUG (MainThread) [zigpy.util] Tries remaining: 3
2023-12-01 15:31:08.843 DEBUG (MainThread) [zhaquirks.tuya] [0xf27d:1:0x0201] Mapping standard system_mode (0x001c) with value <SystemMode.Heat: 4> to custom None
2023-12-01 15:31:08.843 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/better_thermostat/climate.py", line 833, in startup
    await control_trv(self, trv)
  File "/config/custom_components/better_thermostat/utils/controlling.py", line 249, in control_trv
    await set_offset(self, heater_entity_id, _calibration)
  File "/config/custom_components/better_thermostat/utils/bridge.py", line 91, in set_offset
    return await self.real_trvs[entity_id]["adapter"].set_offset(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/better_thermostat/adapters/generic.py", line 160, in set_offset
    await set_hvac_mode(
  File "/config/custom_components/better_thermostat/adapters/generic.py", line 122, in set_hvac_mode
    await self.hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 2035, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2072, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call
    response_data = await _handle_entity_call(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/zha/climate.py", line 408, in async_set_hvac_mode
    if await self._thrm.async_set_operation_mode(HVAC_MODE_2_SYSTEM[hvac_mode]):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/zha/core/cluster_handlers/hvac.py", line 243, in async_set_operation_mode
    await self.write_attributes_safe({"system_mode": mode})
  File "/usr/src/homeassistant/homeassistant/components/zha/core/cluster_handlers/__init__.py", line 518, in write_attributes_safe
    res = await self.write_attributes(attributes, manufacturer=manufacturer)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/zha/core/cluster_handlers/__init__.py", line 84, in wrapper
    return await RETRYABLE_REQUEST_DECORATOR(func)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/zigpy/util.py", line 138, in retry
    return await func()
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/zhaquirks/tuya/__init__.py", line 729, in write_attributes
    manufacturer_attrs.update(new_attrs)
TypeError: 'NoneType' object is not iterable
2023-12-01 15:31:10.702 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x3825](lumi.sensor_wleak.aq1): Device seen - marking the device available and resetting counter
2023-12-01 15:31:10.702 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x3825](lumi.sensor_wleak.aq1): Update device availability -  device available: True - new availability: True - changed: False

The offset mode support for this TRV (all TRV with this attribute name) was added here KartoffelToby/better_thermostat#1047

@jacekk015
Copy link
Contributor

jacekk015 commented Dec 4, 2023

You didn't post log file but only part of the logs. Some my answer is only partially for what I see.

2023-12-01 15:31:08.843 DEBUG (MainThread) [zhaquirks.tuya] [0xf27d:1:0x0201] Mapping standard system_mode (0x001c) with value <SystemMode.Heat: 4> to custom None

BetterThermostat wanna to set SystemMode to Heat for device that can Heat only.
https://github.com/jacekk015/zha_quirks/blob/main/ts0601_trv_beca.py#L235

If you check TRV attributes you will see that there's no OFF possibility for that TRV
https://github.com/jacekk015/zha_quirks/blob/main/ts0601_trv_beca.py#L40-L57

So if BetterThermostat has an option to omit OFF mode it should also omit ON[Heat] mode also.
If you can't turn something Off then why try to turn it On?

[edit]
Later, at home, I can try to catch that with the code. The code will do nothing, but the error should not be generated.

@jacekk015
Copy link
Contributor

Quirk has been updated.

@R1DEN
Copy link

R1DEN commented Dec 5, 2023

Thank you, I'll pass that info to BetterThermostat devs

@witjojo
Copy link

witjojo commented Jan 26, 2024

Is "Better Thermostat" now working with this TRV's?

Copy link

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 github-actions bot added the stale Issue is inactivate and might get closed soon label Jul 24, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issue is inactivate and might get closed soon Tuya Request/PR regarding a Tuya device
Projects
None yet
Development

No branches or pull requests