Dear ST Community,
I am looking to do the following, create a button to Turn on my TV, Amp and Humax with one button on the ST App. Once this is achieved I want to be able to call out the command to Amazon’s Alexa. I have the following setup:
Devices:
Sony Bravia TV (Non IP, IR only)
Onkyo Amp (Non IP, IR only)
Humax Sat Receiver (Possibly IP and IR)
To bind this together I have an iTach IP2IR unit on the network (192.168.210.12)
On the IP2IR the following command will work to switch On the Onkyo Amp:
sendir,1:1,1,38000,1,1,342,171,21,21,21,63,21,21,21,21,21,63,21,21,21,63,21,63,21,63,21,21,21,63,21,63,21,21,21,63,21,63,21,21,21,21,21,21,21,63,21,21,21,21,21,21,21,21,21,21,21,63,21,63,21,21,21,63,21,63,21,63,21,63,21,63,21,1484,342,85,21,36
I believe in ST I need to add something like this:
sendHubCommand(new physicalgraph.device.HubAction("""$theCom\r\n""", physicalgraph.device.Protocol.LAN, “${deviceNetworkId}”))
The complete command should look like this (I think):
sendHubCommand(new physicalgraph.device.HubAction("""$sendir,1:1,1,38000,1,1,342,171,21,21,21,63,21,21,21,21,21,63,21,21,21,63,21,63,21,63,21,21,21,63,21,63,21,21,21,63,21,63,21,21,21,21,21,21,21,63,21,21,21,21,21,21,21,21,21,21,21,63,21,63,21,21,21,63,21,63,21,63,21,63,21,63,21,1484,342,85,21,36
\r\n""", physicalgraph.device.Protocol.LAN, “${0xC0A8D20C}”))
Where I am struggling is how to write this as a SmartApp, how will it show up? How will associate a button to it and how do I associate a name to the App.
Can anyone help by showing me an example program of this type, I am new to ST but I think if I can be shown once I will be able to get to grips with it?
Kind thanks in advance.