Nest Binding is available for Openhab1. I am porting it according to the new concepts of Openhab2 (or Eclipse Smarthome). I have implemented everything from constructing thing, mapping Java objects to JSON, updating state and status of channel and handling commands.
Now, I am stuck at creating new items. Number of devices is not a constant number, so I need to create new channels according to the devices and sensor data coming. There’s no issue with that. Problem is when I need to create new items. I need to dynamically generate new items and link them to channels. I could not find any documentation on creating new items. I am thinking of directly updating the items file. What is the best approach to do so or is there some alternative?
I do not want to hard code anything.
What are “they”? All items that the user declares in the items-file are certainly in the item registry. And all items that are linked to a channel of the Nest-Thing, will make the handleCommand called.
But I cannot query them using Rest API. GET /rest/items is only giving me items which I added using api only but not from items-file. Additionally, when I try to change the value of item (defined in items-file) using Classical UI, handleCommand is not called and console gave me error that item is not in registry.