Any luck with iTach WF2IR?

Thanks for the post. I am not that familiar with the code, is it possible to get some more details on how to implement this? Thanks

When you say ‘code’, what do you mean? The command string you send to the iTach, or the SmartThings app call to send it?

both, not really sure where to start

Do you already have an iTach? What are you using it with now?

I currently have a wifi2ir unit that I use for my home theater (roomie remote app) I have recently purchased a somfy roller shade motor that uses ir and would like to have smartthings control the shade.

Well roomie most likely has component libraries of IR commands that you just assign to buttons, but the native command actually being sent to the iTach looks something like this:

sendir,1:3,1,39000,3,1,95,23,48,23,48,23,48,23,48,23,23,23,48,23,23,23,23,23,48,23,23,23,48,23,48,23,23,23,48,23,23,23,23,23,23,23,48,23,48,23,48,512\r

The above command is a discreet ‘off’ command for a Sony BluRay Player. You can find these commands online in various formats, and GC has a conversion app to convert raw HEX to native GC commands. Also, your iTach has the ability to record these codes directly from your IR remotes using the iLearn app they provide.

Once you know the codes you want to send, you send it from a SmartApp with the send hub command I previously described here.

I did need to use the learning feature in the roomie remote app I order to get it to work but I am familiar with the ilearn app as well. When I create a new smart app I simply copy and paste the code from the link you provided and modify with my hex code?

Sorry for all the questions, I am pumped this can actually work.

Yes. The only thing you’ll need to convert to hex is the IP address of your iTach.

Thanks for your help, I will give it a shot tonight.

So I created a new app and added the code from your link above and I am receiving a java error. see code below

definition(
name: "Shade ",
namespace: “”,
author: “Cass Mieczakowski”,
desription: “Shade”,
category: “My Apps”,
iconUrl: “https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png”,
iconX2Url: “https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png”)

sendHubCommand(new physicalgraph.device.HubAction("""$sendir,1:3,1,39000,3,1,95,23,48,23,48,23,48,23,48,23,23,23,48,23,23,23,23,23,48,23,23,23,48,23,48,23,23,23,48,23,23,23,23,23,23,23,48,23,48,23,48,512\r\n""", physicalgraph.device.Protocol.LAN, “${0x0A000114}”))

It would appear this is your first crack at a SmartApp. While you almost got the sendhub command right, a single command does not make a SmartApp. You’ll need to define input(s) and an event handler for it to be able to do anything. Have a look at some of the examples in the IDE.

Now for the sendhub command… assuming your iTach’s ip address is 10.0.1.20

def deviceNetworkId = "	0A000114:1386"

def theCom = "sendir,1:3,1,39000,3,1,95,23,48,23,48,23,48,23,48,23,23,23,48,23,23,23,23,23,48,23,23,23,48,23,48,23,23,23,48,23,23,23,23,23,23,23,48,23,48,23,48,512\r"

sendHubCommand(new physicalgraph.device.HubAction("""$theCom\r\n""", physicalgraph.device.Protocol.LAN, "${deviceNetworkId}"))

I have only modified existing smart apps never from scratch. I am having a hard time building this thing.

I am stuck because there is not an actual “thing” that is being used.

Right. It is a command you would put in an event handler, that would be triggered by a device or schedule.

Sorry to keep bugging you.

I have made some progress but have received an error with the sendhubcommand


name: “Shade Control”,
namespace: “”,
author: “Cass”,
description: “controls shade when dark”,
category: “My Apps”,
iconUrl: “https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png”,
iconX2Url: “https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png”)

preferences {
section(“When it gets dark”) {
input “luxSensor”, “capability.illuminanceMeasurement”, title: “At which Lux sensor?”, multi: false, required: true
input “luxLevel”, “number”, title: “Darkness Lux level?”, default: “400”
}
}
def installed() {
log.debug “Installed with settings: ${settings}”

initialize()

}

def updated() {
log.debug “Updated with settings: ${settings}”

unsubscribe()

// unschedule()
initialize()
}

def initialize() {
log.debug “Initializing - subscribing to $luxSensor”

subscribe(luxSensor, "illuminance", eHandler)

// subscribe(catDoor, “contact”, eHandler)

state.lastStatus = "unknown"

}

