shry15harsh
(Harsh Choudhary)
February 2, 2016, 12:49pm
1
I have created Dynamic channels in my binding as
ChannelTypeUID triggerUID = new ChannelTypeUID(BINDING_ID, "dynamic"); Channel mychannel = ChannelBuilder.create(new ChannelUID(getThing().getUID(), "channel_name"), "String") .withType(triggerUID).build(); thingBuilder.withChannel(mychannel);
When I query things using /rest/things I do not get channels which are generated dynamically in the JSON.
Where am I wrong in creation of channels?
Kai
(Kai Kreuzer)
February 2, 2016, 4:51pm
2
Are you doing this within your ThingHandlerFactory.createThing()
?
shry15harsh
(Harsh Choudhary)
February 2, 2016, 6:15pm
3
No, I am doing in initialize
method of ThingHandler
class.
Kai
(Kai Kreuzer)
February 3, 2016, 10:15am
4
At this moment, the Thing already exists and thus needs to be edited (through edit/updateTing), see the documentation .
shry15harsh
(Harsh Choudhary)
February 5, 2016, 10:32am
5
Yes I was doing that.
It was my mistake. There were some null channels in thingBuilder.withChannels(channels_array)
and thus it was throwing error. Now channels are updated with thing.
Thanks!!
1 Like