Struggling newbie with iTach

(Jacques Vigeant) #1

HI All,

I’m really struggling on how to put the pieces together. I have an iTach WIFI 2 IR that i want to use as my TV controller.

so i created a device type ( called iTach ) that is effectively a bunch of standard tiles each of which fire a custom commands like ( TVON, TVOFF, SET_INPUT_1, etc…) when you tap on the tiles. I made the tiles an extension of the ‘switch’ device.

This works fine… Then i created a smartapp that listens for the TVON.TVOFF. etc events and sends the appropriate IR CODE to the itach and voila… This also works perfectly in the simulator…I can hit any tile and it controls the tv correctly.

where everything falls apart is … How do i now get the app on my phone connected to a ‘virtual’ device an not an actual device ? if i connect it to a switch for example, when i turn that switch on/off it does also trun my tv on and off, but i actually want to have my martapp be the virtual switch …

Is that even possible… the abstractions in this paradigm are so abstract i seem to get lost…

Can someone point me in the right direction ? is there a different capability that would get me closer ?

Cheers from a confused, but excited enthusiast

(Tim Slagle) #2

Welcome to the forums my friend!

First, can you describe in more detail what you are trying to do?

Is this smartapp here the iTach smart app or a smartthings smartapp?

Connect what you a switch? Sounds like your talking about a device type and that seems odd… Are you talking about connecting a smart app to a physical switch that then triggers a command on the device type?

Think we can get this working I just need more details :smile:

(Mike Maxwell) #3

A smart app can have a a click action, but it can only have one, unlike a device.
To enable it requires the following:
subscribe(app, myMethod)

def myMethod(evt){ “myMethod: ${evt}”
//now do something interesting

The app should now have a little arrow over the image, when selected myMethod will fire.

You can also call hubAction directly from a device, a smartApp isn’t required.

(sidjohn1) #4

I’m not sure how much this will help, but you never know. Ive written a devicetype to control a roomba over wifi and its basicly an over glorified switch. On to clean, Off to Dock and sounds very similar to what you are doing. The device becomes the IP address of the physical device. In my case the thinkingcleaner and in your case the iTach.
Have a peek @ ThinkingCleaner.groovy and ThinkingCleanerer.groovy, hopefully that will help.

(Jacques Vigeant) #5

some clarifications…

  1. i created a new device type that leverages the switch capability. this device type has 5 tiles in it representing ON/OFF/Input1/Input2/Input3.

  2. then i created a smartapp that manages what i send to the iTach based on the event the smartapp receives. When i was developing i was testing using a ‘virtual’ device and that was working great… each tile i hit sent a different string to the iTach.

where my logic broke down is that when i configure the smart app on the phone, it forces me to associate it to a ‘switch’ that really doesn’t exist in the physical world… As a test i associated my smartapp to a lightswitch just to see if the on/off light switch would also do on/off of the tv and it does.

ideally I’m looking to have a collection of ‘virtual buttons’ in the Smartthings App ( somewhere ) that will let me send different commands ( a string of chars ) to my iTach.over TCP. like a remote ‘TV Remote’ of sorts

My problem is i can’t figure out how to create a logical collection of ‘buttons’ that could trigger different events in the smartthings app on my phone…


You’re asking for a different reason, but the answer will be very similar to the answers in the following thread:

(sidjohn1) #7

That is what a device is and does, it is a collection of buttons like on or off that can trigger different events in a smartapp after the smartapp has subscribed to the events from the device. You might want to try posting your code so others can help you figure out where you are getting stuck.


BTW, if what you are asking is just how to create a virtual switch that will have a Thing tile in the ST app, you create it through the IDE.