Skip to main content



      Home
Home » Archived » 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 02:55 Go to next message
Eclipse UserFriend
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 02:56] by 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 05:20 Go to previous messageGo to next message
Eclipse UserFriend
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 10:09 Go to previous messageGo to next message
Eclipse UserFriend
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 15:43 Go to previous messageGo to next message
Eclipse UserFriend
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] Tue, 28 February 2017 21:45 Go to previous messageGo to next message
Eclipse UserFriend
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 12:01 Go to previous message
Eclipse UserFriend
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: Fri May 16 02:12:34 EDT 2025

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

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

Back to the top