Making a device to hold your IR command codes

Having set up a Global Caché itach IP to IR device recently, I thought a few notes may useful. Here’s the itach device:

Started by installing the GC100 plugin, which works well with the IP2IR. It started to get tricky when it became time to record a few IR commands using iLearn. The itach tutorial is not particularly clear but eventually a few codes were learnt that looked like they may work.

http://www.globalcache.com/support/ilearntutorial/

Much time was spent reading through this thread, which discusses how IR command codes can be integrated into Vera:

http://forum.micasaverde.com/index.php/topic,10886.0.html

These files were used as templates - they’re U14 but appear to work on U15:

I_SkyHDDVR1.xml
D_SkyHDDVR1.xml

Edit: Use the Yamaha or Daikin files posted further below.

Nothing worked till I determined the magic steps to produce a viable device from these files - the steps are reproduced below. The trick is that everything has to be reloaded multiple times before Vera is ready to use the IR command files. If those files aren’t right you can waste a lot of time working out where the problem resides.

Maybe I missed something and my whole approach is wrong. Regardless, happy to hear any criticisms, shortcuts or alternatives.

Installing an IR device:

Using U15 and firmware version: 1.5.408

  1. Upload your “D_xyz.xml” and “I_xyz.xml” containing your Device description and IR codes - some users may also decide to use their own “S_xyz.xml” file.

  2. Start with U15–>APPS–>Develop Apps–>Create device:
    Insert file name “D_xyz.xml” into “Upnp Device Filename” entry box
    Click “Create Device” button.

There are no checks on what the file contains or what entry field you used. So it’s fairly easy to accidentally use the wrong field ie “Upnp Implementation Filename”.

  1. Go to the “Devices” tab. The created device is shown as a blank untitled device. Operate the spanner icon.
    Look at the Settings tab: note that there is no mention of “Infrared transmitter”.
    Look at the Advanced Tab: the device_type field says “generic_device” and there is no mention of a field called “IODevice”.

It appears that at this point the “D_xyz.xml” file has not yet been read.

  1. Operate the main “Reload” button at top right of screen - wait till it’s done.
    The device you created is now titled whatever you called it in the tag in the “D_xyz.xml” file.
    Look at the “Settings” tab: there is no mention of “Infrared transmitter”.
    Look at the “Advanced” tab: the “device_type” field is now loaded with “urn:schemas-micasaverde-com:device:ABC:1” and there is no mention of a field called “IODevice”.

It appears that the last Reload resulted in the “D_xyz.xml” file being read.

Note that the ABC in “urn:schemas-micasaverde-com:device:ABC:1” should be taken from this list - “IrDevice” is a useful generic value:

http://wiki.micasaverde.com/index.php/Luup_UPNP_Files#IR_Device_Types

  1. Operate the main “Reload” button at top right of screen - wait till it’s done.
    The “Settings” tab now has a pull down list allowing you to select the “Infrared transmitter”
    Look at the “Advanced” tab: There is still no mention of a field called “IODevice”.

Now that the “D_xyz.xml” file has been read, the software has now determined the device will make use of infrared I/O.

  1. Select your infrared I/O device from the pull down list and save using the red Save button at top right of screen. Look at the device’s Advanced Tab: There is now a field called “IODevice”.

At this point you are ready to go!!

You can now find your device in this list:

http://VERAs_IP_address:3480/data_request?id=lu_invoke

Click on the links for your IR codes to test them. Note that digital cameras can see infrared, so you can look at your IR emitter via the camera’s LCD screen in order to determine if your emitter is in fact radiating infrared commands.

Note that deleting a device does not update this URL:

http://VERAs_IP_address:3480/data_request?id=lu_invoke

You need to “Reload” to update the page.

During the set up procedure above, the above link will refer to your device but will not work correctly till the whole procedure has been completed up to step 6 above.

If you discover your “D_xyz.xml” file contains errors, you may need to delete your device and recreate it right from the beginning to ensure any changes to the “D_xyz.xml” file are read.

