Gc100ir transform map

Thank you Mark! All my devices were discovered and all had the various channel types available for assignment.

As you suspected, however, the serial devices don’t work. I did confirm my set up works by testing the one IR device I have (a Vizio TV) and it works as advertised.

I did verify via Docklight that my serial device isn’t receiving anything to rule out a syntax issue with the serial command itself.

I did successfully create a python script a while back from using the Global Cache API website to test sending serial commands using the “sendCommand” function in Openhab but I’m still hoping for a binding.

I know little about programming, but it looks like one of big differences between the iFlex IR vs iFlex serial is the port used to send the data. IR uses port 4998 and serial uses 4999. Not sure if that matters or not.

Let me know if I can help test in any way.

Thank you!!

Hmm. The port shouldn’t be the problem since I do use 4999 for the serial commands.

Can you show me how you have your items and map file entries set up for the serial device(s)?

Also, do you see any errors in the log file when you send a serial command?

Sure thing.

Serial item:

String SharpTV          "Living Room TV"                       { channel="globalcache:itachFlexEth:000C1EE0CE88:sl-m1c1" }

Map file:

 # Represents the command string "POWER ON" followed by carriage return line feed
SHARPTV_POWER_ON = POWR1%20%0D%0A
 # Represents the command string "POWER OFF" followed by carriage return line feed
SHARPTV_POWER_OFF = POWR0%20%0D%0A
 # Represents the command string "VOLUME UP" followed by carriage return line feed
SHARPTV_VOLUME_UP   = RCKY33%20%0D%0A
 # Represents the command string "VOLUME DOWN" followed by carriage return line feed
SHARPTV_VOLUME_DOWN = RCKY32%20%0D%0A

Sitemap:

Switch item=SharpTV label="LR TV Power" mappings=[SHARPTV_POWER_ON="On",SHARPTV_POWER_OFF="Off"]

Events.log sample:

2016-09-24 16:58:15.963 [ItemCommandEvent          ] - Item 'SHARPTV' received command SHARPTV_POWER_OFF

Here is the serial command example for “power on” for my Sharp TV from iRule: POWR1 \x0D

I tried a couple of different ways of building the serial command and resorted to using the same carriage return in your example. I figured that I would see some activity either way on the other end via Docklight Scripting which I use to monitor the commands received by the iFlex. I saw no activity.

And for your reference, here is the Python script I was dabbling with. This one is for a different component but you can see the serial command “OUTPUT01 01” sent by the script

from urllib2 import Request, urlopen

values = """
OUTPUT01 01;"""

headers = {
  'Content-Type': 'text/plain; charset=UTF-8',
  'Content-Length': '12'
}
request = Request('http://192.168.1.213/api/v1/serialports/1/sendserial', data=values, headers=headers)

response_body = urlopen(request).read()
print response_body

Thanks again for your help!

I think I know what’s wrong. When the thing initializes, I’ll bet you see a log entry that says “opening command port”. But, I’ll bet there’s not a log entry right after that one that says opening serial port.

I’m probably not recognizing the Flex as being “capable” of serial. I think I know what to do about this. I’ll get back to you.

@swamiller

Try again. This should work now for a Flex configured for serial. However, I’m not sure what it’s going to do if the Flex is configured for IR. If it breaks IR, then I’m probably going to need to get myself a Flex with all the different cable options…

As you suspected, Mark, the serial Flex now works!

But also as you suspected, the IR Flex now does not. In the Paper UI for the IR device now shows “Status: OFFLINE - COMMUNICATION_ERROR connect timed out”. I removed the device, it was detected, I re-added successfully but still get the communication error.

Getting closer!

Yeah, I know what the problem is. I just need to get a Flex so that I can get it resolved completely.

Thanks for the feedback.

@swamiller

All right. I think I got it sorted out. At least for IR and serial…

You will need to delete your existing things, then wait for them to be put into the inbox. After you add the new things from the inbox, you will need to configure a new config parameter in the thing. For the config parameter, specify Infrared for the Flex(s) you have set up for IR. This is the default, so you really shouldn’t need to do anything, Then specify Serial for the Flex(s) you have set up for serial.

Let me know how that goes.

Oh yeah, you also need to change the channel defs in your items file. I did away with the separate itachFlexEth and itachFlexWiFi names. It’s now just itachFlex.

For example:

String SharpTV          "Living Room TV"                       { channel="globalcache:itachFlex:000C1EE0CE88:sl-m1c1" }

