(16.12.2016, 15:38)I\m new to these issues and I'm not clear how to run the function you describe inside the device.I do not know what command you have to put in order to run it.I want to press a button that throws me a true, I put knx variables in true or false depending, which I have achieved, but I also want to send me to another page and there is where I do not know how to execute this function. If you could help me I would appreciate it. Wrote:
(16.12.2016, 14:58)admin Wrote: Please post in English next time
The task is to show a specific plan depending on a certain object value.
(15.04.2016, 08:31)Erwin van der Zwart Wrote: We can now create buttons with short / long press detection and send a value on press / release by adding some functions into the custom javascript.
Add content of the custom Javascript below into the custom javascript section as showed in the example of Edgars
For scene button(s) with default long push time detection after 3 seconds:
1) Create a 1 byte unsigned object and create button(s) in your visu with this main object.
2) Enter in the additional class of the button(s) these classes: scenebutton normalpressed_0 longpressed_128
3) Change the value after normalpressed_xx or longpressed_xx into your wanted value for each different button between 0 and 255
For scene button(s) with custom long push time detection after x seconds:
1) Create a 1 byte unsigned object and create button(s) in your visu with this main object.
2) Enter in the additional class of the button(s) these classes: scenebutton normalpressed_0 longpressed_128 longpresstime_20
3) Change the value after normalpressed_xx or longpressed_xx into your wanted value for each different button between 0 and 255
4) Change the value after longpresstime_xxto the wanted long push time (xx (value) * 0.1second) = seconds for long push time
For doorbell button by bit object:
1) Create a 1 bit unsigned object and create button(s) in your visu with this main object.
2) Enter in the additional class of the button(s) these classes: doorbellbutton_bit released_0 pressed_1
3) Optional flip the value after released_x and pressed_x into your wanted value for each different button between 0 and 1
For doorbell button by byte object:
1) Create a 1 byte unsigned object and create button(s) in your visu with this main object.
2) Enter in the additional class of the button(s) these classes: doorbellbutton_byte released_0 pressed_255
3) Optional change the value after released_xxx and pressed_xxx into your wanted value for each different button between 0 and 255
For screen button by 1x bit move object and 1x bit step/stop object:
1) Create 2 1 bit unsigned objects and create button(s) in your visu with move object as mainobject and step/stop object as status-object and use same image on 1 and 0
2) Enter in the additional class of the UP button(s) these classes: screenbuttonup longpresstime_15 the values 0 and 1 are hardcoded and follows the KNX standard.
2) Enter in the additional class of the DOWN button(s) these classes: screenbuttondown longpresstime_15 the values 0 and 1 are hardcoded and follows the KNX standard.
3) Change the value after longpresstime_xxto the wanted long push time (xx (value) * 0.1second) = seconds for long push time
For dimming button by 1x 3 bit dimming object and 1x bit switch object:
1) Create a 3 bit dim/blind (3.007) object and a 1 bit bit unsigned object and create button(s) in your visu with dim object as mainobject and switch object as status-object and use same image on 1 and 0
2) Enter in the additional class of the BRIGHTER button(s) these classes: dimbuttonup longpresstime_15 the values 9/1 and 8/0 are hardcoded and follows the KNX standard.
2) Enter in the additional class of the DARKER button(s) these classes: dimbuttondown longpresstime_15 the values 1/0 and 0/0 are hardcoded and follows the KNX standard.
3) Change the value after longpresstime_xxto the wanted long push time (xx (value) * 0.1second) = seconds for long push time
Thats all you need to do (:
Have fun!
BR,
Erwin van der Zwart Add this code into your custom JavaScript:
04.05.2017, 17:34 (This post was last modified: 04.05.2017, 17:38 by Erwin van der Zwart.)
Hi Roger,
I know, we have it in our PB's also (:
First of all this is not the most friendly way to do it as you never know if it initial goes up/on or down/off when using it.
We could do it in the visu but this means we have to remember last operating direction, so the script must be changed for that, but why should you do this methode in a visu?
For PB's you might have the reason of missing the positions, but in a visu you don't have that issue (:
Please let me know why you want it and i will check if i can change the code ..
(15.04.2016, 08:31)Erwin van der Zwart Wrote: We can now create buttons with short / long press detection and send a value on press / release by adding some functions into the custom javascript.
Add content of the custom Javascript below into the custom javascript section as showed in the example of Edgars
For scene button(s) with default long push time detection after 3 seconds:
1) Create a 1 byte unsigned object and create button(s) in your visu with this main object.
2) Enter in the additional class of the button(s) these classes: scenebutton normalpressed_0 longpressed_128
3) Change the value after normalpressed_xx or longpressed_xx into your wanted value for each different button between 0 and 255
For scene button(s) with custom long push time detection after x seconds:
1) Create a 1 byte unsigned object and create button(s) in your visu with this main object.
2) Enter in the additional class of the button(s) these classes: scenebutton normalpressed_0 longpressed_128 longpresstime_20
3) Change the value after normalpressed_xx or longpressed_xx into your wanted value for each different button between 0 and 255
4) Change the value after longpresstime_xxto the wanted long push time (xx (value) * 0.1second) = seconds for long push time
For doorbell button by bit object:
1) Create a 1 bit unsigned object and create button(s) in your visu with this main object.
2) Enter in the additional class of the button(s) these classes: doorbellbutton_bit released_0 pressed_1
3) Optional flip the value after released_x and pressed_x into your wanted value for each different button between 0 and 1
For doorbell button by byte object:
1) Create a 1 byte unsigned object and create button(s) in your visu with this main object.
2) Enter in the additional class of the button(s) these classes: doorbellbutton_byte released_0 pressed_255
3) Optional change the value after released_xxx and pressed_xxx into your wanted value for each different button between 0 and 255
For screen button by 1x bit move object and 1x bit step/stop object:
1) Create 2 1 bit unsigned objects and create button(s) in your visu with move object as mainobject and step/stop object as status-object and use same image on 1 and 0
2) Enter in the additional class of the UP button(s) these classes: screenbuttonup longpresstime_15 the values 0 and 1 are hardcoded and follows the KNX standard.
2) Enter in the additional class of the DOWN button(s) these classes: screenbuttondown longpresstime_15 the values 0 and 1 are hardcoded and follows the KNX standard.
3) Change the value after longpresstime_xxto the wanted long push time (xx (value) * 0.1second) = seconds for long push time
For dimming button by 1x 3 bit dimming object and 1x bit switch object:
1) Create a 3 bit dim/blind (3.007) object and a 1 bit bit unsigned object and create button(s) in your visu with dim object as mainobject and switch object as status-object and use same image on 1 and 0
2) Enter in the additional class of the BRIGHTER button(s) these classes: dimbuttonup longpresstime_15 the values 9/1 and 8/0 are hardcoded and follows the KNX standard.
2) Enter in the additional class of the DARKER button(s) these classes: dimbuttondown longpresstime_15 the values 1/0 and 0/0 are hardcoded and follows the KNX standard.
3) Change the value after longpresstime_xxto the wanted long push time (xx (value) * 0.1second) = seconds for long push time
Thats all you need to do (:
Have fun!
BR,
Erwin van der Zwart Add this code into your custom JavaScript:
Im trying to create a temperature controller in the visualisation and I would like to have two buttons(+ and -) to step the temerature setpoint 0,5 degrees up and down. Is it possible to do this in the same type of way with addittional classes and custom javascript?
17.05.2017, 22:57 (This post was last modified: 17.05.2017, 22:58 by Erwin van der Zwart.)
Hi,
You don't need a additional class for this
Just use a virtual object for your + and - buttons , set + button to 1 and min button to 0 as fixed value and add this event based script to the virtual object:
Hello I have a little question about variable range of variables in $.get() function.
Here I've tried use the glo variable (global) and fill it by data from .lp file. Inside get() function all is perfect but outside glo has still value from before the function.
Code:
123
glo = []
$.get( "/user/hvac_alias.lp", function( data ) { console.log(1, glo); data = data.trim(); data = JSON.parse(data); glo = data; console.log(2, glo)});
console.log(3, glo)
08.06.2017, 07:59 (This post was last modified: 08.06.2017, 08:34 by Gadjoken.)
Hello,
I would like to complete the following JavaScript by performing two different functions. One that works like on the java below and the other that sets the opacity to 0 and always leaving pointer-events to none. On different addresses. For example for disabledbyknx0 to 10 we will have so false then opacity to 0 and pointer-events to none and so true then opacity to 1 and pointer-events none. On the other hand for disablebyknx10 to 20 a so false then opacity to 0.5 and pointer-events to none so true then opacity to 1 and pointer-events to all.
Best regards
(13.04.2016, 11:27)edgars Wrote: In the firmware starting from 4.2016 there is Custom JavaScript feature available in LogicMachine --> Scripting --> Tools --> Edit custom JavaScript.
It is possible to create different dynamic tasks, like detect short/long press from visualization using one icon (Erwin, will you please add your example here) or as in this example, we can open specific Floor/Plan when some grp address is triggered - useful e.g. when you want IP Camera page automatically to be opened when Intercom button is pressed:
showPlan() value can be get when you hover your mouse over specific plan name and click on the arrow. Please see in pictures attached.
Hi,
I have two addresses, say '1/1/2' and '1/1/3' that I want to use to trigger the same showPlan. I have absolutely no knowledge of javascript, so how do I modify this code?
Is my understanding correct that this code gets executed whenever any address is triggered?
(13.04.2016, 11:27)edgars Wrote: In the firmware starting from 4.2016 there is Custom JavaScript feature available in LogicMachine --> Scripting --> Tools --> Edit custom JavaScript.
It is possible to create different dynamic tasks, like detect short/long press from visualization using one icon (Erwin, will you please add your example here) or as in this example, we can open specific Floor/Plan when some grp address is triggered - useful e.g. when you want IP Camera page automatically to be opened when Intercom button is pressed:
showPlan() value can be get when you hover your mouse over specific plan name and click on the arrow. Please see in pictures attached.
Hi,
I have two addresses, say '1/1/2' and '1/1/3' that I want to use to trigger the same showPlan. I have absolutely no knowledge of javascript, so how do I modify this code?
Is my understanding correct that this code gets executed whenever any address is triggered?
(13.04.2016, 11:27)edgars Wrote: In the firmware starting from 4.2016 there is Custom JavaScript feature available in LogicMachine --> Scripting --> Tools --> Edit custom JavaScript.
It is possible to create different dynamic tasks, like detect short/long press from visualization using one icon (Erwin, will you please add your example here) or as in this example, we can open specific Floor/Plan when some grp address is triggered - useful e.g. when you want IP Camera page automatically to be opened when Intercom button is pressed:
showPlan() value can be get when you hover your mouse over specific plan name and click on the arrow. Please see in pictures attached.
Hi,
I have two addresses, say '1/1/2' and '1/1/3' that I want to use to trigger the same showPlan. I have absolutely no knowledge of javascript, so how do I modify this code?
Is my understanding correct that this code gets executed whenever any address is triggered?
Thanks.
Hi
Just use the function twice.
BR
That was actually the first thing I tried: I made an exact copy of the function and changed the address.
The copy did not execute.
There is something strange going on.
I did some further testing and this script only works with the address I initially did the testing with. If I change the address to something else, it does not work.
Do I have to clear a cache somewhere?
(13.04.2016, 11:27)edgars Wrote: In the firmware starting from 4.2016 there is Custom JavaScript feature available in LogicMachine --> Scripting --> Tools --> Edit custom JavaScript.
It is possible to create different dynamic tasks, like detect short/long press from visualization using one icon (Erwin, will you please add your example here) or as in this example, we can open specific Floor/Plan when some grp address is triggered - useful e.g. when you want IP Camera page automatically to be opened when Intercom button is pressed:
showPlan() value can be get when you hover your mouse over specific plan name and click on the arrow. Please see in pictures attached.
Hi,
I have two addresses, say '1/1/2' and '1/1/3' that I want to use to trigger the same showPlan. I have absolutely no knowledge of javascript, so how do I modify this code?
Is my understanding correct that this code gets executed whenever any address is triggered?
Thanks.
Hi
Just use the function twice.
BR
That was actually the first thing I tried: I made an exact copy of the function and changed the address.
The copy did not execute.
There is something strange going on.
I did some further testing and this script only works with the address I initially did the testing with. If I change the address to something else, it does not work.
Do I have to clear a cache somewhere?
Thanks.
I do it always in private browsing then you are sure all is fresh. Good practice is to clear browser cache when strange things start to happen.