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

Hi all,

 

I am in the progress of binding my IHC installation to OpenHAB to benefit from the synergies of shared data flow and the nice customizable user interface OpenHAB offers for smart phones.

 

While interactions from physical push buttons and listening to status/value changes from IHC -> OpenHAB seems straight forward, I have a little more trouble figuring out how to properly control the IHC installation from OpenHAB - especially switches.

Sending strings and numbers are simple, but how do you configure a light switch to

1. reflect the status of a lamp, and at the same time

2. being able to switch it on/off by e.g. 200ms pulses?

 

In the IHC installation a push button gives a on/off pulse to a function block to turn on or off the light. The status of the light can be read from the function block or the lamp data-line.

 

A switch item sending pulses at on and off:

Switch ihc_alrum {ihc=">[ON:0x13ae1c5a:200],>[OFF:0x13ae1c5a:200]"}

But how do you reflect the current status?

 

How about scenarios. Can those be activated by a Selection or are they not supported.

 

Also do someone have some .items and .sitemap files to share regarding IHC bindings? I think the Wiki page is lacking examples on all sort of standard and cool usages I am sure some of you have implemented..

 

Thanks and regards

Claus

Link til kommentar
Del på andre sites

  • 0

Hi Claus,

 

is there specific reason why you wan't to control lights from openhab via push buttons (trying to emulate pulses)? Why don't your directly control the light?

 

Switch kitchen_light {ihc="0x13XXXX"} where 0x13XXXX is the correct light resource id (not the push button id). Then the state reflects always the light status.

 

About the scenarios, I don't use IHC scenarios at all, because scenario handling is so match easier directly by the openhab rules. You can change openhab rules without uploading/restarting anything and you can also control all other devices connected to openhab from the same "scenario" rules. Example...when I enter my home theater room, I can push wall switch (IHC connected), which will set light to 100% (rfxcom binding connected light), turn my Onkyo receiver and Epson project ON and in few minutes dim light to 0%. Or when I go sleep, I can shutdown all light, TV's, Sonos player, etc by pushing one single wireless button connected to IHC.

 

-Pali

Link til kommentar
Del på andre sites

  • 0

Hey all

 

One question..

 

Im ongoing to build a verry smart home :-).

 

i have IHC wireless in most of the house, can it work with this openhab binding?

 

Peter

 

Goodmorning Peter.

In order to get the binding to work you must have an IHC Controller connected to your local network.

If you only have IHC Wireless as Stand Alone, it doesn't work with the binding.

 

Regardless to that, you are still able to buy a Controller and link it with your wireless products, and then make the connection.

 

- Esben

Link til kommentar
Del på andre sites

  • 0

Hi Pauli!

Thanks for creating the binding! Very useful!

I have a question regarding the use of the contact item type. I use it for some door sensors connected to my IHC. They are normal magnetic door switches, "reed switches", that are NO - normally opened, hence when the door is closed and the magnet is in close proximity they are closed (the circuit is closed and current is flowing - IHC sees it as 1/ON). As far as I know this is the standard way of using magnetic switches in alarm systems for security reasons.

In OpenHAB the closed circuit from IHC translates to contact state=OPEN, door open, the picture for door open / window open / garage open etc is what will show. This can be changed by renaming the pictures, using transform to invert the state in written form etc. The actual state still says the opposite (in persistence etc) of course, no way of changing this. (?) But wouldn't it be more logical to have the binding report the contact state as "CLOSED" when the door etc is closed? 

Link til kommentar
Del på andre sites

  • 0

Hey everybody

just a quick question, my IHC working perfect with openHAB, but i have a programming question.

I would like to make a switch (OF-OFF) function

my item look like this:

 

Switch lyskontoronoff                "Lys over bord"                (IN_Office)                                        {ihc=">[ON:1111644:100, OFF:1113873:100]"}

 

have i missed something?

 

I can controll it, if i make a single off switch and a single on switch, but thats not so smart :-)

 

Also switch comes as "normal" switch and not a "mappings" even that i do a mappings, can anyone help with this?

 

 

