Hop til indhold
  • 0

OpenHAB binding


Pauli Anttila
 Share

Spørgsmål

Hi All,this forum has been very useful for me, so like it to inform that I have recently developed OpenHAB binding for IHC / ELKO LS controller. I not understand a word in Danish, but luckily google translator works very well :)OpenHAB is open source home automation system. I discovered OpenHAB half an year ago, when I researched system to expand my current IHC system. OpenHAB is based on OSGi and it's looks very promising.Codes are already available on OpenHAB clone's repository, but If there are any interest I can post pre builded binding as well and some information how to configure the binding.Regards,Pali

Link til kommentar
Del på andre sites

Recommended Posts

  • 0

Nice work indeed Pali.

 

I have got it installed on my beaglebone black on an Ångstrøm Linux.

But I have this problem when trying to parse my big project file (2.4 MB) it just hangs there for ages.

Then when I try one of my earlier project files that are smaller (1 MB) it gets through it and loads it. but it I can't connect to the OpenHAB server after this.

If I then try to disable the IHC binding after this and tries to start OpenHAB it is not able to start.

The only thing that I have found until now that fixes this is to unpack OpenHAB again in another folder and start again.

After this it starts alright again but after I have loaded the IHC project file again after having enabled the IHC binding it doesn't work again.

If I have a fresh OpenHAB and enabled the IHC binding but put in a wrong IP og password and there for not loaded the project file it starts up in demo like it should.

But after the load of the project file I can't get it to work again.

 

Thanks for your feedback in advance

 

Kind regards

Jesper

Link til kommentar
Del på andre sites

  • 0

Hi Jesper,

 

1) Which version of OpenHAB are you using? 1.2 version contains bug in ihc binding, but bug is not related to startup. Anyhow this bug is fixed on nightly buildings (https://openhab.ci.cloudbees.com/job/openHAB/).

2) Have you tried to run openhab on normal pc (windows/linux/osx). If not, you probably should first try to get it work on that, before beaglebone. How much RAM is on your Beaglebone black, 512MB?

3) You should enable debug logging on openhab to get more information about the problem.

 

My project file is 2,6 MB and I don't have any problems. Parsing take few seconds.

 

-Pali

 

FYI...I have run openhab now 9 month without single problem. My openhab is installed on mac mini, which i have need to boot few times during 9 month for other reasons. There are also other users using ihc binding. Probably from this forum as well, because names sounds danish.

Link til kommentar
Del på andre sites

  • 0

Hi Pali

 

1) Yes im using the version 1.2.1 bindings from the 16th of April.

2) Yes I have just tried to run it  on my mac air and it seems to run well - it is much faster  :) . My BeagleBone Black is equipped with 512 MB of RAM as you say.

3) I have run it in debug mode i usually does that to get more info.  :)

 

But just a sec. I have just tried to run it again after having tried it on my mac and now it works on my BeagleBone Black.

I don't know what you did Pali but something worked  :D.

 

Next step will be trying out to get info forth and back and try to control something.

 

Thanks all.

 

I will get back to you with progress or issues  :).

 

Kind regards

Jesper

Link til kommentar
Del på andre sites

  • 0

Hi Pali,

 

I have been trying to do a use the Setpoint item with no luck.

 

Setpoint Setpoint_GF_Living "Temperature [%.1f °C]" <heating> (GF_Living, Heating) {ihc="0x291b14"}

 

do i need add Setpoint somewhere else ?

 

 

;) got it now.. 

 

i sitemap :

Setpoint item=Setpoint_GF_Living step=0.1 minValue=15 maxValue=30

Link til kommentar
Del på andre sites

  • 0

Can any one give me detailed description on how to import the certificate to Java on a win 7. I must do somthing wrong when i start openhab it comes with an security error by connecting to IHC. 

 

 
C:\OpenHab\openhab-runtime-1.3.1>keytool -importcert -alias ELKO -file c:\openha
b\ihc.cer
Enter keystore password:
keytool error: java.lang.Exception: Certificate not imported, alias <ELKO> already exists
 
