Repository navigation
DDF support Tuya manufacturer specific cluster - #5868
Conversation
|
@SwoopX I have changed the compare operator to not overwrite different existing StateChange objects if they are different: Might not be the best solution but should work for the issue you've seen. bool StateChange::operator==(const StateChange &other) const
{
if (m_changeFunction == other.m_changeFunction && m_items.size() == other.m_items.size())
{
for (size_t i = 0; i < m_items.size(); i++)
{
if (m_items[i].suffix != other.m_items[i].suffix)
{
return false;
}
}
return true;
}
return false;
} |
|
@manup That's great, thanks. I also fiddled something together doing the trick, however, you know the code better than me and probably know the better approach. Happy to give it a test for the device I'm currently on this evening. |
|
So much to read ^^ You have better documentation than me ? Because on mine it s But no more information on what id fn, execpt it s always 00
I haven't checked the code yet, but you are sure it s not hazardous to not use the datapoint AND the type ?
What will happen if we have for exemple 2 return with the same dpid but 2 different types ? |
Not sure if my docs are better, but I simply followed the Tuya description, here is no fn mentioned only a 2 bytes length, given that all is big-endian it makes sense for numbers < 256 that the first byte is always 0 :)
It's only a guess, I'd assume that a specific datapoint for one device has always the same type, but I could be wrong here. Do you know any devices which use one datapoint with different types? DDF support can be easily added if needed. |
|
Merging this for now to get the other PRs which depend on this in. If needed the "dt" parameter for the "parse" function can be added in a further PR. |
Posssible, the dimmer switch for exemple (from my previous post) , but can't confirm a model, will see on usage. |
|
FYI, I made a wiki page from this PR ... feel free to update it if needed https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/DDF-support-Tuya-manufacturer-specific-cluster-&-How-to-know-which-datapoints-a-Tuya-device-provides%3F |

This PR adds support of DDF "read", "write" and "parse" functions for the Tuya manufacturer specific cluster (0xEF00).
Example: MoesGo Smart Dimmer Module (_TZE200_e3oitdyu): (PR #5869)
The parse function needs to specify the datapoint
dpidto be parsed. The actual data type is part of the message and processed accordingly.The write function further has to specify the data type via
dtwith a subset of ZCL data types:In C++ code the write function is best used by the
StateChangeclass, as this PR does for REST-APIPUT /lights/<id>/stateendpoint when settings{"on": bool, "bri": number}. This has the benefit that if commands didn't workout they are repeated automatically. ... more on that soon in the updated docs.state/on). It doesn't actually read a single value but triggers the Tuya device to report all datapoints.The read and parse functions are available via DDF editor, write will be added soon
How to know which datapoints a Tuya device provides?
Exec the Data Query command in the Cluster Info panel of the Tuya specific cluster:
After a few seconds the debug log shows incoming reports for all datapoints.
Note the type here is the Tuya data type not the ZCL data type.