If you see “no implementation” errors, have a look at the linkage from the “D_xyz.xml” file to the “I_xyz.xml” file and check that the internals of the “I_xyz.xml” file are correct.

Some of the generic command naming as found in the following work well:

S_DiscretePower1.xml
S_TogglePower1.xml
S_Volume1.xml

However if you don’t like the generic lists of remote control buttons provided as per these examples:

S_InputSelection1.xml
S_Misc1.xml
S_Misc1.xml

Then you can make your own “S_xyz.xml” file to suit your command set; ensuring that “D_xyz.xml” links to “S_xyz.xml” and that in turn links to "I_xyz.xml

Nice post…

Hi a-lurker (great name :wink:

Nice job…

It might be an idea (if you have the time) to add some screen shots to show the process visually too, and if you’ve learnt any set of IR codes and created and Vera device for it, maybe you could consider sharing those files to help create a sort if IR code bank ?

BTW - Those SkyHDDVR.xml file you referenced were the ones I created a while back with @Guessed’s (huge) help for the Kira IR reciever I have, and as I tookl them from something else too, it’s great to seem them being recycled even more.

Hi,

new to this forum, this looks to be exactly what I want to do. I’d really like to take a look at the xml files you mention but can’t find them - is there any way I can get hold of these?

Thanks

Just add a random IR device to vera and then download the XML file from Veras web interface under APPS > DEVELOP APPS > LUUP FILES.

Speaking of which can anyone tell me, when making your own “D_xyz.xml” and “I_xyz.xml” files, can you send GC codes or does it have to be HEX?

I have tried to create an ir device numerous ways and have follew numerous methods I am never able t access th ir codes when trying to utilize them as part of a scene. I have even tried to alter one of the code set files created by Vera during the guided setup process… It seems that any alteration to these files especially the service files does something to the system that does not allow me to access the codes from the scene setup Advanced menu. The only thing that has worked is if I only alter the IR code in the implementation file. name the IR actio name the IR action accordingly instea instead of having a generic names such as input 1. If anybody has any insight or has been successful.

When I was doing this, I only wanted a few codes eg like power toggle and volume control and input selection. I didn’t want all the stuff in the Vera provided service files such as in S_MediaNavigation1.xml and the like. I found it was easier/clearer to provide your own service file. So have a look at the attached files for a Yamaha AV receiver, which uses predefined services provided by Vera eg on/off toggle and volume functions, plus services described in my own service file, which are then implemented in the implementation file together with the Vera provided services. Using this method you don’t even have to use Vera services - just make you own - see the Daikin Aircon example files also attached in the next post.

The D_xzy.xml files contain a tag. So every time these files are copied/reused the UDN (unique device name) is no longer unique! I could imagine that could result in a problem on the one network, if multiple same UUID usage was in place. However I suspect Vera is using it’s own uuid: values, because the ones in the D_xzy.xml files never seem to appear anywhere. If anyone knows anything further about this and how it works in Vera - would like to hear about it.

Regardless you can make your own UUIDs here:

http://www.famkruithof.net/uuid/uuidgen

Note it’s not a good idea to modify the Vera provided service files. That may result in other stuff failing to work.

Daikin files:

Thank you for your reply and assistance but I am still having trouble and am trying to figure this out. If I upload the files you have provided for the Yamaha and Daikin without any alterations they work perfectly. The devices are created and function properly. The minute I edit anything in the files and re-save them, even if I use the same name they do not work. I even tried just editing the friendly name in the Device xml file and have the same problem. This leads me to believe that something is happening when I re-save the documents. I don’t know if this is an encoding issue or not. I have tried editing with both Microsoft xml editor and xml copy editor and even notepad. I have even saved a file in notepad and changed the extension to xml. On the UI when I check the Advanced Tab I notice that Vera never gives my newly created device a UDN tag. I even tried giving it one myself in the device file as you suggested but it did not work. When I use your files Vera gives the device a new UDN compared to the one in your file. If you can offer anymore asistance that would be great. I have attached some of the file I created using yours as a template. Nothing seems to be wrong in the code.

Never mind on the above post. I found that If I use Notepad++ to edit the files they work. I don’t know whats wrong with the other editors. Wonder if anyone else has had similar trouble.

@scravott,
A number of editors put “prefix” bytes on the beginning of the files they’re editing. This is particularly true for Windows-based editors, even if they indicate they work on plain-text files.

This is permitted for XML files, and some editors will add these to the start of any XML file you’re working on. The XML parser in Vera, however, will not recognize the file when these are present and will error out in odd ways.

Your files have this type of binary prefix at the start of them (at least, the one I validated appeared to)

For reference:
Byte order mark - Wikipedia

Extra binary bytes indicate the file supports an extended character set.

Exactly, which is why I posted my comment above…

The point being that, while standard, Vera doesn’t support it.

I use NotePad++ (great editor). It shows my original files as “Encode in ANSI” (subset of UTF8) and shows @scravott’s files as “Encode in UTF8”. I have a hex plugin and it shows the BOM bytes ( ef bb bf ) to be present in scravott’s files but not in mine.

Interesting but I find this pretty concerning. There are a lot of editors that just silently stick in the BOM. So how many Vera users have encountered this and never been able to figure it out? Perhaps just assuming their poor outcomes were the result of their coding? Should the proper recognition/handling of the BOM by Vera be flagged as feature request?

I will add a note to here:

http://wiki.mios.com/index.php/Plugin_Creation_Tutorial

@a-lurker,
It’s happened at least twice before that I can recall, at least as people posting the response/issue to the forum. That’s why I knew what to look for, but I also work with a lot of i18n files so I had a few clues to go on.

A normal Vera user, just cloning some existing files, is not going to have it as easy. Filing the bug will at least provide something to go on, but I doubt they’ll fix it anytime soon. More critical items have gone for yrs in that black hole :cry:

It’s a pity the Windows editors are doing that, it seems to be something introduced after WinXP.

Thanks to everyone for the replies. I’m not a programmer but can usually figure most of this stuff out, with help of the forums etc… of course. I have read numerous posts by guessed, lurker and schaefer. By the way PLEG is awesome and HAL is pretty good too. Thanks for those. Now I’m off to automate the pool. Thanks again

Hi,

Don’t the GC, IR-PRO, Salae Logic etc etc…

Out of pure luck, came across an Australian company that specialize in long form IR (HVAC).

They are on the ball! Device has a learner that easily captures 64bytes or more, as well as a blaster (transmitter), so u can check there and then if ur learns were error free.

Company in question: Command Fusion. No other product out there.

If u n?ed assistance pertaining to your problem, pop me a mail and we can discuss further.

We just completed a solution that will go to market soon. A sort of black box. Learns, confirms, deciphers algorithm (preamble, timings, checksum etc). A piece of magic.

Anyway, apologies, not pitching here. It’s just I read these forums all the time, and always the same problems. Almost drove me nuts. But we did it.

Good luck. :slight_smile:

@andreasrsa

I am using a remotec ZXT120 to try and control my Daikin AC, but i only have very limited functionality. I would like to find something which works better. Do you have any more information of what this product is usable for, and if it integrates with Vera ?
I am UK based

Update: I had a look online, and found some information on their website, but i cant see if it works with AC’s, and i am not sure of how it could integrate with Vera (if it does)

I wrote a how to on this after spending two days figuring it all out based on a-lurker helpful post.
http://tech-n-life.com/index.php/2013/12/3337/
I will post later properly

@konradwalsh

Instead of using iLearn, I suggest to use IrScrutinizer IrScrutinizer documentation
This software helped me to capture clear IR codes for all my devices much faster and w/o pain :slight_smile:
It can utilise your iTach as Capture HW.

@all thanks for the great thread!