How to setup GC100IR binding in OH2

I’m new to openHAB. Sorry for such a basic question.

I’m trying to use the GC100IR binding in OH2. I was able to install the binding using the Paper UI, but I can’t figure out where to put the binding configuration information. The GC100IR Wiki shows the configuration taking the form:

gc100ir : {instanceName}.host = IP address of the GC100 device

In Wiki, it says to put the configuration information in openhab.cfg, but that’s for OH1. That file doesn’t exist in OH2.

Because it is a version 1 binding you need to perform these steps:

Thank you! It is working perfectly now.

The 1.x compatibility feature was already installed, but I totally missed the part about moving the jar and copying openhab.cfg. That all seems pretty obvious now, and I suppose I should’ve been able to figure that out myself. :frowning:

One additional question. There’s a bunch of other stuff in the openhab.cfg file that I copied over from my OH1 install. Is any of that needed in OH2, or can/should I reduce the contents of the file down to just what’s absolutely needed (i.e. the GC100IR binding configuration)?

Just a note on this binding. According to the GlobalCache API documents, seems this binding should work with their whole line of products. I have a WifiIR that Im about to try, but the API specifically states that all their products use the same module / connector layouts, so this should work!

I’m using it with an iTach WF2IR and an IP2IR, so you should be good.

However, it definitely will not work with the relay and serial iTachs. I’m certain of this because I just finished tracking down a NPE generated as a result of trying to use a WF2CC (iTach contact closure device). The changes to the code to support the relay (contact closure) and serial devices are not straightforward. The code appears to have been written very specifically to support IR. Perhaps when I get some more experience with the platform, I’ll take a whack at extending it to support the other protocols. I’m not sure if the code is being actively maintained. There are a number of places where exceptions could be handled a bit more gracefully.

@mhilbush If you are going to improve the gc100ir binding, would you consider implementing this?

Also, since it’s now reported to work with OH2, could you make it installable in the Paper UI, similar to this PR?

and also update this document?

@watou I’ll consider it. But please understand I’m on the steep part of the learning curve right now. I’ve been working with OH only for a few days. Today, in order to debug the NPE I was getting with gc100ir, I was able to install the dev environment and build the gc100ir binding to aid in the debugging. I consider that a minor step, but still quite far away from tackling what you suggest.

Thanks for considering it Mark, and please don’t hesitate to ask for ideas, background, etc. I know there is a lot to digest, but after awhile it all (mostly) makes perfect sense. :slight_smile: I’m happy to review any pull request you submit regarding the NPE, and otherwise advise as needed. And thanks for whatever you can contribute!

rhanks for the update…loling forward to tackling my wifi ir

On a related note, I was able to get a serial iTach Flex working in OH2 using a python script (copied almost straight out of the Global Cache API website) and executing via the “executeCommandLine” statement triggered in a rule from a switch.

I still wouldn’t mind seeing a binding in the future though!

might you consider sharing an item so i can make sure I’m setting this up right? for the w2fir…

@Branden_Smale Sure. Hope this helps.

In my conf/services/openhab.cfg

In my conf/items/itach.items file

String MasterBedroomTogglePower { gc100ir="[#masterbedroom|1|1|38000,1,1,342,170,22,63,22,20,22,20,22,20,22,20,22,20,22,20,22,63,22,20,22,63,22,63,22,20,22,20,22,63,22,63,22,20,22,63,22,20,22,20,22,20,22,20,22,20,22,20,22,63,22,20,22,63,22,63,22,63,22,63,22,63,22,63,22,20,22,760]" }

In my conf/sitemaps/home.sitemap file

Switch item=MasterBedroomTogglePower label=“Power” mappings=[POWERON=“POWER”]

i notice the 1|1…isnt the ir in module 2? i tjought i read that in the api docs. which is why i ask.

Module 1 has always worked for me with the WF2IR and IP2IR. The spec says 1 through 3 should work for the IR devices, though.

When you send the command to the device, do you see a flicker in the light above the connector into which you’ve plugged the emitter?

From the API spec…

Note: In iTach units containing infrared (IR) and relay contact closure (CC) modules, those modules are
always physically located in module 1 (1:*). However, modules 1 through 3 will be accepted in commands
to the IR, and 1 through 5 will be accepted by the CC. This is deliberate and allows drivers developed for
the GC-100 Network Adapter series of products to function without change.

iTach API Spec

i javent phsyically hooked it up yet. been tackling my tcp relays for my projection screen, but now its done, so its ir time.

also, since you are new like me to openhab, you may not have an answer for me, but ill try anyways…

some of my devices only have a power toggle code, instead of separate on and off. im giessing i could put a zwave plug energy meter in to sense when the device is drawing power to tell what its state is; that way i can use rules roake sure i dont shut off a device if its already on and i want it on…

What you suggest certainly seems possible. I’ve thought about doing something similar but haven’t looked into it closely. Others with more experience with OH would need to weigh in.

Short rant: I dunno why manufacturers continue to produce devices without discrete power-on and power-off codes…

i 2nd that! the aotech plug meter is very reasonable on price, if ot would work.

works like a champ, thx.

Excellent. Glad it worked out.