dresden-elektronik / deconz-rest-plugin

deCONZ REST-API plugin to control ZigBee devices
BSD 3-Clause "New" or "Revised" License
1.9k stars 503 forks source link

JS add R.hasCluster(ep,clusterId [,side]) #7634

Closed manup closed 8 months ago

manup commented 8 months ago

R.hasCluster(endpoint, clusterId [, side]) -> bool

The numbers can be written as decimal or hexadecimal (but not strings).

In a matchexpr this function can be used to select a DDF if the device Simple Descriptors have (or have not) a specific cluster. This is useful since some devices add new clusters via OTA firmware updates, for which new DDFs might be required.

Important: This must only be used in DDF matchexpr it's not meant for "write" or "parse" functions!

Example: { matchexpr: "R.hasCluster(0x0b, 0xFC03)" }