C:\OpenHab\openhab-runtime-1.3.1>start.bat
Launching the openHAB runtime...
osgi> 23:18:51.946 INFO  o.o.c.internal.CoreActivator[:92] - openHAB runtime has been started (v1.3.1).
23:18:53.646 INFO  o.o.i.s.i.DiscoveryServiceImpl[:92] - mDNS service has been started
23:18:54.255 INFO  o.o.i.r.i.RESTApplication[:158] - Started REST API at /rest
23:19:02.398 INFO  o.o.m.c.i.ModelRepositoryImpl[:99] - Loading model 'demo.sitemap'
23:19:02.523 INFO  o.o.m.c.i.ModelRepositoryImpl[:99] - Loading model 'demo.script'
23:19:02.585 INFO  o.o.m.c.i.ModelRepositoryImpl[:99] - Loading model 'db4o.persist'
23:19:02.601 INFO  o.o.m.c.i.ModelRepositoryImpl[:99] - Loading model 'exec.persist'
23:19:02.601 INFO  o.o.m.c.i.ModelRepositoryImpl[:99] - Loading model 'logging.persist'
23:19:02.601 INFO  o.o.m.c.i.ModelRepositoryImpl[:99] - Loading model 'rrd4j.persist'
23:19:02.616 INFO  o.o.m.c.i.ModelRepositoryImpl[:99] - Loading model 'demo.items'
23:19:04.317 INFO  o.o.u.w.i.s.WebAppServlet[:99] - Started Classic UI at /openhab.app
23:19:08.232 INFO  o.o.b.i.internal.IhcConnection[:139] - Connecting to IHC / ELKO LS controller [iP=192.168.0.4' Username='test' Password='Test123456].
23:19:08.248 INFO  o.o.c.s.AbstractActiveService[:189] - HTTP Refresh Service has been started
23:19:08.685 WARN  o.o.b.ihc.internal.IhcBinding[:1084] - Controller is null =>resource value notfications waiting aborted!
23:19:08.685 ERROR o.o.b.i.internal.IhcConnection[:188] - Connection to IHC / ELKO LS controller failed.
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException:
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderExce
ption: unable to find valid certification path to requested target
        at sun.security.ssl.Alerts.getSSLException(Unknown Source)
Caused by: sun.security.validator.ValidatorException: PKIX path building failed:
 sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
        at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to
 find valid certification path to requested target
        at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
23:19:08.685 INFO  o.o.c.s.AbstractActiveService[:189] - IHC / ELKO LS refresh and notification listener service has been started
23:19:08.685 INFO  o.o.c.s.AbstractActiveService[:189] - NTP Refresh Service has been started
23:19:08.763 INFO  runtime.busevents[:46] - Weather_Temperature state updated to 5
23:19:08.763 WARN  o.o.b.ihc.internal.IhcBinding[:697] - IHC / ELKO LS controller is null!
Link til kommentar
Del på andre sites

  • 0

Please see picture on how I imported the certificate to the keystore. Note that while I wrote the command I was "standing" in the "C:\Program files\Java\jre7\bin"

 

post-4473-0-80808900-1382437750_thumb.jp

 

By the way OpenHAB has been working great for me as well. Had a few issues in the start but have been running smoothly for months now. Great thanks to Pauli for his contribution with the binding.

Link til kommentar
Del på andre sites

  • 0

Hi

 

I have installed OPEN HAB and gotten the demo to work. I get info below when starting OPEN start.bat

 

Does this mean everything is ok and that I now  shouldto start adding something in items file?

 

or should I see somewhere that OPENHAB have fetched my IHC projectfile from controller?

 

regards Janne

 

