Hey guys - I’m working on a project that has multiple instances of a hardware object (n number of heater devices) that are configurably enabled on an end users system. I would like to find a way to only enable the UI features for the instances they have enabled. For example, one user might have n=3 heaters, but another might have n=5 heaters, and I would like the GUI template to allow interaction with only the number of heaters enabled in each specific system. The module widget seems to work great for this on the web side but I can’t find the same feature for mobile? Am I missing something? Is there another way to do it? Enable / disable of tabs would be a great way to do it, but I understand that isn’t added to Blynk yet? Thanks!
Does anyone have any advice? Here is an example of module usage on the web app. I would say this one works pretty well for what I am going for. I have up to 8 heater units, and they can each be enabled in the module view with a virtual pin value from the device. I can’t find a clean way to do this on the mobile side though. I really wish I could enable / disable tabs in the same way as modules. Here’s a quick screenshot of the example module usage on the web app when I have 2 of the 8 instances enabled
Yes, mobile doesn’t have a module widget. But you still can achieve your goal with pages:
- Create a few Standalone pages for your goal (1 page for the specific setup)
- Create a button with page type, select some default page that will be opened on click
Now, in your code, you can do the next Blynk.setProperty (vPin, "page", page_index)
. vPin
is pin assigned to your button that opens the page. page_index
could be found in the pages list view.
So, you would have a few predefined setups Page 1, Page 2, Page 3, etc. When you know the exact setup for a user, you just set the required page for your user. Done.
Sounds good - That would work. The other method I was thinking I could use is to have a drop down menu that selects the instance, then a template that displays the data / allows interaction with the selected instance. Maybe I can remove the other menu options when they are not available also
Also - I’ve been made aware of the “isHidden” property, which should work pretty well
Yes. IsHidden may work for you as well. But it is not as flexible as pages, as on pages you may design the layout specifically for every use case. and “hiding widgets” may leave gaps in the layout.