This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Combo box on visualization
#1
Hi, 

I would like to put a combo box on in visualization from wich I can choose a value (taken from an array, string in that case) to update a address group.

Do you have any solution?

Thank you

Peppe
Reply
#2
Add Custom values to control object and set Control type to "Custom value select" in Vis. parameters
Reply
#3
(17.04.2018, 10:04)admin Wrote: Add Custom values to control object and set Control type to "Custom value select" in Vis. parameters

Sorry, I don't understand

Can you give me an example?
Reply
#4
(17.04.2018, 10:37)gdimaria Wrote:
(17.04.2018, 10:04)admin Wrote: Add Custom values to control object and set Control type to "Custom value select" in Vis. parameters

Sorry, I don't understand

Can you give me an example?

Attached Files Thumbnail(s)
           
------------------------------
Ctrl+F5
Reply
#5
Thank you so much!

I just need the last puzzle card: how I can do the above via script? I need to:
1) read an array of string
2) create or update the display text value for every object value with each string of the array

BR

Peppe
Reply
#6
Can you explain what kind of task do you have? Another solution is to create html select element via Custom JavaScript.
Reply
#7
(17.04.2018, 13:04)admin Wrote: Can you explain what kind of task do you have? Another solution is to create html select element via Custom JavaScript.

That's my script:



------

ok I can get the playlist name to play with your hints, but... I get the playlists every time with:

playlists = http://192.168.0.107/api/v1/listplaylists

which an array. So i have to update time by time the value on '32/1/19' with the elements of the array.

value = event.getvalue()
address = event.dst

if value then
 
 playlist = grp.getvalue('32/1/19')
 
 
 
require('socket.http')
socket.http.TIMEOUT = 5

 socket.http.request('http://192.168.0.107/api/v1/commands/?cmd=playplaylist&name='..playlist)
 os.sleep(2)

 grp.update(address, 0)
end
Reply
#8
You can overwrite custom values with grp.create. You will need a scheduled script to reload playlist from time to time. You will also need to put this list into storage so you can get playlist name from numeric object value in your event script.

Code:
grp.create({
  address = '32/1/1',
  enums = {
    [0] = 'Playlist 1',
    [1] = 'Playlist 2',
    [2] = 'Playlist 3'
  },
})

This will still require visualization reload in case custom values are changed.
Reply
#9
Great!

Thank you so much.

Peppe
Reply
#10
(18.04.2018, 08:35)admin Wrote: You can overwrite custom values with grp.create. You will need a scheduled script to reload playlist from time to time. You will also need to put this list into storage so you can get playlist name from numeric object value in your event script.

Code:
grp.create({
 address = '32/1/1',
 enums = {
   [0] = 'Playlist 1',
   [1] = 'Playlist 2',
   [2] = 'Playlist 3'
 },
})

This will still require visualization reload in case custom values are changed.

Please, can you give me the right code to require visualization reload by button clicking?
Reply
#11
Hi,

Here is a JS code sample to reload visu by KNX command:
Code:
$(function(){
if (typeof grp != 'undefined') {
  grp.listen('10/1/1', function(object, state) {
    var value = object.value;
    if (state == 'value') {
      if (value == true) {
        location.reload();
      }
    }
  });
}
});
BR,

Erwin
Reply
#12
(20.04.2018, 12:30)Erwin van der Zwart Wrote: Hi,

Here is a JS code sample to reload visu by KNX command:
Code:
$(function(){
if (typeof grp != 'undefined') {
  grp.listen('10/1/1', function(object, state) {
    var value = object.value;
    if (state == 'value') {
      if (value == true) {
        location.reload();
      }
    }
  });
}
});
BR,

Erwin

Thank you! Wink
Reply


Forum Jump: