IHC binding

621 views
Skip to first unread message

Pali

unread,
Oct 14, 2012, 2:29:05 PM10/14/12
to ope...@googlegroups.com
Hi,

I have got few emails about the IHC binding (sources can be found from the clones). So here is some quick information how to configure and test it. 

Install IHC binding jar file to OpenHAB addons folder.

Configure binding by adding following lines to your OpenHAB configuration file (e.g. openhab_default.cfg) and fill IP address, user name and password. Project file is only mandatory, if you want to use enum data types between OpenHAB and IHC controller. Currently binding does not support project file downloading from the controller, so you can leave path empty if you don't need enum values.

######################## IHC / ELKO LS Binding ########################################
# Controller IP address 
ihc:ip=
# Username and password for Controller
ihc:username=
ihc:password= 
# Timeout for controller communication
ihc:timeout=5000
# Path for IHC / ELKO LS project file, if it's empty/null project is download from controller
ihc:projectFile=

IHC controller TLS certificate is self signed, so by default OpenHAB (Java) will not allow TLS connection for security reason. You need to import controller certificate to trusted list by java keytool. You can download certificate e.g. by firefox, just open https connection to your controller IP address, click "lock" icon (just before URL box) -> more information -> security tab -> view certificate -> details tab -> export.

key tool OS X example:
sudo keytool -keystore /System/Library/Java/Support/CoreDeploy.bundle/Contents/Home/lib/security/cacerts -importcert -file ELKOLivingSystemController.pem

IHC binding use resource id's to control and listening notification to/from the controller. You can find correct resource id's from you IHC project file. 

The syntax of the binding configuration strings accepted is the following:

ihc="[>]ResourceId[:refreshintervalinseconds]"

where parts in brackets [] signify an optional information.

The optional '>' sign tells whether resource is out binding only, where internal update from OpenHAB bus is just transmitted to the controller.
Binding will automatically enable runtime value notifications from controller for all configured resources.
Refresh interval could be used for forcefully synchronous resource values from controller.

Currently OpenHAB's Number, Switch, Contact, String and DateTime items are supported.

OpenHAB data type <-> IHC data type(s)
Number <-> WSFloatingPointValue, WSIntegerValue, WSBooleanValue, WSTimerValue, WSWeekdayValue
Switch <-> WSBooleanValue
Contact <-> WSBooleanValue
String <-> WSEnumValue
DateTime <-> WSDateValue, WSTimeValue

Few examples, how to configure your items (demo.items):

Weather temperature is download from internet and updated to IHC controller object where resource id is 1234567:
Number Weather_Temperature "Outside Temp. (Yahoo) [%.1f °C]" <temperature> (Weather_Chart) { http="<[http://weather.yahooapis.com/forecastrss?w=638242&u=c:60000:XSLT(demo_yahoo_weather.xsl)]", ihc=">1234567" }

Binding listens all state changes from controller's resource id 9953290 and update state changes to OpenHAB Light_Kitchen item. All state changes from OpenHAB will be also transmitted to the controller (e.g. command from OpenHAB console 'openhab send Light_Kitchen ON').
Switch Light_Kitchen {ihc="9953290"}

Such as previous example, but resource value will additionally asked from controller ones per every minute.
Number Temperature_Kitchen "Temperature [%.1f °C]" <temperature> (Temperature, FF_Kitchen) { ihc="4148500:60" }


Todo list:
  • Download project file from the controller
  • Listening controller's state changes and download project file again if state change has been recognised (controller is re programmed).
Cheers,
Pali
org.openhab.binding.ihc-1.1.0-SNAPSHOT.jar.zip

Kai Kreuzer

unread,
Oct 15, 2012, 9:36:24 PM10/15/12
to ope...@googlegroups.com
Hi Pali,

Sounds very cool!
Would you be interested in contributing this to the official repo as well (possibly after finishing the todos)? If so, please have a look at http://code.google.com/p/openhab/wiki/HowToContribute and let us know!

Best regards,
Kai

--
You received this message because you are subscribed to the Google Groups "openhab" group.
To view this discussion on the web visit https://groups.google.com/d/msg/openhab/-/Mo09mcJacqwJ.
To post to this group, send email to ope...@googlegroups.com.
To unsubscribe from this group, send email to openhab+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/openhab?hl=en.
<org.openhab.binding.ihc-1.1.0-SNAPSHOT.jar.zip>

Pali

unread,
Oct 18, 2012, 12:16:08 PM10/18/12
to ope...@googlegroups.com, k...@openhab.org
Sounds very cool!
Would you be interested in contributing this to the official repo as well (possibly after finishing the todos)? If so, please have a look at http://code.google.com/p/openhab/wiki/HowToContribute and let us know!

Hi Kai,

Contributing to the official repo was my plan as well :)  I pretty happy now the content of the binding, so what should I do to get codes to official repo? Codes have been already on my server side clone (I assume). 

Those IHC / ELKO LS users who want to test binding, but not want build it, the latest binding could be found from the attachment. 

Improvements:
  • Resource id's on binding configuration supports hexadecimal values with 0x prefix (ihc="0x8f7d66").
  • Support project file downloading from the controller.
  • Listening controller state changes. When state change from init to ready state is detected (controller is reprogrammed), binding will download project file again from the controller.
Regards,
Pali
org.openhab.binding.ihc-1.1.0-SNAPSHOT.jar.zip
Reply all
Reply to author
Forward
0 new messages