C:\OPENHAB>start.bat
Launching the openHAB runtime...
osgi> 18:33:12.734 INFO  o.o.c.internal.CoreActivator[:92] - openHAB runtime has been started (v1.3.1).
18:33:19.203 INFO  o.o.i.s.i.DiscoveryServiceImpl[:92] - mDNS service has been started
18:33:21.125 INFO  o.o.i.r.i.RESTApplication[:158] - Started REST API at /rest
18:33:24.968 INFO  o.o.m.c.i.ModelRepositoryImpl[:99] - Loading model 'demo.sitemap'
18:33:25.734 INFO  o.o.m.c.i.ModelRepositoryImpl[:99] - Loading model 'demo.script'
18:33:25.921 INFO  o.o.m.c.i.ModelRepositoryImpl[:99] - Loading model 'db4o.persist'
18:33:25.953 INFO  o.o.m.c.i.ModelRepositoryImpl[:99] - Loading model 'exec.persist'
18:33:25.968 INFO  o.o.m.c.i.ModelRepositoryImpl[:99] - Loading model 'logging.persist'
18:33:25.968 INFO  o.o.m.c.i.ModelRepositoryImpl[:99] - Loading model 'rrd4j.persist'
18:33:26.000 INFO  o.o.m.c.i.ModelRepositoryImpl[:99] - Loading model 'demo.items'
18:33:29.562 INFO  o.o.u.w.i.s.WebAppServlet[:99] - Started Classic UI at /openhab.app
18:33:33.875 INFO  o.o.c.s.AbstractActiveService[:189] - HTTP Refresh Service has been started

18:33:33.906 INFO  o.o.c.s.AbstractActiveService[:189] - IHC / ELKO LS refresh and notification listener service has been started

18:33:35.250 INFO  o.o.c.s.AbstractActiveService[:189] - NTP Refresh Service has been started
18:33:35.437 INFO  runtime.busevents[:46] - Date state updated to 2013-10-29T18:33:35
18:33:36.203 INFO  o.o.m.c.i.ModelRepositoryImpl[:99] - Loading model 'demo.rules'
18:33:36.218 INFO  runtime.busevents[:46] - Weather_Temperature state updated to 12
18:33:42.046 INFO  runtime.busevents[:46] - Light_GF_Living_Table state updated to OFF

Link til kommentar
Del på andre sites

  • 0

yes like this I guess I should use https:

 

So then I should just try then to get something to work...

 

########################### IHC / ELKO LS Binding ####################################
#
# Controller IP address
#ihc:ip=https://192.168.1.xx/

# Username and password for Controller
#ihc:username=userid
#ihc:password=userspassword

# Timeout for controller communication
#ihc:timeout=5000

 

Link til kommentar
Del på andre sites

  • 0

yes uncomment the settings you need and edit them so they match your ihc.

 

########################### IHC / ELKO LS Binding ####################################
#
# Controller IP address
ihc:ip=https://192.168.1.2

# Username and password for Controller
ihc:username=admin
ihc:password=password

# Timeout for controller communication
ihc:timeout=5000

Link til kommentar
Del på andre sites

  • 0

yes uncomment the settings you need and edit them so they match your ihc.

 

########################### IHC / ELKO LS Binding ####################################

#

# Controller IP address

ihc:ip=https://192.168.1.2

# Username and password for Controller

ihc:username=admin

ihc:password=password

# Timeout for controller communication

ihc:timeout=5000

 

got excited getting so far with this but gave up at 0230 in the night - and today I with help from your post realized I missed uncommenting.....  no wonder nothing worked

Link til kommentar
Del på andre sites

  • 0

Got some error "Controller is null...." when OPENHAB tried logging in to IHC controller.

 

What could the reason be for the error in OPENHAB?

 

 

in firefox, going to the IHC homepage via http://192.168.x.x  works and then clicking e.g. Sceneview fetches the .jnlp and it connect to https://192.168.x.x:443 and Sceneview works

 

if I in firefox try to open page https://192.168.1.60/  or https://192.168.1.60:443  I get the error

403 Forbidden

Rogatkin's JWS based on Acme.Serve $Revision: 1.36.2.1 $

 

in controller I have DNS set to 192.168.1.1  = my router IP if that matters

 

 

below is log from OPENHAB

 

