Hello,
I’m still learning to do openhab. I’m creating an custom widget to control an Hue group. I would like to set the scene to the group. I’m able to do this by a rule which uses sendHttpPutRequest to switch to the scene, but currently the scene ID is fixed in the rule. I would like to enumurate the scene Ids from the Hue bridge, and use them in my Openhab widget.
I can get them in a JSON response from:
http://api//scenes
Format:
{"CchzXmkNLypkgtq":{"name":"Arctische dageraad","lights":["3","4","5","6","7","8","9","12","13"],"owner":"none","recycle":false,"locked":false,"appdata":{"version":1,"data":"a9iwJ_r01_d17"},"picture":"","lastupdated":"2017-12-05T16:43:58","version":2},
"IQzfjQpsbNE-VGq":{"name":"Savanne zonsondergang","lights":["3","4","5","6","7","8","9","12","13"],"owner":"none","recycle":false,"locked":false,"appdata":{"version":1,"data":"JvkFV_r01_d15"},"picture":"","lastupdated":"2017-12-10T14:07:54","version":2}}
It’s possible to parse JSON in an item, but I can only parse a single string and not an array.
What would be my options here?
Any help is very welcome, thanks!
Bastiaan