Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse SmartHome » How to Pre-populate "Location Field" for Thing in Paper UI's autodiscover Inbox
How to Pre-populate "Location Field" for Thing in Paper UI's autodiscover Inbox [message #1753373] Sun, 05 February 2017 07:55 Go to next message
Felix Lo is currently offline Felix LoFriend
Messages: 8
Registered: October 2015
Junior Member
I am building my own binding and able to display all the discovered things in Paper UI inbox. It seems that in recent builds, there is a location field.

Anyone has any idea how to populate this field programitcally via custom binding? Following is the code that i use in my custom binding:

uid = new ThingUID(THING_TYPE_UID_TOPIC_THING, "device_" + strControllerId);
properties.put("topic", "device");
properties.put("deviceId", Integer.parseInt(strControllerId));
properties.put("location", strLocation);

discoveryResult = DiscoveryResultBuilder.create(uid).withProperties(properties)
.withRepresentationProperty("device_" + strControllerId)
.withLabel("Controller #: " + strControllerId + " Location: " + strLocation)
.withBridge(bridgeHandler.getThing().getUID()).build();
thingDiscovered(discoveryResult);

[Updated on: Sun, 05 February 2017 07:56]

Report message to a moderator

Re: How to Pre-populate "Location Field" for Thing in Paper UI's autodiscover Inbox [message #1753376 is a reply to message #1753373] Sun, 05 February 2017 10:20 Go to previous messageGo to next message
Markus Rathgeb is currently offline Markus RathgebFriend
Messages: 101
Registered: August 2014
Senior Member

AFAIK there is no mechanism to propagate the location to the discovery result.
The location could be set on the thing later.
Re: How to Pre-populate "Location Field" for Thing in Paper UI's autodiscover Inbox [message #1754113 is a reply to message #1753376] Tue, 14 February 2017 15:09 Go to previous messageGo to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 657
Registered: December 2011
Senior Member
Just like the label, the location field is meant to be set by the user, not by the binding.
Re: How to Pre-populate "Location Field" for Thing in Paper UI's autodiscover Inbox [message #1755190 is a reply to message #1754113] Tue, 28 February 2017 20:43 Go to previous messageGo to next message
David Bennett is currently offline David BennettFriend
Messages: 5
Registered: February 2017
Junior Member
Why is this though? In the nest case, for example, nest has a location concept on their devices. It would be good to be able to pull this in as part of the initial setup. Location in general seems to be a piece that openhab could expand on I think, as I suggested in my other post.
Re: How to Pre-populate "Location Field" for Thing in Paper UI's autodiscover Inbox [message #1755199 is a reply to message #1755190] Wed, 01 March 2017 02:45 Go to previous messageGo to next message
Tim Roberts is currently offline Tim RobertsFriend
Messages: 29
Registered: September 2016
Junior Member
Just to add to this - I'd love to see this as well. For both Russound and Atlona - the zones are associated with locations as well. When I discover them - I could easily preset the location field as well.
Re: How to Pre-populate "Location Field" for Thing in Paper UI's autodiscover Inbox [message #1755484 is a reply to message #1755199] Fri, 03 March 2017 17:01 Go to previous message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 657
Registered: December 2011
Senior Member
How would you merge the locations from 20 different bindings into one set? I'd expect the locations that come from external systems are not necessarily in sync with the ones you setup in ESH/OH.
But yes, I agree, it could be made available at least as a suggestion for the user.
The short answer why it isn't possible through a discovery result is that the location was added after the discovery mechanism had been designed Smile
Previous Topic:Persistent data for a binding
Next Topic:Thing Added/Removed notification
Goto Forum:
  


Current Time: Sat Sep 22 19:30:29 GMT 2018

Powered by FUDForum. Page generated in 0.01822 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top