Thanks,

Peter

Screen Shot 10-14-16 at 12.14 AM 001.PNG

Screen Shot 10-14-16 at 12.14 AM.PNG

Link til kommentar
Del på andre sites

  • 0
På 10/10/2016 at 01:27 , inferi skrev:

In OpenHAB the closed circuit from IHC translates to contact state=OPEN, door open, the picture for door open / window open / garage open etc is what will show. This can be changed by renaming the pictures, using transform to invert the state in written form etc. The actual state still says the opposite (in persistence etc) of course, no way of changing this. (?) But wouldn't it be more logical to have the binding report the contact state as "CLOSED" when the door etc is closed? 

IHC binding or openHAB does not currently have invert function for switch/contact items. You could add additional functional block to IHC controller which just invert door status and then use inverted resource id in your openHAB item configuration. This is how I have implemented e.g. my water leak detectors. Another possibility is to handle inversion in openHAB side. Introduce another item (which is not bind to any binding), which will hold the logical state of the door. And then use openHAB rules to update (invert) the item state when door item changes. 

Some thing like

Switch doorRealState {ihc="123445"}

Switch doorState


rule "door"
when doorRealState received update
    then
        if (doorRealState.state == ON)
            doorState.sendUpdate(OFF)
        else
            doorState.sendUpdate(ON)
    end

 

 

Link til kommentar
Del på andre sites

  • 0
På 10/14/2016 at 01:15 , Plindberg skrev:

Hey everybody

just a quick question, my IHC working perfect with openHAB, but i have a programming question.

I would like to make a switch (OF-OFF) function

my item look like this:

 

Switch lyskontoronoff                "Lys over bord"                (IN_Office)                                        {ihc=">[ON:1111644:100, OFF:1113873:100]"}

 

have i missed something?

 

I can controll it, if i make a single off switch and a single on switch, but thats not so smart :-)

 

Also switch comes as "normal" switch and not a "mappings" even that i do a mappings, can anyone help with this?

 

 

Thanks,

Peter

Peter, could you try to open little bit the use case (what do you want establish).

ihc=">[ON:1111644:100, OFF:1113873:100]"

This is a special feature of the binding, which is handy when you want to control e.g. roller shutters (connected to IHC) via openHAB as it send "100ms pulses" to controller. So when item is set to ON, binding set resource id 11111644 to ON, sleep 100ms and then set resource same resource id 11111644 to OFF. See more details from binding wiki page https://github.com/openhab/openhab/wiki/IHC-Binding.

 

 

Link til kommentar
Del på andre sites

  • 0
På 15/10/2016 at 08:49 , Pauli Anttila skrev:

Peter, could you try to open little bit the use case (what do you want establish).


ihc=">[ON:1111644:100, OFF:1113873:100]"

This is a special feature of the binding, which is handy when you want to control e.g. roller shutters (connected to IHC) via openHAB as it send "100ms pulses" to controller. So when item is set to ON, binding set resource id 11111644 to ON, sleep 100ms and then set resource same resource id 11111644 to OFF. See more details from binding wiki page https://github.com/openhab/openhab/wiki/IHC-Binding.

 

 

Hi Pauli

What i want to do, is to make a simple switch, so if i write:

 

ihc=">[ON:1111644, OFF:1113873]"

it would be right?

 

is there any way to make it look like a "mappings" insted of normal looking switch?

 

Link til kommentar
Del på andre sites

  • 0

Hello Pauli,

I have a "Simon VIS" system, a spanish clone of the first LK IHC as you can see here:

http://www.tooms.dk/articles_tutorials/ihc_hardandsoftware/controller/120B1200/default.asp

The "controller" can be connected with some software through the RS485 pins and using RS485 to serial converters.

I'm interested in starting to use OpenHAB, but I don't know if the current IHC binding will be compatible or it will only work with more modern IHC systems / Controllers..

In case that this OpenHAB binding is not compatible with the controller I have, which one should I buy? and where? (as the rest of components, input, output modules should be compatible)

