Tuya Zigbee TRV

zigbee.convertToHexString(10, 2)

Would yield "0A" so you could use as is or prefix with "0x" if needed

The 10 is the number and 2 is how long you want your hex string to be, e.g.:

zigbee.convertToHexString(10, 4) is 000A

run out of time

def setHeatingSetpoint(preciseDegrees) {
    log.debug "setpoint $preciseDegrees"
    def dp = "0201"
    //def dp = "0202"
    def fn = "0001"
    Integer setP = preciseDegrees / 10
    log.debug "$setP"
    //def data = zigbee.convertToHexString(setP, 2)
    def data = "15"
	log.info "Set setpoint command ${zigbee.convertToHexString(rand(256), 2)}${dp}${fn}${data}"
	sendTuyaCommand(dp,fn,data)
}

dont know how it gets 15 to 9.4???
Livingroom small rad Temp Set Point 0202, data9 9.4

updated version in git

Maybe it's 15°F converted to °C (which gives 9.4) ?

This is what I'm rocking:

def setHeatingSetpoint(preciseDegrees) {
	if (preciseDegrees != null) {
        def dp = "0202"
        def fn = "00"
        def data = "04000000" + zigbee.convertToHexString(preciseDegrees.intValue() * 10, 2)
	    log.info "heating ${dp}${fn}${data}"
	    sendTuyaCommand(dp,fn,data)
	}
}

Note that it takes the set value (20) times by 10 => 200

Note that if the set value is out of the range defined in the device min/max then it will take the min/max set on the device (i think). Mine would often go to 5 which is my min

Does it work?? I've spent hours on this

-9,4 but a very random coincidence, this device isn't met to take farenheight

1 Like

Yep!

From reading github it seems there are different versions of this device and also different firmwares, I wonder if that's why I've not seen battery reports.

ive tweeked your code 1/2 degress didnt work

def setHeatingSetpoint(preciseDegrees) {
	if (preciseDegrees != null) {
        def dp = "0202"
        def fn = "00"
        def SP = preciseDegrees *10
        def data = "04000000" + zigbee.convertToHexString(SP.intValue(), 2)
	    log.info "heating ${dp}${fn}${data}"
	    sendTuyaCommand(dp,fn,data)
	}
}

updated in git


https://raw.githubusercontent.com/Mark-C-uk/Hubitat/master/Zigbee-Tuya-TRV

Hi Guys. Thanks for the hard work you're putting in here. Don't know if you've seen this article - has a list of commands that were packet sniffed

Are you guys finding the temperature reporting spotty, just turned it on this morning and it started at 16 then an hour later it hadn't reported anything till I pressed it to wake it then it jumped to 20

i cant get refresh to work either

I think it is spotty but I've not monitored it enough to say for sure. I think the github thread I posted before had information about this though I've not read all of it yet to see why it may be.

I'm hoping its not down to firmware, but it might be. I don't know if it needs the zigbree.configureReporting call made to tell it to report it status on a set interval.

I'm way past my knowledge level. There up and running ish, if anyone wants to help develop it more im happy to coordinate with a version in my git

Hi Mark,

Mine is currently reporting every 5 minutes. I will keep a check to see if this only happens when there is a change in temperature, or if it's 5 minutes regardless (the valve got hot in my hands and is slowly returning to room temperature)

Strange mine is hours! Mabey all my testing scrambled something

So, after a bit longer, it goes from 5 minutes, then 10 minutes and then 15 minutes! However, a change in temperature so far is being reported fairly quickly (there was a bit of jitter between 19 & 19.5, and it sent a few reports over a very short time). I've only just added the TRV so will keep monitoring. And many thanks for your time on this - my Eurotronic Z-Wave devices have been really unreliable, and eat batteries. Hopefully, these will last longer. I did read these ZigBee devices come with different firmware - maybe this could be the issue?

Don't know where did you get yours from?

Mine was from Amazon (to save delivery time) and branded a KK Moon. Shows as a _TZE200_ckud7u2l, model
TS0601

You a picture/link?