Mark, you are awesome!

Both serial and IR itachFlex devices work! I greatly appreciate your help!

Thank you!!

Glad we got it working. Let me know if you run into any other issues.

Hi Mark, thank you very much for this great binding!

I have a strange problem:
I am trying to send hex commands to a B&W amplifier through an iTach IP2SL.

First thing I tried was testing the commands with ihelp. The commands were:

  1. \x04\x03\x02\x03\x00\x00\x0D\x0A
  2. \x34\x03\x02\x00\x00\x00\x0D\x0A
  3. \xD4\x03\x02\x06\x00\x00\x0D\x0A
    everything was working as expected

Then I created a transform file:
CasaAMP_Z2CD=%04%03%02%03%00%00%0D%0A
CasaAMP_Z2OFF=%34%03%02%00%00%00%0D%0A
CasaAMP_Z2LOC=%D4%03%02%06%00%00%0D%0A
now, when sending the commands with the binding, only the first two commands are working, the third does nothing.

Using Wireshark I looked, what was sent to the itach. Strangely, in the first two cases it was the expected hex numbers but in the third case 3f 03 02 06 00 00 0d 0a was being sent.

As a workaround I changed the transforms file (last line) to
CasaAMP_Z2LOC=Ô%03%02%06%00%00%0D%0A

Now the command is working as expected.
So there is no real problem for me, but is there an explanation for this?

@baeron25 Thanks for the feedback, and for the detailed debugging info.

I’ll see if I can reproduce and find root cause.

@baeron25 It should be fixed (character set issue). If you get a chance, would you mind trying it out? Thanks!

1 Like

I tried it and I can confirm that the issue is fixed. Again, thank you!

Quick questions on creating sitemaps. I am using an iTach WF2IR to control my home theater. The pertinent portion of my sitemap is as follows:

Frame label="Living Room TV"
                {
                    Switch item=LivingRoom_TV label="Power" mappings=[Insigina_POW_ON="On",Insigina_POW_OFF="Off"]
                }
                Frame label="Living Room AVR"
                {
                    Switch    item=LivingRoom_AVR    label="Power"    mappings= [VSX700_POWER_ON="On",VSX700_POWER_OFF="Off"]
                    Switch    item=LivingRoom_AVR    label="Volume"    mappings=[VSX700_VOL_UP="Up",VSX700_VOL_DOWN="Down",VSX700_MUTE_TOG="Mute"]
                }

This appears to work well. I plan to add the input functions next.

When I turn the “Living Room AVR” on, the “On” button remains on, which is what I want. Creates a status indicator.
However, when I turn the volume up, the “Up” button remains highlighted and neither the “on” or “off” buttons are highlighted.

Ideally, when the AVR is turned on, the “On” button and the “input” buttons would remain highlighted as status indicators. Then, the volume switch would act as a momentary, only remaining highlighted when pressed.
However, because we are now using a single item for each device, rather than a separate item for each functions this may not be possible.

Also, it it possible to use a dimmer control for volume control?

Thanks

Yes, that’s a consequence of having one item. I suppose you could create one item for AVR power and another for AVR volume. This still avoids the one-item-per-IR-command problem, and might give you what you’re looking for. You likely would need another item for input. Still, three items is better than 7 or 8…

As for the dimmer, I think you would need to create a “proxy” dimmer item and a rule. The rule would detect a change in the proxy dimmer item, then send the appropriate number of IR volume up or down commands. I thought about doing this, but it’s pretty far down my priority list. The only thing I’m not sure about is how to initialize the value of the proxy dimmer item to align with the AV device’s volume setting.

@ejr
Erin, not sure if this will help or not but you may be able to adapt to what you want. I have a serial multizone amp that does not have an increment command for volume. All the volume commands have to be sent individually for each level requested. The following link (which I have yet to adapt but think I can make it work) may help you to adapt a slider to a current single “switch” command. The magic is in the rule.

Another consideration may be to change from a switch to a contact.

Hope some of this is helpful. Let us know if you have any success.

Okay I think I have made some progress. Now, I have a new issue.

I would like to send commands to my itach through a rule. However, I cannot figure out how to send a command from the transformation map through a rule. Any help would be greatly appreciated.

If you have an item named XFINITYG2, and an entry in the map file named XFINITYG2_POWERON, you would do this in the rule.

sendCommand(XFINITYG2, “XFINITYG2_POWERON”)

Thanks. I missed the quotation marks. That solved my problem