I can see two models:

- 820B1202 Visual Controller

- 820B1400 Visual Controller / Viewer

Thanks!

Link til kommentar
Del på andre sites

  • 0
På 17/9/2015 at 19:38 , Pauli Anttila skrev:

Hi Claus,

 

is there specific reason why you wan't to control lights from openhab via push buttons (trying to emulate pulses)? Why don't your directly control the light?

 

Switch kitchen_light {ihc="0x13XXXX"} where 0x13XXXX is the correct light resource id (not the push button id). Then the state reflects always the light status.

 

About the scenarios, I don't use IHC scenarios at all, because scenario handling is so match easier directly by the openhab rules. You can change openhab rules without uploading/restarting anything and you can also control all other devices connected to openhab from the same "scenario" rules. Example...when I enter my home theater room, I can push wall switch (IHC connected), which will set light to 100% (rfxcom binding connected light), turn my Onkyo receiver and Epson project ON and in few minutes dim light to 0%. Or when I go sleep, I can shutdown all light, TV's, Sonos player, etc by pushing one single wireless button connected to IHC.

 

-Pali

Sorry for the late reply - I didn't see your answer.

I now realise that your choises made during development of the binding are based on a slighty different paradigm than mine.

In my setup, I would like the IHC controller to be fully in charge of the alarm and electrical installation based on physical and virtual inputs and thus be able to function 100% independently of OpenHAB. This means OpenHAB in my case will be an add-on to the IHC installation. This also means I want to avoid setting IHC outputs directly from OpenHAB. It also implies that logic concerning the electrical installation should be placed on the IHC controller, not in OpenHAB. By setting an output directly in OpenHAB would bypass the logic in the IHC controller and thus make complications.

So my question came from this background. I would like to push a virtual button in OpenHAB same same way as a physical button, and then read the status from somewhere else. It can be hacked by adding a IHC FB for this purpose, but I wondered if it was possible without.

In your case, I expect by your answer that you have most of your "IHC/electrical logic" in OpenHAB and merely use the IHC controller as a proxy!?

Best regards

Claus

Link til kommentar
Del på andre sites

  • 0
På 9/17/2015 at 19:38 , Pauli Anttila skrev:

easier directly by the openhab rules

Hi

I have been trying to setup IHC scenes for my wireless dimmer lamps, but have got stuck in the coding. Would anyone like to share examples of code from their project? Preferably from both Rules, Items and Sitemap files.

Any help or inspiration would be appreciated!

Link til kommentar
Del på andre sites

  • 0
På 11/3/2015 at 19:17 , Pauli Anttila skrev:

 

Currently OpenHAB IHC binding support directly only one controller. But what you can do, is to install two openhab instances (in same hardware or separated). Another openhab instance is "slave" which only have ihc binding and another instance which contains also ihc binding and all others. Then you can connect both openhab instances event bus together via MQTT binding. You also need MQTT broker (e.g.  Mosquitto). I haven't tested it my self, but I know that someone have multiple openhab instances linked together in that way (try to find more information from openhab forum).

 

I'm currently porting openhab bindings to openhab2, and there multiple controllers should be supported (new openhab framework allows it without extra work).

 

-Pali

Hi Pali

I hav Updated to OH2 now and are wondering how you can set it up for 2 controllers

do you have an idea about that?

Do I need to wait until the IHC plugin has been updated to 2 or can I do it with the current plugin?

Link til kommentar
Del på andre sites

  • 0
On 15/2/2018 at 10:50 AM, Jesper B said:

Hi Pali

I hav Updated to OH2 now and are wondering how you can set it up for 2 controllers

do you have an idea about that?

Do I need to wait until the IHC plugin has been updated to 2 or can I do it with the current plugin?

There has not been release any new IHC binding and i'm not sure if this is in pipeline for OH2 currently. Can't find info in github etc.

 

If you want to control 2 IHC controllers, you need to setup an additional OH "slave" and let the two OH instances communicate through MQTT. I have this setup and it working as excepted.

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