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.
# 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
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.
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.
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.
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:
\x04\x03\x02\x03\x00\x00\x0D\x0A
\x34\x03\x02\x00\x00\x00\x0D\x0A
\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?
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?
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.