12:27:52.562 INFO  o.o.c.internal.CoreActivator[:92]- openHAB runtime has been started (v1.3.1).
12:27:56.734 INFO  o.o.i.s.i.DiscoveryServiceImpl[:92]- mDNS service has been started
12:27:58.406 INFO  o.o.i.r.i.RESTApplication[:158]- Started REST API at /rest
12:28:03.687 INFO  o.o.m.c.i.ModelRepositoryImpl[:99]- Loading model 'demo.sitemap'
12:28:04.281 INFO  o.o.m.c.i.ModelRepositoryImpl[:99]- Loading model 'demo.script'
12:28:04.421 INFO  o.o.m.c.i.ModelRepositoryImpl[:99]- Loading model 'db4o.persist'
12:28:04.437 INFO  o.o.m.c.i.ModelRepositoryImpl[:99]- Loading model 'exec.persist'
12:28:04.453 INFO  o.o.m.c.i.ModelRepositoryImpl[:99]- Loading model 'logging.persist'
12:28:04.453 INFO  o.o.m.c.i.ModelRepositoryImpl[:99]- Loading model 'rrd4j.persist'
12:28:04.484 INFO  o.o.m.c.i.ModelRepositoryImpl[:99]- Loading model 'demo.items'
12:28:07.000 INFO  o.o.u.w.i.s.WebAppServlet[:99]- Started Classic UI at /openhab.app
12:28:12.062 INFO  o.o.b.i.internal.IhcConnection[:139]- Connecting to IHC / ELKO LS controller [iP=https://192.168.1.2' Username='test' Password='test1234].
12:28:12.203 INFO  o.o.c.s.AbstractActiveService[:189]- HTTP Refresh Service has been started
12:28:14.468 WARN  o.o.b.ihc.internal.IhcBinding[:1084]- Controller is null => resource value notfications waiting aborted!
12:28:14.765 ERROR o.o.b.i.internal.IhcConnection[:188]- Connection to IHC / ELKO LS controller failed.
java.net.UnknownHostException: https
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source)
    at sun.net.NetworkClient.doConnect(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)

12:28:14.781 INFO  o.o.c.s.AbstractActiveService[:189]- IHC / ELKO LS refresh and notification listener service has been started
12:28:14.781 INFO  o.o.c.s.AbstractActiveService[:189]- NTP Refresh Service has been started
12:28:14.843 INFO  o.o.m.c.i.ModelRepositoryImpl[:99]- Loading model 'demo.rules'
12:28:19.468 WARN  o.o.b.ihc.internal.IhcBinding[:582]- Controller is null => resource value notfications waiting aborted!
 

Link til kommentar
Del på andre sites

  • 0

Hi Janne,

 

You should define just a ip address not a whole url in config.

 

# Controller IP address
ihc:ip=192.168.1.60

 

And it's normal to get "403 forbidden access" error if you try access https://192.168.1.60 url directly by firefox, because controller does not provide any web pages by https.

 

Next you probably need to import controller TLS certificate to java trusted list. See further details from http://code.google.com/p/openhab/wiki/IHCBinding.

 

Regards,

Pali

Link til kommentar
Del på andre sites

  • 0

Thanks!

 

the error was the HTTP before IP Address

 

using

# Controller IP address
ihc:ip=192.168.1.X

 

made it work! :)

 

now my test IHC lamp is updated in toilet - although not using timer . since I am monitoring resource id for output - should probably use resource that is used to toggle on/off with timer  in IHC instead

 

but I do get an error when logging in to IHC controller via Service View - see below. I had to change login to same user as OPENHAB user

 

NB  even with error OPENHAB works and can update lamp etc

 

questions:

can OPENHAB user be a normal user or does it need to be a administrator user?

 

 

is error below due to simultanious log in via serviceview with same userid - or some other error?

 

 

 

16:52:36.906 INFO  o.o.c.s.AbstractActiveService[:189]- IHC / ELKO LS refresh and notification listener service has been started
16:54:22.468 ERROR o.o.b.ihc.internal.IhcBinding[:1063]- New controller state change notification wait failed...reinitialize connection
java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(Unknown Source)
    at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)

Link til kommentar
Del på andre sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Gæst
Svar på dette spørgsmål

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loader...
 Share

×
×
  • Tilføj...

Important Information

Privatlivspolitik og We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

1200x630bb.png

ok