Does anyone know how to set the category for plugins on UI5? Every time I put a plugin in, it only shows up in the “All” category. And, the option to manually set the category doesn’t exist when I click on the wrench icon.
I think you could use the variable “category_num” to set the category of a device. It can be found by clicking the wrench button and selecting the advanced-tab.
A list with all categories can be found here: http://wiki.micasaverde.com/index.php/Luup_Device_Categories
I did move around some devices and they still work, but I honestly don’t know what influences this has on functionality.
Thanks for the response. However, I think I may have been unclear about what I meant.
If I set up a device like a Z-wave lock the category_num setting is available under “Advanced” on the wrench menu. But, if I build a plugin using something like the Somfy example on the Wiki, the category_num setting doesn’t show up under the “Advanced” menu. I suspect there is some kind of value that needs to be set in the D_.xml, or D_.json files to get this to show up. I have tried using tags like <category_num> and in the block, but neither seems to do anything.
I suspect I am missing something simple.
You could try: -
luup.attr_set("category","9",k)
As I haven’t tried it myself I am not sure if it is correct.
Zoot
It looks like that was really close. The attribute name just needs to be changed to “category_num” instead of “category” and it worked like a charm!
Thanks!
What file does this code need to be in and where?
Thanks,
Rory
Unfortunately, I don’t think there is a really straight forward answer to that. It needs to be put somewhere in your I_*.xml file that will get called when a device comes in to existence. If you are doing a simple device that could probably be the function defined in your tags. However, it can pretty much go anywhere in your LUA code. The category just won’t be set until that line is called.