nethawk wrote:
Probably there is an timing issue, TuyaMCU processes dpId 22 while it already
receives dpId 23 instruction. If that's true:
If you would first send dpId 23, followed by dpID 22 (in one command) the
temperature would be processed, but not the brightness.
Suggestion 1: Send 2 seperate commands for dpId 22 and 23, like you already
do for dpId 21, so you can include some milliseconds of sleep.
Suggestion 2: Send only the dpId to the MCU that was changed.
At first I was sending dpID 22 and dpID 23 separately. It didn't work back then so I hoped that maybe I can combine those two dpIDs into one packet, but that, surprisingly, doesn't seem to work as well. This is not what I expected.
Your suggestions are basically the steps that I was planning to take next. Option 2 seems very attractive and easy to do but I don't think that we can guarantee that the two variables will never change at the same time.
I think I will plug a simple delay milliseconds between sends for now and later I will implement some kind of simple send queue for TuyaMCU.
Let me do that simple delay milliseconds test first:
https://github.com/openshwprojects/OpenBK7231...mmit/7e3da5e69fe028b8ebd9d9cc0feca04bdebfad82
Can you check latest build? I am really not sure if it will work... this delay would also delay the HTTP response, it's a bad practice in general, but let's try it first just to know if it helps.