Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse SmartHome » Gather the data from channels
Gather the data from channels [message #1790937] Wed, 20 June 2018 11:31 Go to next message
Bartosz Kowalczyk is currently offline Bartosz KowalczykFriend
Messages: 4
Registered: June 2018
Junior Member
Hi,

I am quite new in ESH development and I need to ask You for some assistance.

My goal is to access all current working things and then access all active channels among them once their value (state?) have changed.

I tried to implement a custom StateChangeListener but now I am confused whether this is the right direction. I cannot access addStateChangeListener() method in scope of my binding. I am wondering how to get a direct access to ESH event bus to identify and gather the data I need?

All replies, thoughts and ideas are more then welcome.
Thanks.
Re: Gather the data from channels [message #1790940 is a reply to message #1790937] Wed, 20 June 2018 12:14 Go to previous messageGo to next message
Henning Treu is currently offline Henning TreuFriend
Messages: 44
Registered: April 2017
Member
Hi Bartosz,

in the scope of a binding you are not supposed to access items or item states directly.
What are you trying to achieve? In case you need to access items for "other" reasons you may implement your own bundle and interact with the ItemRegistry directly.

Cheers,
Henning
Re: Gather the data from channels [message #1790944 is a reply to message #1790940] Wed, 20 June 2018 12:35 Go to previous messageGo to next message
Bartosz Kowalczyk is currently offline Bartosz KowalczykFriend
Messages: 4
Registered: June 2018
Junior Member
Hello Henning,

thank You very much for the reply. I understand that the framework principals are sometimes very strict. It is easy to get confused.

My goal is to somehow filter selected things and store their channel values in some database. So I can access historical data that was transferred through bindings.

Regards,
Bartosz
Re: Gather the data from channels [message #1790952 is a reply to message #1790944] Wed, 20 June 2018 13:55 Go to previous messageGo to next message
Henning Treu is currently offline Henning TreuFriend
Messages: 44
Registered: April 2017
Member
That sounds like you want to implement a PersistenceService. Unfortunately there are not existing persistence services in ESH right now, so nothing I can refer you to. Please have a look at the appropriate interfaces
org.eclipse.smarthome.core.persistence.PersistenceService
and
org.eclipse.smarthome.core.persistence.QueryablePersistenceService
.
Expose your new persistence service as an OSGi service and the framework will pick it up automatically.
Re: Gather the data from channels [message #1792394 is a reply to message #1790952] Mon, 16 July 2018 22:23 Go to previous message
Lukasz Dywicki is currently offline Lukasz DywickiFriend
Messages: 34
Registered: July 2009
Member
I'm kinda late, but as old polish saying states - better late than never. :-)

While requirements remains unclear there are several ways how you can exit "smarthome" boundary and explore your own journey. Both binding and persistence service might use messaging protocol such MQTT which gives you possibility to inject processing and filtering logic in middle. :-)

Kind regards.
Łukasz
Previous Topic:change states of a channel
Next Topic:Bridge Handler adding discovered ChildThing.
Goto Forum:
  


Current Time: Wed Apr 24 18:11:30 GMT 2024

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

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

Back to the top