Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse SmartHome » New (static) channels are not shown/added for things already existing
New (static) channels are not shown/added for things already existing [message #1735413] Sat, 18 June 2016 17:15 Go to next message
Dominic Lerbs is currently offline Dominic LerbsFriend
Messages: 15
Registered: June 2015
Junior Member
Hi,

I am currently implementing a binding and adding more channels step by step. Now I observed that after adding new channels (in thing-types.xml), these are not displayed/usable for things which are already known to the system. Only when I remove and re-add a thing, the new channels are available. Is this on purpose or did I break some functionality?

For development this would still be acceptable, but if a binding is extended with a new channel in the next release, doesn't make much sense that users have to re-add all things. Therefore I rather assume that I am missing something in my binding. Any ideas?
Re: New (static) channels are not shown/added for things already existing [message #1735742 is a reply to message #1735413] Wed, 22 June 2016 11:35 Go to previous messageGo to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
Your observation is correct. A thing is created once based on its type and the available channels are written into the thing instance itself.
I agree that will probably need some mechanism to update existing things. Not sure yet whether this should be fully automatic or through manual interaction with the user.
And should only be new channels added or should channels also be removed? After all, a Thing can also have (dynamic) channels that are not part of the type definition. How to tell whether they had been added through the type or manually? So it is probably safer to not remove anything.
Re: New (static) channels are not shown/added for things already existing [message #1735796 is a reply to message #1735742] Wed, 22 June 2016 18:44 Go to previous messageGo to next message
Dominic Lerbs is currently offline Dominic LerbsFriend
Messages: 15
Registered: June 2015
Junior Member
Thanks for the explanation Kai, at least this means I didn't break something with my binding Smile
I don't know much about the internals of ESH, but can't a property be added to each channel, stating if it was created dynamically or not? Then it would be easy to say that the bindings are responsible for creating and deleting dynamic channels, while static channels could be managed by the framework. Anyway, good to hear that you have this on your list!
Re: New (static) channels are not shown/added for things already existing [message #1736983 is a reply to message #1735796] Mon, 04 July 2016 19:03 Go to previous messageGo to next message
Markus Rathgeb is currently offline Markus RathgebFriend
Messages: 105
Registered: August 2014
Senior Member

Kai, I already think about this one. Not to find a general solution for the framework but how a binding or binding developer could handle that in the develop phase.
There is already a method to change the thing type.
WDYT, could (for a custom binding) this method work (if I refer to 'thing property' here, I assume something that is allowed to be written by the binding / thing handler and is persistent -- so, not the real thing properties):
* if there is no 'created_version'' property, it is created with the current version of the binding (so, only once)
* if the property is available and does not fit to (is lower then) the current version of the binding, the property is removed and the 'change thing type' method is called (using the same thing type but another UID)
* the thing will be created again and the handler will add created_version with the current one again.

I am only interested if this could be working while the development phase where a thing changes very frequently.

I don't know if a binding should ever remove or add channels. But IMHO it is difficult to decide.
If a handler does not send updates to a previously channel anymore, it is rather useless, but removing it could be lead perhaps to a wired user experience (User: "Hey, where is my channel now??").

Adding channels is perhaps not such a problem, but at least we do not know if a thing has been created by the DSL or something similar...
Re: New (static) channels are not shown/added for things already existing [message #1737618 is a reply to message #1736983] Mon, 11 July 2016 10:20 Go to previous messageGo to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
Markus, not sure how you envision this to be a "development feature" only - would you delete all this code again before finalizing your binding?
Why not simply define your thing in a file, so that you can do the evolution/adaption any time during your development cycle?
Re: New (static) channels are not shown/added for things already existing [message #1737621 is a reply to message #1737618] Mon, 11 July 2016 11:04 Go to previous messageGo to next message
Markus Rathgeb is currently offline Markus RathgebFriend
Messages: 105
Registered: August 2014
Senior Member

If I develop my bindings I have to add, remove and rename channel types and channel ids of a thing frequently.
Sure, perhaps I should do all correctly once and never change stuff again, but some knowledge of devices has to be learned by development... Wink [see below]

If the development is done, I normally have not to add or remove channels because the real device is nothing that changes anymore.

Why do you think I should remove all my code?

For example EnOcean devices should use EEPs for communication.
A device manufacturer states that its device is using EEP xx-yy-zz.
But if you use the EEP xx-yy-zz you identify that it is not EEP conform.
* some stuff of the EEP is not supported -> remove channels because unused
* some stuff of the EEP is used differently -> change channels
* some stuff that is not part of the EEP is implemented on some proprietary fashion -> add channels

So, the thing-type for this devices changes while development.
After I have added this specific device, it does not change anymore.

I have written "I am only interested" and that I does not search for a general solution for myself.
I never have written that this is a "development feature" only. I only have written how this topic fits to me at the moment.
Re: New (static) channels are not shown/added for things already existing [message #1739511 is a reply to message #1737621] Tue, 02 August 2016 14:55 Go to previous message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
Quote:
Now I observed that after adding new channels (in thing-types.xml), these are not displayed/usable for things which are already known to the system


It actually just came to my mind that this is not always the case. Afair, for DSL defined Things, all channels from the type are added dynamically at startup, so you should always see the latest changes.
We could possibly change the ManagedThingProvider in a similar way - if we store a Thing without any channels, the channels could be taken from the Thing type at startup. Imho that would be quite useful that way.

If you agree, feel free to enter an issue.
Previous Topic:EnOcean Binding
Next Topic:Running ESH on Knoplerfish framework
Goto Forum:
  


Current Time: Tue Apr 16 16:49:13 GMT 2024

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

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

Back to the top