Skip to content

Temperature in Tuya IoT is F but stored as C? #219

Answered by 0x5e
rjm10101 asked this question in Q&A
Discussion options

You must be logged in to vote

I was wrong again. the current temp is a read only value, so only onGet required. the target temp is a read write value, both onGet and onSet required. the final config will be this:

{
	"deviceOverrides": [{
		"id": "device_id_or_product_id",
		"schema": [{
			"code": "temp_current",
			"onGet": "Math.round((value - 32) / 1.8);"
		}, {
			"code": "temp_set",
			"onGet": "Math.round((value - 32) / 1.8);",
			"onSet": "Math.round(1.8 * value + 32);"
		}]
	}]
}

Hope it works.

Replies: 3 comments 10 replies

Comment options

You must be logged in to vote
9 replies
@rjm10101
Comment options

@rjm10101
Comment options

@0x5e
Comment options

0x5e Apr 3, 2023
Maintainer

@rjm10101
Comment options

@0x5e
Comment options

0x5e Apr 7, 2023
Maintainer

Comment options

You must be logged in to vote
1 reply
@0x5e
Comment options

0x5e Apr 9, 2023
Maintainer

Answer selected by rjm10101
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants