Hue get HSV values with blockly


I would like to query the individual HSV (hue, saturation, value) values with blockly.

get state of item returns me e.g. 120,9,0
how can i query the individual values?

make list from text returns an error on the console:
Script execution of rule with UID '3421910b49' failed: TypeError: light_hsv.split is not a function in <eval> at line number 8


How about that?

make list from text works if the value is actually a string, but not if I query the value from the item directly with get state of item

The return type of the item (the one below is a hue light) is an object but you can force it to become a string:

The good news is that from openHAB 4.0 on this is not necessary anymore as it will be automatically converted to String (if you use the new jsscripting / GraalJs which will become the default)

1 Like

Thank you, that was exactly what I was looking for! :slight_smile: