Author Topic: Help understanding SQBlaster -> Vera Device conversion process  (Read 5401 times)

Offline mikee123

  • Hero Member
  • *****
  • Posts: 1521
  • Karma: +18/-11
Help understanding SQBlaster -> Vera Device conversion process
« on: September 02, 2013, 02:47:13 pm »
 I have got the SQ blaster plugin installed, and after a while it has created 4 child devices, IR AUX Channel 1 to channel 4. So far so good. But i have about 10 different devices which i control via SQ blaster. And these Aux channels do not make any sense to me, and i did not really understand the xml file creation mentioned here in the thread, and i dont know if i need them. My main goal is to run macros from SQ blaster via Vera. Is there a up to date wiki somewhere about how to use these child devices or create the ones i need ?

I think i understand what these IR Aux channels are. they must correspond to the different IR outputs on the blaster. So somehow i can use them to send ir signals to the ir leds connected to the corresponding output.

After reading some more. I have the newest version of my blaster.zip file. In the zip file i have 16 .xml files. These i have to somehow transform into D and I files (that i dont understand how)
I have to do that for every xml file ? And then how do i know which xml file does what, and where are my macros ?
« Last Edit: September 02, 2013, 03:10:31 pm by mikee123 »

Offline mikee123

  • Hero Member
  • *****
  • Posts: 1521
  • Karma: +18/-11
Re: Help understanding SQBlaster -> Vera Device conversion process
« Reply #1 on: September 02, 2013, 04:12:01 pm »
I found this site (from one of the threads here) to convert my xml file. http://xslttest.appspot.com/. In the top, i have entered my xml file like this <SQCommandInfo key="dev124392937">
  <command_info command_name="PLAY" SQKeyCode="0"...
In here: Enter your XSLT or it's URL: i have copied and pasted the xls file (tried the d as well as the I...) like this :
1   <?xml version="1.0" encoding="UTF-8"?>
2   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3       version="1.0">
4       <xsl:output indent="yes"/>
5       <xsl:preserve-space elements="irdata"/>
  i have done it with and without line numbers.
Run transformation and open result stay greyed out. I have also tried on this site http://www.shell-tools.net/index.php?op=xslt
but i get this error:
/var/chroot/tmp/FOOByUyfc:2: parser error : Start tag expected, '<' not found
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
^
cannot parse /var/chroot/tmp/FOOByUyfc

Offline guessed

  • Community Beta
  • Master Member
  • ******
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Help understanding SQBlaster -> Vera Device conversion process
« Reply #2 on: September 02, 2013, 07:14:17 pm »
The instructions are written for the Shell-tools site, so that's the one you should use.  You may have luck using other sites, but unless you're familiar with the process you'll be burning cycles trying to work it out elsewhere.

Not sure where you're getting the "line numbers" from.  Non of these files have line numbers in them, so there must be some tool you're using and/or viewing them with that's applying these....   they'll just get in the way.

You should be downloading two "xsl" files from the Source control area.  Once downloaded, they'll be .xsl files on your Desktop (or where-ever you choose to download them to)

These can then be opened with your favorite Text editor (like, say, Notepad on Windows, or TextEdit on a Mac) before you copy/paste the content into the respective Browser window of the shell-tools site.

Repeat the process for the .xml contents of the files that are in the box.net "backup" of SQRemote.



... and when you run into issues, attach complete copy of all the files, and screenshots of the errors.  You'd be surprised by how often something extra can be picked up in a screenshot of the browser than just a textual representation of what was seen ;)


PS: I split your post out.  It's too easy for this stuff to get lost in the noise, and I only infrequently post on MCV's forums these days.

Offline mikee123

  • Hero Member
  • *****
  • Posts: 1521
  • Karma: +18/-11
Re: Help understanding SQBlaster -> Vera Device conversion process
« Reply #3 on: September 03, 2013, 04:58:16 am »
I will do it again tonight and post a screen print and the files. How do i know which device.xml file is for which device (as i have 16 of them...) and can i access my sq blaster macros ?

Offline mikee123

  • Hero Member
  • *****
  • Posts: 1521
  • Karma: +18/-11
Re: Help understanding SQBlaster -> Vera Device conversion process
« Reply #4 on: September 03, 2013, 03:07:40 pm »
Trying to just repeat what i did yesterday, and i have seen this in your post

Quote
Repeat the process for the .xml contents of the files that are in the box.net "backup" of SQRemote

When i go into box.net, i have a subdirectory 'SQControlPads', in there are all my configuration files i had created as .zip files. There is no backup directory or file. Maybe thats where i am going wrong ?
I am going to send you the latest config file i am using, and i will put up scren shots in a second too

Offline mikee123

  • Hero Member
  • *****
  • Posts: 1521
  • Karma: +18/-11
Re: Help understanding SQBlaster -> Vera Device conversion process
« Reply #5 on: September 03, 2013, 03:13:52 pm »
This is a screen shot from shell online. I tried sending you my config file via pm but it does not seem possible to do that


Offline Piwtorak

  • Hero Member
  • *****
  • Posts: 988
  • Karma: +4/-0
Re: Help understanding SQBlaster -> Vera Device conversion process
« Reply #6 on: September 03, 2013, 04:17:02 pm »
I am trying run commands to sqblaster trigger macros and/or direct Ir commands.

with redeye is working fine.

this is good because sqblaster has a good and easy way to create macros. with vera is more complicated.

I let you know my advances.
Vera3 (1), Airport Extreme (2), Apple TV (3), Sqblaster (1), GE Switch (3), GE Dimmer (1), Leviton VRCSZ2 (2), GE 45601 (1), Intermatic HA03 (2), GE Zwave Outlet (1), Remote Control Curtain (1) and growing.

