sky201503 / openhab

Automatically exported from code.google.com/p/openhab
GNU General Public License v3.0
0 stars 0 forks source link

new item type concept #411

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hello,

I would like to propose a change the concept of items. As far I have understood 
(please correct me if I am wrong), items have three functionalities:
1.) hold a status (e.g. lamp is lighting or not, ON/OFF, 1/0; or a lamp has the 
brightness of 80%, numerical value ) and
2.) an item has an user interaction function (e.g. switch: change status to 
on/off; or set a specific dimmer value of 60%)
3.) bind the status of an item to a hardware (e.g. switch on a physical lamp) 
or send the status to a hardware or software device (e.g. set a value on a 
modbus)
The proposal is to split this functionalities into five item types:
a.) digital input item
b.) analog input item
c.) digital output item
d.) analog output item 
e.) complex items

1. Feature Description
Input and output items should have a status value which can be selected and 
used in the logic. It should be possible to bind input and output items with 
bindings to the bus and hardware/software. For all items it should be 
(optionally) possible to configure which icons are used in the user interface 
to represent the items. Digital items should have two icons (one for TRUE/ON 
and one for FALSE/OFF). Analog items should have several icons (like the dimmer 
or roller item has already now). Maybe it can be defined under which conditions 
based on the status which icon is displayed. Analog input control elements like 
a wheel or slider could be used/configured. All items could have default icons. 
Input items could have default control elements. Output items shouldn't have a 
control element.

a.) digital input items: have status ON/OFF, can have a digital user interface 
control element (like a switch) but needn't (like a contact)
b.) analog input item: have a numeric value, can have a analog user interface 
control element (like a wheel, up/down buttons or a slider) but needn't (like a 
sensor value)
c.) digital output item: have status ON/OFF, are bound to a digital bus device 
(like a electric socket which is switch ON/OFF), the existing contact item is 
another example.
d.) analog output item: have a numeric value, are bound to an analog bus device 
(like electric dimmer)
e.) complex items: these item type can combine a number of the types above 
a.)-d.). It can also represent the existing items like a switch which have an 
ON/OFF control element (digital input) + hardware binding to a light (including 
icon display of the status). It could be maybe possible to have also internal 
logic in complex items what happens with the output vlaues if you have specific 
input values. It might be also possible to have more than one input item and 
more than one output item within this complex item.

Benefit: With this concept you will give more flexibility to combine inputs, 
outputs + logic as well in the representation in the user interface.
As example at the moment the switch item is bound to one output. Maybe with 
these concept an switch can set a status which has an effect for several output 
items (e.g. one switch turns a number of lights on and off; or one fire sensor 
triggeres a number of actions like turn on alarm, pull up rollers and turn on 
all lights). At the moment it is also not possible to change the 
icons/representation in the user interface for input and output part.

2. Example Use Case
a.) digital input item: switch (hardware as well in UI), push button (hardware 
as well in UI; see also Issue 410), window contact sensor, movement sensor, 
door bell
b.) analog input item: analog sensors, e.g. temperatur, light, water etc., 
number input field in the user interface, UI slider, UI wheel
c.) digital output item: lamps, electric sockets, door opener, garage door 
trigger, UI icon
d.) analog output item: dimmer, motor, display, UI text, other UI elements with 
numerical values
e.) complex items: existing items like switch item, dimmer item, black box item 
with programmable logic

If you need more information or if you have questions about the idea, feel free 
to answer.

Best regards,

Christian

Original issue reported on code.google.com by chrif...@gmail.com on 19 Aug 2013 at 6:47

GoogleCodeExporter commented 8 years ago
Hi Christian,
Sorry for not answering for such a long time! I absolutely think that your 
suggestions are very valuable, my problem, why I didn't yet take the time to 
follow-up is that they would mean quite a fundamental change of the core parts 
of openHAB.
Nonetheless, as Eclipse SmartHome is now starting, I want to take the chance 
and discuss such ideas. I have opened an according bug at Eclipse: 
https://bugs.eclipse.org/bugs/show_bug.cgi?id=423550
Feel free to join in any discussion that might start there in the next weeks!

Original comment by kai.openhab on 8 Dec 2013 at 8:35