def deviceNetworkId = " 0A000114:1386"

def theCom = “sendir,1:3,1,39000,3,1,95,23,48,23,48,23,48,23,48,23,23,23,48,23,23,23,23,23,48,23,23,23,48,23,48,23,23,23,48,23,23,23,23,23,23,23,48,23,48,23,48,512\r”

sendHubCommand(new physicalgraph.device.HubAction("""theCom\r\n""", physicalgraph.device.Protocol.LAN, "{deviceNetworkId}"))

Again, the send hub command (and the defs supporting it) need to go into an event handler…

def eHandler(evt) {
	log.debug "Sensor says ${evt.value}"
	if (evt.value <= luxLevel) {
	def deviceNetworkId = "0A000114:1386"
        def theCom = "sendir,1:3,1,39000,3,1,95,23,48,23,48,23,48,23,48,23,23,23,48,23,23,23,23,23,48,23,23,23,48,23,48,23,23,23,48,23,23,23,23,23,23,23,48,23,48,23,48,512\r"
        sendHubCommand(new physicalgraph.device.HubAction("""$theCom\r\n""", physicalgraph.device.Protocol.LAN, "${deviceNetworkId}"))
        }
}

I have the code working now and have the actual IR codes which i pulled from the iLearn app and it is not working. How does the code tell the iTach which IR blaster port to use since there are 3?

I am trying to send IR command through iTach, unfortunately, it is not working.
My iTach is set with a fix IP address on my network (192.168.1.30). When I use the iTest App from Global Cache, I can see the small LED blink on the corresponding iTach IR port. This confirms that my unit is properly working (and IP is good). However, when I try to send the same command using the sendHubCommand, the LED is not blinking on the iTach. You will find below My SmartApp.
In summary, I have to IR commands I want to send (Open and Close for Shade). I bind the Open/Close IR command to a contact sensor. For troubleshooting, I also bind to a switch to make sure that it changes state (it does). Do you see any error in the code below or do you have any suggestion?

definition(
name: “Basic Shade Control”,
namespace: “iker.pryszo”,
author: “Iker Pryszo”,
description: “Basic Test for controlling shade”,
category: “SmartThings Labs”,
iconUrl: “https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png”,
iconX2Url: “https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png”,
iconX3Url: “https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png”)

preferences {
section(“When this sensor opens…”) {
input “myContact”, “capability.contactSensor”, title: “Which?”
}
section(“Miror light on…”) {
input “mySwitch”, “capability.switch”, multiple: false
}
}

def installed() {
log.debug "Installed with settings: ${settings}"
initialize()
}

def updated() {
log.debug "Updated with settings: ${settings}"
unsubscribe()
initialize()
}

def initialize() {
subscribe(myContact, “contact”, contactHandler)
}

def contactHandler(evt) {
log.trace “The event is: $evt.value: $evt”
//IP of the iTach is 192.168.1.30
def deviceNetworkId = “C0A8011E:1386"
def theCom
if (evt.value == ‘open’) {
log.trace “Contact Open"
theCom = “sendir 1:3,1,37878,1,1,48,16,48,16,16,48,48,16,16,3700\r"
sendHubCommand(new physicalgraph.device.HubAction(”””$theCom\r\n""", physicalgraph.device.Protocol.LAN, “${deviceNetworkId}”))
mySwitch.on()
} else {
if (evt.value == ‘closed’) {
log.trace “Contact Close"
theCom = “sendir 1:3,1,37993,1,1,48,16,48,16,16,48,48,16,16,48,16,48,16,48,48,16,16,48,16,48,16,48,16,1326,48,16,48,16,16,48,48,16,16,3700\r"
sendHubCommand(new physicalgraph.device.HubAction(””"$theCom\r\n""", physicalgraph.device.Protocol.LAN, “${deviceNetworkId}”))
mySwitch.off()
}
}
log.debug “Command should be sent”
}

What IR port is sending the signal to the shade? The first parameter in the sendir command is where you set that. Your code state 1:3 which means it is sending the IR signal from the 3rd port.