Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse SmartHome » Multiple items, same channel
Multiple items, same channel [message #1725388] Thu, 03 March 2016 08:46 Go to next message
Smart Home is currently offline Smart HomeFriend
Messages: 109
Registered: February 2015
Senior Member
Hi,

I want to create multiple items for a specific channel. The issue is that I need to have different configuration for each item. As far as I understand, you can have configuration in channel and not in item.

The options I see are:

1. Define in the thing type N channels from the same channel type. The problem is that I will be limited to N items.
2. Add channel dynamically each time I want to add new item. Is there an example how to create channel from channel type dynamically?
3. Use channel groups - I am not sure that this can solve my problem.

Is my understanding correct?

Thx
Re: Multiple items, same channel [message #1725403 is a reply to message #1725388] Thu, 03 March 2016 10:16 Go to previous messageGo to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
The forth option might be to have configurations on the links as suggested in https://github.com/eclipse/smarthome/issues/583 - I think this is the best, but this isn't yet implemented.
Re: Multiple items, same channel [message #1725414 is a reply to message #1725403] Thu, 03 March 2016 11:10 Go to previous messageGo to next message
Smart Home is currently offline Smart HomeFriend
Messages: 109
Registered: February 2015
Senior Member
Yes, it seems that it is the better option. Hope it will be added soon.
Re: Multiple items, same channel [message #1725415 is a reply to message #1725414] Thu, 03 March 2016 11:19 Go to previous messageGo to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
Any help is appreciated - feel free to work on an according PR!
Re: Multiple items, same channel [message #1725568 is a reply to message #1725388] Fri, 04 March 2016 13:20 Go to previous messageGo to next message
Marcel Verpaalen is currently offline Marcel VerpaalenFriend
Messages: 59
Registered: September 2014
Member
Smart Home wrote on Thu, 03 March 2016 09:46
Hi,
2. Add channel dynamically each time I want to add new item. Is there an


here an example incl channel config
see the newChannelfromTopic()

https://github.com/marcelrv/smarthome/blob/mqtt/extensions/binding/org.eclipse.smarthome.binding.mqtt/src/main/java/org/eclipse/smarthome/binding/mqtt/handler/MqttHandler.java#L371
Re: Multiple items, same channel [message #1725569 is a reply to message #1725568] Fri, 04 March 2016 13:22 Go to previous messageGo to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
Btw, Marcel, what is the status of your MQTT binding? Ready for a PR soon?
Re: Multiple items, same channel [message #1725570 is a reply to message #1725569] Fri, 04 March 2016 13:31 Go to previous message
Marcel Verpaalen is currently offline Marcel VerpaalenFriend
Messages: 59
Registered: September 2014
Member
well, it more or less works, but until the UI's support custom channel enable, and channel config editing it is useless for the majority of users.

e.g. you can only enable channels via console commands, you can't change the configuration of the channel anymore once it is set etc.

For the rest it needs cleanup, removal of unused pieces etc.

So the main difference between the earlier provided code and mine is 4 fold:
1) It supports discovery of topic
2) It allows for 1 'Thing' with multiple mqtt topics mapped to channels
3) It allows you to set the output datatype per channel instead of creating 10 channels to account for each and every possible datatype
4) It weeds out all references to the legacy OH1 datatypes and compatibility layer
Previous Topic:Sudden Error during execution
Next Topic:XML config file parsing order
Goto Forum:
  


Current Time: Thu Apr 25 21:28:17 GMT 2024

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

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

Back to the top