vselitsky
(Vladislav)
1
- Platform information:
- Hardware: CPUArchitecture/RAM/storage
- OS: Windows 7 64bit
- Java Runtime Environment: Zulu8 / Zulu17
- openHAB version: 2.5 / 4.0
I’ve got a very general question: does a URL like syntax: JS(<scriptname>.js?arg=value)
work for an Item state transformation?
rlkoshak
(Rich Koshak)
2
Yes, use URL like syntax. But it only works on OH 4.0+, not 3.x (I think, it may work there in some circumstances) nor 2.5.
JS(<scriptname>.js>arg1=value1&arg2=value2)
Also note that if the transform is a one liner you can use an inline script. For example
JS(| Math.round(parseFloat(input)))
1 Like