Offline guessed

  • Community Beta
  • Master Member
  • ******
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Help understanding SQBlaster -> Vera Device conversion process
« Reply #7 on: September 03, 2013, 04:24:58 pm »
From the UI, it looks like something you're doing is "adding" Minus ("-") signs to the SQBlaster_I.xsl file. 

The original file, prior to download, doesn't contain these characters.

My guess is that you're opening the file using IE, before doing the Copy&Paste operation.  IE does a layout operation and adds expand/collapse (+/-) characters on the left that are not in the original file.

If this is the case, try opening the file in a standard [plain-text] editor like Wordpad or Notepad, before doing the Copy&Paste operation.


NOTE: The current conversion process doesn't export SQRemote Macro's.  These are kept in a different file from the devnnnnnnnn.xml files.  In theory i's possible to extract/transform them, using a similar technique (XSLT) that I've done here, but I've never ventured down that path.

For me, Vera wasn't capable enough to do anything real-time*.  IR in particular requires a lot of real-time interactions to work well, without frustrating the user, so I never went further than the basic integration (to do All On/All off type stuff)

* I apply this term very broadly.  It's use is not limited to IR functionality...

Offline mikee123

  • Hero Member
  • *****
  • Posts: 1521
  • Karma: +18/-11
Re: Help understanding SQBlaster -> Vera Device conversion process
« Reply #8 on: September 03, 2013, 05:24:41 pm »
Opening the file in notepad did the trick. Now converting 16 xml files...

That leaves me with just one more question (for the moment), how do i know which file is for which device ?

Offline guessed

  • Community Beta
  • Master Member
  • ******
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Help understanding SQBlaster -> Vera Device conversion process
« Reply #9 on: September 03, 2013, 08:36:17 pm »
That leaves me with just one more question (for the moment), how do i know which file is for which device ?
IIRC there's no marker in the file itself, which makes it a little "trial and error" to get which is which. 

There is more formation in the XML file that I don't process, but you'd have to open it up and work it out.  That file also contains the Macro definitions (again, going from memory)

Offline mikee123

  • Hero Member
  • *****
  • Posts: 1521
  • Karma: +18/-11
Re: Help understanding SQBlaster -> Vera Device conversion process
« Reply #10 on: September 04, 2013, 05:43:31 am »
Ok will go through my xml files to see if i can find any useful information. If i remember right, there is no way to trigger the macros, is that something which might be possible one day ?

Offline garrettwp

  • Master Member
  • *******
  • Posts: 6371
  • Karma: +227/-128
  • Vera 3, Lite, ISY994
Re: Help understanding SQBlaster -> Vera Device conversion process
« Reply #11 on: September 04, 2013, 07:22:53 am »
Does not look like it. See here:

http://www.squareconnect.com/downloads/SQBlasterAPI.pdf

- Garrett

Offline mikee123

  • Hero Member
  • *****
  • Posts: 1521
  • Karma: +18/-11
Re: Help understanding SQBlaster -> Vera Device conversion process
« Reply #12 on: September 04, 2013, 05:20:09 pm »
I am having some success. I have created some devices, one for my Sky box, one for Cable TV and one for my Lutron lighting. I am pretty sure i have the right .xml files for them. Sky i have created a scene for on/off, thats working fine. Cable TV does not react to my command, i have to do more testing. The problem i am having is with my Lutron lighting device. The device created like the other ones. When i go create a scene in advanced add lutron, i had an error invalid json file. After a few reloads, i can add the device in the advanced scene section, but there should be options for 16 light settings, fade, off and a couple of other functions.

These are the files i am using:




Offline guessed

  • Community Beta
  • Master Member
  • ******
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Help understanding SQBlaster -> Vera Device conversion process
« Reply #13 on: September 04, 2013, 10:18:48 pm »
For the file you attached, what you're seeing does occur.  In MiOS, there are a set of "IR" Services that contain ACTIONS for various AV things like "Volume Up/Down", Channel Up/Down and so on. 

These IR ACTIONs only exist for AV-related components, but in the IR world there are also a lot of "non-AV" things (also IR Controlled)

The Transformation process you went through does a map of the IR Actions from SQBlaster/SQRemote to equivalent ones in MiOS.  Since MiOS only has IR functions for AV gear, there are cases where there's no equivalent mapping.

In these cases, I simply put in "Placeholder" elements into the I_xxxxxxxxx.xml file, as a "holder" of sorts to contain the Pronto codes.  If, at the end of processing the I_xxxxxxxxx.xml file, we've only got placeholders, then the D_xxxxxxxxxx.xml file will not contain ANY Service definitions.

Anyhow, these items need to be "manually" mapped to something in order for them to be accessed via the Vera UI/Scene editor.  In the past, I've seen people map these to one of the [various] unused MiOS AV IR ACTIONs.  There are a lot of them, so it's fairly easy to do, but just a bit tedious.

Again, this is only required in the cases where you're mapping an non-AV Device to MiOS, since there's no logical mapping for it.  For your AV gear, the mappings should be fairly accurate.

Offline mikee123

  • Hero Member
  • *****
  • Posts: 1521
  • Karma: +18/-11
Re: Help understanding SQBlaster -> Vera Device conversion process
« Reply #14 on: September 05, 2013, 03:00:30 am »
Ok that makes sense now. I had varios other xml files where the resulting D_SQdevxxx file looked empty, but that probably explains it. I dont mid trying to map some actions manually as i only want a few functions (like lights on off and maybe a couple of scenes for lighting). How do i do that ? Is there a thread about that ?