Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse SmartHome » Receiving Items state(Receiving Items state from binding)
Receiving Items state [message #1782556] Mon, 26 February 2018 12:55 Go to next message
Vitalii vlasiuk is currently offline Vitalii vlasiukFriend
Messages: 1
Registered: February 2018
Junior Member
Hi all.
I am developing binding and It requires sending multiply items states to hardware.
I have channels names, but I cannot find API that allows return Items, linked to this channels.
Could someone help with this?
How to get Items linked to Binding Channel?
Re: Receiving Items state [message #1783713 is a reply to message #1782556] Fri, 16 March 2018 08:19 Go to previous messageGo to next message
Henning Treu is currently offline Henning TreuFriend
Messages: 44
Registered: April 2017
Hi Vitalii,

a binding is not supposed to know any items. Items are the abstraction layer for user interfaces, rules, etc.
Please read the documentation about concepts here and binding development here.
The framework will send commands and state updates to linked channels and your binding is supposed to forward these to the hardware. On the other direction, state updates you detect on your hardware (by polling or events) should be given to the framework as state updates for the corresponding channel.
The framework will take care of updating items state.

Re: Receiving Items state [message #1794871 is a reply to message #1783713] Mon, 10 September 2018 02:33 Go to previous messageGo to next message
mdn thi bui is currently offline mdn thi buiFriend
Messages: 1
Registered: September 2018
Junior Member
Hello Henning,

I have a question regard to the same idea.

Use Case: I want to write my own bundle and deploy it in Karaf. This bundle should get "access" to all "items" provided by other bundles(bindings: knx, yahooweather, zwave, etc.), send these "items" commands((switch light on or off, etc.).

In the console of openHAB, I can get easily "access" to the items with the command:
smarthome:status <itemname>
or send data to them
smarthome:send <itemname> <data>

If I want to "access all the items" and execute my commands in my Java code, what kind of possibilities do I have?

I know that my question is somewhat weird, since items is an abstract concept and they can not be directly accessible from my code but if there is any possibilities to solve my problem, I would like to hear the approaches.
Re: Receiving Items state [message #1795028 is a reply to message #1794871] Thu, 13 September 2018 06:38 Go to previous message
Markus Rathgeb is currently offline Markus RathgebFriend
Messages: 105
Registered: August 2014
Senior Member

If you develop a binding then you should not access the items yourself.

If you create an OSGi bundle that should handle some logic you can e.g. access the item registry to access the items and you can implement an event subscriber if you want to get notified about events.
Previous Topic:New Prometheus Metrics bundle - Need help attaching to Pax logging
Next Topic:RULE Engine issue when installed Custome Core ID Bundle with new Custome API'S
Goto Forum:

Current Time: Sun May 26 00:23:38 GMT 2024

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

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

Back to the top