Different JSON files for similar devices? or one that works for all

I’m adding Fan type devices to a plugin. I have created a device file and a service file that will work for all the types of fans I’m I’ll be controlling. But I need to have different JSON files to properly display controls for the various fan types. I have icons to display according to fan speed and I can use the conditions in the JSON file to select an icon. But is there a way to selectively display a button? Some fans have three speeds; high, medium, low. Others have speed numbers; 1 thru 6. I suppose I can select a JSON file programmatically in my lua code. I was just wondering if there’s another way to have only one JSON file for all types of fan devices.

Hi,

The JSON files are static and do not provide for conditionally displaying elements I’m sad to say.

If the look on the main screen or control panel needs to be different you need different JSON files. For any additional panels you can use JavaScript and that can be fully dynamic.

Cheers Rene