The Vera Community forums have moved!

General => Remote Control => SQ Remote / Square Connect (iOS) => Topic started by: guessed on January 09, 2011, 09:16:20 pm

Title: Luup Plugin: SQBlaster interface
Post by: guessed on January 09, 2011, 09:16:20 pm
I've uploaded 2x XSLT files to code.mios.com that can be used (with a freestanding XSLT Tool) to "transform" an XML Device file, from SQRemote's backup, into the requisite I_xxx.xml and D_xxx.xml files for MiOS to talk directly to the Puck.

They're prototypes right now, and currently untested.
    http://code.mios.com/trac/mios_sqblaster/browser/trunk/xslt/SQBlaster_I.xsl (http://code.mios.com/trac/mios_sqblaster/browser/trunk/xslt/SQBlaster_I.xsl)
    http://code.mios.com/trac/mios_sqblaster/browser/trunk/xslt/SQBlaster_D.xsl (http://code.mios.com/trac/mios_sqblaster/browser/trunk/xslt/SQBlaster_D.xsl)

If you feed the SQBlaster device files (xxxxxxxxx.xml) through an XSLT processor with SQBlaster_I.xsl, it'll emit the I_xxx.xml file for the Mios Device Implementation file.

If you feed this new Implementation file (I_xxx.xml) through an XSLT processor with SQBlaster_D.xsl, it'll emit the D_xxx.xml file for the MiOS Device Descriptor file.


Again, it's not been tested yet, and the IR "mapping" isn't complete just yet, but it's a start.  If anyone has good Javascript skills the XML/XSLT Processing could be done "in browser" to avoid the extra step of having the command line XSLT Processor ;)
Title: Luup Plugin: SQBlaster interface
Post by: strangely on January 10, 2011, 01:22:45 am
Any idea if the below would work for the translation?

http://www.shell-tools.net/index.php?op=xslt

Or is it too basic in that the output format can't be specified?
I just ran it with one of the two code sets I have in my backup (not sure which one is which to be honest) but for the most part the output for an implementation xml seemed very close to what I'd expect.

Out of interest, what are you using on the Mac to transform?
Title: Luup Plugin: SQBlaster interface
Post by: guessed on January 10, 2011, 11:24:56 am
Yes, that URL works just fine.  I use fairly minimal spec XSLT, so I imagine there are a few of those around.  There's one on the W3C site, but it only takes URL's as input (not pasted text) so this one is better.

On the Mac, I'm trialing a very expensive Development tool that's specifically targetted at XML/XSLT and Debugging.  It's not something the average person would likely buy if it's only going to be used for this purpose.
Title: Luup Plugin: SQBlaster interface
Post by: guessed on January 20, 2011, 12:15:37 am
I've uploaded 2x XSLT files to code.mios.com that can be used (with a freestanding XSLT Tool) to "transform" an XML Device file, from SQRemote's backup, into the requisite I_xxx.xml and D_xxx.xml files for MiOS to talk directly to the Puck.

They're prototypes right now, and currently untested.
    http://code.mios.com/trac/mios_sqblaster/browser/trunk/SQBlaster_I.xsl
    http://code.mios.com/trac/mios_sqblaster/browser/trunk/SQBlaster_D.xsl

If you feed the SQBlaster device files (xxxxxxxxx.xml) through an XSLT processor with SQBlaster_I.xsl, it'll emit the I_xxx.xml file for the Mios Device Implementation file.

If you feed this new Implementation file (I_xxx.xml) through an XSLT processor with SQBlaster_D.xsl, it'll emit the D_xxx.xml file for the MiOS Device Descriptor file.


Again, it's not been tested yet, and the IR "mapping" isn't complete just yet, but it's a start.  If anyone has good Javascript skills the XML/XSLT Processing could be done "in browser" to avoid the extra step of having the command line XSLT Processor ;)
I pushed newer versions of these XSLT files over the weekend, with the following improvements:

a) Broader mapping of SQRemote "codes" to MiOS IR-Device Actions
b) Use SQKeyCode as the Primary "mapping" vehicle instead of the Text-based Description (which varies too much across devices)
c) Generate correct output for UEI-based SQBlaster codes, as these weren't handled correctly

If you try it, let me know feedback/comments.  Folk should be able to use the URL that @strangely posted to generate starter I_xxxx.xml and D_xxxx.xml files if they don't otherwise have a tool to kickoff the transform.


Many thanks to @SquareConnectJohn for a prelim of the SQBlaster API doco.  It made is easier to expand the mappings and gave me a clearer understanding of the SQBlaster XML Device file elements/structure (etc).
Title: Luup Plugin: SQBlaster interface
Post by: shuyu2k on February 16, 2011, 05:48:04 pm
Hi, guessed,
I am very interested in your plugin for Sqblaster in vera. But I don't have any experience with programing in vera. Can you provide an example for me?
I attached a saved configuration file download from box.net. I have tested this configuration in SQ Remote on Ipad and confirmed it's working.
Would you please transfer this file to a plugin that can be used in vera?
I have already installed the plugin from: http://code.mios.com/trac/mios_sqblaster
I am hoping that once I install your newly developed plugin, I can create a scene in vera to "Turn on" my TV at 7am in the morning?
Thank you very much.
Title: Luup Plugin: SQBlaster interface
Post by: guessed on February 17, 2011, 04:09:48 am
Sorry for the delay, turns out that the hosted site I've been using to do this XSLT transformation has been down all day (it's the one @strangely lists above).

Anyhow, it encouraged me to write a pure-Lua version of it so, longer term, I won't need to use anything other than Vera to execute the Conversion process.

The [converted] IR Device Plugin files for the Zenith are (attached) and are in addition to the SQBlaster IR Transmitter Plugin files you probably already have loaded and setup.

I've modified the Wiki instructions to show both what the SQBlaster plugin does, as well as the requirement to generate the IR Device files

Unfortunately I'm running a version of the Beta (1.1.1183) that doesn't let me associate the Zenith with my SQBlaster, but you shouldn't have that problem unless you've moved to the Beta.

If you have, let me know, as it's still possible to fix, just takes a little longer to describe the work-around.

I've attached some screenshots showing the Setup Process (etc), these are all out of sequence, but I'm sure you'll work it out.
Title: Luup Plugin: SQBlaster interface
Post by: guessed on February 17, 2011, 04:11:47 am
... and the most important one, the "Install" setup I used to get the Zenith TV device created, after uploading the generated/derived D_SQdevxxxx.xml and I_SQdevxxxx.xml files.



This screenshot is of the Advanced Scenes Tab, showing the pull down for IR Actions that can be executed against the Zenith TV.
Title: Luup Plugin: SQBlaster interface
Post by: shuyu2k on February 17, 2011, 12:39:27 pm
Hi, guessed,
Thank you for your work. I have successfully setup the IR Transmitter and the Zenith TV device in Vera. Now I CAN see all commands in advance tab when creating new scenes. So I assume it should work.
Unfortunately, it didn't. Maybe it is because of my firmware version? Currently I am running at 1.1.1186.
Do I need to reset the firmware to an older version?
Title: Luup Plugin: SQBlaster interface
Post by: guessed on February 17, 2011, 03:43:00 pm
Hi, guessed,
Thank you for your work. I have successfully setup the IR Transmitter and the Zenith TV device in Vera. Now I CAN see all commands in advance tab when creating new scenes. So I assume it should work.
Unfortunately, it didn't. Maybe it is because of my firmware version? Currently I am running at 1.1.1186.
Do I need to reset the firmware to an older version?

Yeap, you're on a Beta release.

A problem was intro'd into the Beta's where the normal UI "mechanism" for associating an IR Device, with the IR Transmitter  that it should use, it missing.  They've since added it back, but we don't yet have access to that version.

It's normally a Drop-down menu, present in the Device's editing dialog that lets you do this, and the drop down shows "all" the IR Transmitter devices you have installed into your system.

If you're on a Beta release, as you are, then this association needs to be setup manually before the "Device" can start sending stuff (since, in any system, there might be more than one IR Transmitter device, like I have)


Anyhow, here are the manual steps you need to perform to work-around the Beta bug:

a) Find the "Device #" of the IR Transmitter device in your system
In the example screenshot (UI4_1.png) mine shows as "90" in the Device dialog.  In the examples below, I'll use the value "90", but you should change this to the value from your system.

b) Open the Device Dialog for your IR Device in your system (the ZenithTV in your case) and create a Variable called "IODevice".
The specifics of the Variable are as follows:

Quote
    New service:    urn:micasaverde-com:serviceId:HaDevice1
    New variable:   IODevice
    New value:    90

These values are case-sensitive, and should be entered exactly as above, then click the (Add >) Button

c) Click (Save)

d) Validate the values in the Dialog.
If you go back into your Zenith TV dialog, after Vera restarts completely, you should see something like the attached screenshot (UI4_3.png)

At this point the IR Device (Zenith TV) should be setup to send it's codes via your IR Transmitter (SQBlaster Plugin)



again, this work-around shouldn't be needed going forward.
Title: Luup Plugin: SQBlaster interface
Post by: IamLegend on February 18, 2011, 01:45:42 am
I successfully installed the IR Blaster plugin onto my MIOS system.

I took my device file from my backup of my SQ Remote and used the I_XSL file against it and used the D_XSL file against the resulting file as instructed.

I upload the two xml files to my MIOS system.

I tried to create a device but things just aren't working at this point.

I've attached both my device and implementation files.

I would appreciate any help.

Thanks.

Title: Luup Plugin: SQBlaster interface
Post by: shuyu2k on February 18, 2011, 10:51:09 am
guessed, it worked! Thank you very much!
Title: Luup Plugin: SQBlaster interface
Post by: guessed on February 18, 2011, 11:18:53 am
guessed, it worked! Thank you very much!

You're welcome.  Looking forward to making it all easier for folks, esp once I productionize the Pure-Lua version I've got going.
Title: Luup Plugin: SQBlaster interface
Post by: guessed on February 18, 2011, 11:34:01 am
I tried to create a device but things just aren't working at this point.

I've attached both my device and implementation files.

I would appreciate any help.

Thanks.


If you're on 1.1.1183 it's not going to work at all, since all IR is broken at the MiOS Level
If you're on 1.1.1186 it should work, but you need to manually Associate the IR Device (Samsung TV) with the IR Transmitter (SQBlaster Plugin)
If you're on another MiOS Version, please let me know.

Can you elaborate on this:
Quote
I tried to create a device but things just aren't working at this point.

Specifically:

a) Did the IR Device creation, in MiOS, Work?
b) Do you get any Startup errors for any of your Devices?
c) Did you attach your Samsung IR Device to the SQBlaster IR Transmitter Device?
d) Does the IR Transmitter (SQBlaster) Device show as "Up" in it's Dashboard presentation like this image shows:
     http://code.mios.com/trac/mios_sqblaster/attachment/wiki/WikiStart/SQBlasterDevice-UI4.png
e) Can you see the IR Device in the Scene Advanced mode (like the pictures above)?

If all of the above are working, then please outline the specifics of the problem being experienced.  Feel free to also PM me with the location where I can download your LuaUPnP.log file so I can see what's really going on.


Looking at the generated D_SamsungTV.xml, it looks like my XSLT isn't gen'ing it quite correctly.  That shouldn't stop actual IR commands from working, but may cause other problems.  Please attach the original devxxxxxxxxx.xml that was used to build this file as I need to see why the XSLT didn't transform it correctly from the original content.

Basically it appears to be missing the Service Description block.
Title: Luup Plugin: SQBlaster interface
Post by: IamLegend on February 18, 2011, 09:22:34 pm
guessed,

I got it all working.  I had to edit the xsl file because it was looking for a '.' in the device string but it needed to look for ':' instead.

Anyway, thanks for your xsl files and directions.
Title: Luup Plugin: SQBlaster interface
Post by: guessed on February 18, 2011, 10:33:51 pm
guessed,

I got it all working.  I had to edit the xsl file because it was looking for a '.' in the device string but it needed to look for ':' instead.

Anyway, thanks for your xsl files and directions.

Sorry about that.  Looks like I checked in 1/2 of the fix prior (did the SQBlaster_I.xsl before but didn't check in the SQBlaster_D.xsl).

In the process, I noticed that the SQBlaster_D.xsl was missing the TogglePower implementation, so I went ahead and added that in.  If TogglePower "OnOff" is important to you you'll want to regenerate your D_Samsung.xml using the newer SQBlaster_D.xsl.
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on February 18, 2011, 11:04:13 pm
btw, my plan here is to migrate this all over from [external] XSLT processing to my pure-Lua implementation.  I already have the pure-Lua version "converting" devxxxxxxxx.xml files directly to the counterpart I_SQdevxxxxxx.xml and D_SQdevxxxxxxx.xml files, processing that I do directly on Vera.

...with the correct usage of ":" instead of "."  :)

This code will evolve into a "Parent Device" that'll periodically wake up, and look for devxxxxxx.xml files that have been uploaded to Vera, and convert them over to the Vera-specific file formats (then delete the Vera-local devxxxxx.xml)

That'll make the conversion process automatic.  You'd install the existing D_SQBlaster Plugin, and some additional Plugin files that I'm creating, and then simply "upload" the devxxxxxxxx.xml files from SQRemote's box.net backup, and the Plugin will auto-convert them.


The step after that involves reading "looking for" and then reading, the SQRemote's config file so I know what SQBlasters you have, and what IR Devices should be attached to which SQBlaster, and then create all the Devices (as children) and perform all of the IODevice associations necessary to make it "just work".

That should avoid most of the above manual steps, but people will be able to do them if they want to.

At that point, the only thing I'd need to know, that I don't otherwise know from the SQRemote config data (from it's box.net backup) is the IP Addresses of the Puck's themselves (as MiOS doesn't include Avahi, the lib needed to implement Bonjour reliably)

Anyhow, the goal is to learn from, and then eliminate, the bulk of the problems identified above...  It might take a while ;)

Anyhow, figured an update might be appropriate, since I've been posting only "trickle" changes here.
Title: Re: Luup Plugin: SQBlaster interface
Post by: IamLegend on February 19, 2011, 01:51:24 am
guessed,

I got it all working.  I had to edit the xsl file because it was looking for a '.' in the device string but it needed to look for ':' instead.

Anyway, thanks for your xsl files and directions.

Sorry about that.  Looks like I checked in 1/2 of the fix prior (did the SQBlaster_I.xsl before but didn't check in the SQBlaster_D.xsl).

In the process, I noticed that the SQBlaster_D.xsl was missing the TogglePower implementation, so I went ahead and added that in.  If TogglePower "OnOff" is important to you you'll want to regenerate your D_Samsung.xml using the newer SQBlaster_D.xsl.


Thankfully I'm a developer and already modified the xsl file to get the TogglePower working :)
Title: Re: Luup Plugin: SQBlaster interface
Post by: z-waver.ru on April 15, 2011, 02:42:42 am
Hi guessed!

I have a problem regarding how to get work my IR device with SQ Remote via scene in Vera. I posted ticket to John and Mat (http://squareconnect.com/ticket/view.php?id=394415) but they  point me to you.

I tried to do all steps you wrote in this topic but with no success.
My Vera runs on 1.1.1236

Any advise is appreciated.

Boris
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on April 15, 2011, 11:54:13 am
Hey Boris,
I'll need details as I cannot read the SQConnect's Ticketing system.

Please bundle together:
a) Your devxxxxxxxx.xml files from Box.net backup
b) Your PackageDevices.xml from your Box.net backup
c) A detailed description of what you've done so far.
d) Your derived D_Xxxxxxx.xml and I_xxxxxxx.xml files using the XSLT process that's been outlined.


I do have a Pure Lua implementation that will do all the [XSLT] conversions for you, but it hit a runtime bug in MiOS that's prohibiting me from deploying it to folks.  It's a pity, as that codebase will do it all after you upload (a) and (b) above to Vera, and do a restart (it converts all the devxxxxx.xml files, instantiates them as IR devices, instantiates all your Puck's, and wires them all together).  The only thing you'd do is upload your source (devxxxxxx.xml) files, and apply IP addresses to the Puck, and everything else is done for you....

If you're technical, send me a PM and I'll send you instructions to that version since you can use it to do the conversion steps also, avoiding the XSLT, even if you don't use it for Runtime.
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on April 17, 2011, 10:45:33 pm
I've updated the SQBlaster instructions with a section on "debugging", which is here:

    http://code.mios.com/trac/mios_sqblaster/wiki/Debugging-UI4

It's only at start at the moment, but it contains some of the common log output corresponding to "successful" and "failed" IR Cases in the MiOS Log files when working with IR Devices.
Title: Re: Luup Plugin: SQBlaster interface
Post by: fall-line on April 18, 2011, 01:17:53 pm
Looking good - thank you again for all the work you have put into this @guessed.
Title: Re: Luup Plugin: SQBlaster interface
Post by: SquareConnectMat on April 19, 2011, 02:39:59 am
@guessed,

And a heartfelt thanks from us too...

Mat
Title: Re: Luup Plugin: SQBlaster interface
Post by: z-waver.ru on April 21, 2011, 02:49:09 am
Thank you, Guessed!

The problem is solved and it was in the following: 
Our  Implementation file (I_SamsungSoundBox.xml) has a different name than that declared in the D_SamsunSoundBox.xml file (currently listed as I_SQdev908265815.xml).
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on April 21, 2011, 09:09:43 am
Thank you, Guessed!

The problem is solved and it was in the following: 
Our  Implementation file (I_SamsungSoundBox.xml) has a different name than that declared in the D_SamsunSoundBox.xml file (currently listed as I_SQdev908265815.xml).

Thanks @z-wave.ru, good to hear it's working for you.  I've added this problem to the debugging doc in case others run into it.
Title: Re: Luup Plugin: SQBlaster interface
Post by: tbever on April 23, 2011, 12:58:38 am
I am trying to interface my LG Air Conditioner to Vera using the SQBlaster plugin.   Mat from SquareConnect did a great job was able to isolate the codes for the AC and I have this working great in SQ Remote.

I followed the directions to install the SQBlaster plugin from the wiki.  On UI 4, I do not get the text on the icon indicating it is UP, so I am not sure what I did wrong.  The IR Blaster - Room device just shows a generic circle/apple looking icon but nothing else. I uploaded the files from the wiki as per the instructions and created the device, entered the IP address but no go.

I did the Xslt transformation of the xml file from the box.net backup, and created an LG air conditioner device from that, but when I create a scene to test it out, none of the commands show up as they are supposed to in the drop down menu. I entered the correct IP address (did not enter a mac address but don't think I have to..)  I am not sure if this would work if the sqblaster device is not configured correctly to begin with.

I attached my box.net backup file, the packageDevices.xml and the derived LG Air conditioner files.  I using the shell tools online site to process the files.  I looked at the debug log from my vera but there is no line with SQblaster anywhere.  Any help would be appreciated!

Vera firmware version 1.1.1245, zwave 3.2

Addendum: I also had an incorrect reference to the implementation file in the descriptor file, but I fixed it. I deleted the SQblaster Plugin and recreated it and now the correct icon and the text with ....up appears, so the first issue is fixed.  The LG Airconditioner device is still not working though.
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on April 23, 2011, 11:18:19 am
Interesting.  For the normal AV Devices that SQRemote/SQBlaster use, they generate a "SQKeyCode" attribute value in the devxxxxxxxx.xml file for each IR Code.

These SQKeyCodes come from a pre-fab "table" of codes that SquareConnect maintain, where things like "Volume Up" are made consistent across all types of AV Devices.

My SQBlaster Transform files map these SQKeyCodes, and a handful of alternative command_name attr values, to the corresponding MiOS AV Controls.

There are a few issues in the source devxxxxxx.xml file, based upon the above:

a) None of the IR Codes in here have SQKeyCodes
Without SQKeyCode values, the transform doesn't map anything to the MiOS AV counterparts

Here are some examples that [minimally] should be setup in the devxxxxxxxx.xml file:
The "Power Off" code needs to have a SQKeyCode of 3, if it truly represents the Discrete-code for "Off"
The "Power On/Off" code needs to have a SQKeyCode of 1
The "Off" code needs to have a SQKeyCode of 3, if it represents power Off

b) You have multiple Power "off" codes, per the above.
As someone once said "There can be only one", mostly since these "off" codes will map to a single MiOS "Off" code, and there can only be one of those.

c) There are a whole bunch of AirCond specific codes that have no counterparts in MiOS's AV setup.
Things like "Temp Up", "Temp Down", "Deg C/F", "Low", "High", etc, etc.
Since there's no logical equivalent, there's no automated way to map these.  Of course they could be mapped to any of the AV Codes, just so they could be activated, but that would have to be done manually

d) There are a series of recording-specific codes
These are like:

     Set nn - Cool - F1

where nn is between 60 and 86

and they appear to be repeated.  Since these are recording specific, there's no mapping similar to item (c) above.



If you're just trying to map On/Off functions, then fill in the SQKeyCodes (per the above) and re-run the transform.  Mat/John should tweak what they generate for this (if possible) to put in the Key codes.

For a broader AirCond control there's a gap, since MiOS has AV controls but not AirCond ones, so that would need to be added to MiOS itself.
Title: Re: Luup Plugin: SQBlaster interface
Post by: SquareConnectMat on April 23, 2011, 01:37:04 pm
@guessed,

Very good point. I will talk to John about creating a set of standard sqcodes for air conditioners, and make sure we adhere to them as we expand the number of units .

The lg was unusually straight forward to capture as we were able to get both discrete up/down as well as the more typical "complete state". The complete state codes are the ir equivalent of scenes.... A single command puts the air conditioner into a known state. However, even those could probably be mapped. I'll talk to John about how we can do this.


Mat

Title: Re: Luup Plugin: SQBlaster interface
Post by: tbever on April 23, 2011, 02:07:18 pm
Thanks for you reply!

I tried pruning down the xml files to the bare minimum, with just an OFF and a Power ON/Off command to see if I could get it working.  There were some mistakes in the D_LGAirCond.xml file (typos) that I fixed and I tried to get this to work but no luck.  I changed the SQKey codes as you suggested but the options for Off or Power On/off do not show up when I go under the Advanced tab in creating a scene.  I tried the manual steps to reassign the IO to the device number of the blaster (60) as you described with the manual bug for a previous version of the vera firmware but that did not make any difference.

I think it is something stupid that I am just missing.  Here are the new xml files.
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on April 23, 2011, 02:26:30 pm
Yes, they're a little off from what my XSLT Transforms would generate.  Generally, you'd have to edit the source devxxxxxxxx.xml and add the SQKeyCode information in and then regenerate the I_SQdevxxxxx.xml and D_SQdevxxxxx.xml files from that [edited] source file.

Unfortunately, adding these SQKeyCode's directly into the generated I_ and D_ files won't help since the horse has bolted already.

Anyhow, I've attached what it likely would have generated for both the I_ and D_ files "trimmed down" to just the TogglePower1::OnOff and DiscretePower1::Off codes that you had.

I haven't tried these, but they should be functionally what I would have generated.
Title: Re: Luup Plugin: SQBlaster interface
Post by: tbever on April 23, 2011, 03:09:23 pm
I tried these new xml files also but still there is some problem.

I deleted the old LG Airconditioner device, and SSH 'd into vera to manually delete any files related to LG Airconditioner (there were just the 2 old xml files).

When I set up the device again (LG Air Conditioner) there is no IR "Logo" like there is for the "IR-Blaster Room".  I don't think this is being recognized as an IR device. 

To create the device after I uploaded the new I_xxxx.xml and D_xxx.xml files under the Lua tab, I created the new device using these 2 xml files in the correct spaces.  I hit create device, saved, then went into the device advanced tab and entered the correct ip address, and saved.  That did not work when I set up a new scene (pull down in Advanced scene tab did not show commands).

I went back to the LG Air Conditioner device and under Advanced tab, variables I set up New service: urn:micasaverde-com:serviceId:HaDevice1, new variable: IODevice New value 60 (the device number for my "IR Blaster-Room") but still the drop down does not contain the commands when I create a scene in the Advanced scenes tab.

Is there something I am doing wrong in the setup?
Title: Re: Luup Plugin: SQBlaster interface
Post by: tbever on April 23, 2011, 08:50:33 pm
Rather than admitting defeat, I was able to set up a work around.

I created a new room (LG Air Conditioner) and created 3 separate scenes, ie Power off, Power on/off and Set temp 74 Cool Fan1 (a preconfigured code that Mat captured from the remote).  I just set up the IR-Blaster-Room to send out a direct Pronto code to the A/C for each scene and that worked fine.  This will probably serve my needs until I can figure things out a little better.
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on April 23, 2011, 09:05:03 pm
Try these, the others had some sort of DOS characters in them, which I hadn't noticed when I edited them last time and these were breaking MiOS parsing somehow.  Not sure how they got in since they don't appear to be in the devxxxxxx.xml file, so they should not have generated into the [original] D_ and I_ files.
Title: Re: Luup Plugin: SQBlaster interface
Post by: tbever on April 24, 2011, 12:40:32 am
Excellent!  Thanks guessed! That did the trick.

I did have to create a variable to link the device to the IR-Blaster-room device using your other instructions, and after that everything worked like a champ!  I was busting my brains trying to figure out what I did wrong.  I was using microsoft visual studio 2005 Tools for applications to edit the xml files but I must have screwed it up somehow.

Tomorrow I will try to fill out the IRl commands a bit and see if I can get some of the longer states ie 74 Cool F1 working.
Title: Re: Luup Plugin: SQBlaster interface
Post by: tinkerdoctor on May 19, 2011, 10:19:56 am
Any Progress?  I am in the process of building an house using mini splits. 
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on May 19, 2011, 09:53:51 pm
@tinkerdoctor,
The stubs above will do the Off (Discrete), and On/Off (Toggle) for the specific model of AirCond that was being used (an LG). 

Technically the other commands of the AirCond could be generated, and manually "assigned" to various AV-based IR Controls, but there's no "standard" for IR commands at this time, so the tool has no-where to map them when it brings them over to Vera.

What are you specifically looking for in terms of control of your units?
Title: Re: Luup Plugin: SQBlaster interface
Post by: SquareConnectMat on May 22, 2011, 08:12:06 pm
What brand/model of mini-splits are you planning on using?

Mat
Title: Re: Luup Plugin: SQBlaster interface
Post by: tinkerdoctor on June 07, 2011, 08:35:03 pm
I have missed the reply.
At this stage I don’t know yet.  Cost and efficiency are the most important.  By the way the house is in Mexico.  I am considering either SQBlaster or an appliance module (with possible relay for 220V) for just on off (I ransack all local RS within 30miles)
Title: Re: Luup Plugin: SQBlaster interface
Post by: SquareConnectMat on June 08, 2011, 02:56:02 am
We have a dealer in Mexico who I know has successfully recorded most of the air conditioner brands available in Mexico. If you email me at mat @ squareconnect.com, I'll connect you...


Mat
Title: Re: Luup Plugin: SQBlaster interface
Post by: drag0n on November 21, 2011, 10:19:03 am
These instructions are great.
I've successfully created a device for my Air Conditioner, with 3 commands: POWER ON, POWER OFF and Power on cool.
See attached xml files.  I can now use vera scenes to control my Aircon through sq blaster.

I would like this device to be recognized as a standard switch, so that I can use dashboard and ivera to turn it ON/OFF without the need to use scenes.

Can anyone suggest what needs to be changed in the device definition in order for it to be treated like a binary light switch?
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on November 21, 2011, 11:45:01 pm
Can anyone suggest what needs to be changed in the device definition in order for it to be treated like a binary light switch?
In theory, you'd add the BinarySwitch1 ServiceId and you'd then put in a little Lua to "wire" the Light events to call the corresponding IR calls.

In practice, this is a little more complex because most Control points (and the Dashboard itself) won't cleanly recognize it as a switch if you do that.

One approach to this is to add Luup Startup Logic that creates a Child device, using the standard luup.chdev methods, but have the Parent (IR) device handle all of the events of the Child (<handleChildren>1</handleChildren> in D_SQdev1401130560.xml)

eg. basic device creation example from the Weather code http://code.mios.com/trac/mios_weather/browser/trunk/I_GoogleWeather.xml#L264
eg. handleChildren example from the RFXCOM code http://code.mios.com/trac/mios_rfxcom/browser/D_RFXCOM.xml#L18

Then add <action> blocks for the Switch events, this would look like the following, and be put into the IR device implementation file (I_SQdev1401130560.xml):

eg. <action> block for urn:upnp-org:serviceId:SwitchPower1 from the RFXCOM code http://code.mios.com/trac/mios_rfxcom/browser/I_RFXCOM.xml#L1149

Then implement if... then... else logic, along with luup.call_action(...) to invoke the various handlers on the Parent to send the IR commands.

if (lul_settings.newTargetValue == "1") then
    luup.call_action("urn:micasaverde-com:serviceId:DiscretePower1", "On", {}, PARENT_DEVICE)
else
    luup.call_action("urn:micasaverde-com:serviceId:DiscretePower1", "Off", {}, PARENT_DEVICE)
end



That's not all of it, but it'll get you a good starting point to experiment with ...  8)
Title: Re: Luup Plugin: SQBlaster interface
Post by: mcvflorin on January 30, 2012, 08:32:14 am
I commited (created tag) and published version 0.21 which includes an updated doc_url, with a link to the code.mios.com Trac page.

Edit: apps.mios.com plugin ownership given to guessed.
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on January 30, 2012, 11:06:42 pm
Thanks!
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on February 01, 2012, 01:45:01 am
As part of preparing for the release of the SQBlaster Plus, I'm making modifications to the SQBlaster Plugin to handle it's new functionality.

Per the spec sheet published on http://squareconnect.com, the new Blaster will have 5 channels of IR....  one built in (like the original) in addition to 4 individually addressable discrete IR channels.

So far, I've modded my Plugin code to create these 4 extra IR channels, and expose them as extra Devices, with the following characteristics, but I'd like comments on what people are expecting:

a) You still have the original "Parent" device, and it'll show in all the MiOS IrTransmitter dropdowns
b) The new children all have the flags set to force the child devices into the same Room as the Parent blaster, they cannot be moved around
c) The children all have titles of IR Channel 1, ..., IR Channel 4 .. on the assumption that the Parent is IR Channel Main or whatever.
d) These children only appear if you have a SQBlaster Plus (to make it transparent to the 1st generation SQBlaster users)

I think this is all reasonable behavior except, I'm not sure if people think about it being IR Channel 1..4, or IR Channel 2..5, IR Aux Channel 1..4 (etc) since the "Parent" is really the first channel.

I'm leaning towards changing the child titles to IR Aux Channel 1..4, as these are user-changeable anyhow, and relaxing the restriction so these devices can be placed in any room.

Anyone have a strong feeling one way or another?
Title: Re: Luup Plugin: SQBlaster interface
Post by: SquareConnectJohn on February 01, 2012, 03:15:39 pm
Just a note to say that channel 0 is also a true channel, in that if you select channel 1... you will get no IR out of the body of the blaster.. its not Main Channel + selected channel.. its channel 0, 1, 2, 3 OR 4.

You might want to relax the room constraint as there may be needs to cable through to different rooms.

John
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on February 01, 2012, 03:25:54 pm
Just a note to say that channel 0 is also a true channel, in that if you select channel 1... you will get no IR out of the body of the blaster.. its not Main Channel + selected channel.. its channel 0, 1, 2, 3 OR 4.

You might want to relax the room constraint as there may be needs to cable through to different rooms.

John
Hey John,
I'm not worried about the internal representation, as I have that sorted and I understand these channels are not linked in any way.  I'm trying to sort out appropriate labelling/nomenclature that makes sense for a typical user when they see these on the MiOS Dashboard.

Per the picture, a SQBlaster Plus user will get [independent] 5 devices on their Dashboard, and in the related MiOS Dropdown/Picklists.  The first one is effectively Channel "0", then the others represent channel's 1,2,3,4 (Internally, from a Blaster perspective)

I want to ensure that people get the correct idea that "Channel 1" isn't the built in one, since "Channel 0" is kinda a programming construct, more than a user one.  I'm leaning to using labels like IR AUX Channel 1..4 for the extra independent channels

I'll relax the room construct.
Title: Re: Luup Plugin: SQBlaster interface
Post by: ehillis on February 06, 2012, 01:11:12 pm
@guessed
I wondered if you would kindly assist and point me in a proper direction. I am setting up an Add-A-Motor Drapery track and I used SQDesigner, SQremote and SQBlaster and have got control on my iPhone to open and close it. This segment works fine.  I have read all the forum, wiki etc about migrating the info from SQremote to Vera. I was using I-shell tools to perform the conversion but keep getting multiple errors.
I am running Vera 3 (1.5.254) as the target platform. I include the files that SQremote provides in its backup.
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on February 07, 2012, 12:10:48 am
You're going to run into similar problems that @tbever ran into in this conversation:
    http://forum.micasaverde.com/index.php/topic,5734.msg38784.html#msg38784

Short version: MiOS does IR for AV, but not IR for AirCond, or other IR-controlled devices.. but we can work around that a little by "tricking" the conversions to use AV-based IR code mappings per my postings.

in your dev83061496.xml file, change:
a) the SQKeyCode from "0" to "3" when command_name="Close"
a) the SQKeyCode from "0" to "1" when command_name="Open"

Then run your files through the generation process:
    http://forum.micasaverde.com/index.php/topic,5734.0.html

Noting exactly which bits to put into which fields...


I just did this with your original files, without the SQKeyCode modifications I've listed above.  I've attached Step-wise screenshots using your files, and the ones references from source control.  I'll attach the [broken] output in another post, the reason it's broken is because the source devxxxxxxx.xml file from SQRemote has no AV Devices in it....so there's no direct mapping without the hack listed above to "map" these codes to something AV-based in MiOS.

BTW: It would pay to get the SQBlaster lads to add dedicated SQKeyCodes for these non-AV IR devices.  Then I can define a mapping for them to "something" in the AV land.
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on February 07, 2012, 12:16:44 am
... and here is:

a) the source SQRemote file (dev83061496.xml) (Input to Step 1, along with SQBlaster_I.xslt as it's XSLT)
b) the resulting [broken] I_xxx.xml (Output from Step 1, Input to Step 2 along with SQBlaster_D.xslt as it's XSLT)
c) the resulting [broken] D_xxx.xml (Output from Step 2)
Title: Re: Luup Plugin: SQBlaster interface
Post by: ehillis on February 08, 2012, 01:51:02 am
@guessed
Thank you so much for the information and suggestions. I followed them and made the changes and copied the resulting files to vera3 1.5.254. No device or any information shows up. I noticed that no .json file was created and thought that this was odd. It's late for a senior to be up now. Would you have  any thoughts on this. I attach the 2 files.

SQBlaster icon shows UP

Addendum:
I managed to get it working sort off
- added IOdevice to treat UI5 as per the beta discussion. It did not show "open and close" but had entries for "ON" "OFF' and "ON/OFF" found "on" would close it and "ON/OFF" would open it so that's OK. Nobody but me will see what is under the sheets. The Android pads use Home Buddy and the scenes are set up with Open and Close in the names.

Needs to be a reassessment of the whole area of IR control and generation of the Vera files. It would be best if they could be output in the correct structure from SQDesigner and just move them into Vera. This would mean the SQDesigner could target multiple Home Automation Controllers at once or singularly. Just a random thought.

Thanks very much for your able assistance as it turned on the proverbial light bulb and I was able to get my thoughts reordered
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on February 08, 2012, 09:50:35 pm
@ehillis,
They generated correctly.  There is no JSON file, as there's no UI for a IR Device.

This new device will, however, show up in a few places:

a) MiOS Advanced Scenes...
This is where you can put your automation steps.  In my case, I use this to create scenes for things like Turning off the TV in the early AM just in case I left it on, shutting down the TV (and other things) when I Arm the Alarm system, etc, etc.

This is probably the most common use-case for the SQBlaster-Plugin - turning things On or Off.  It sounds like your Use-case is similar (except it's open/close based upon some criteria)

Under Advanced-scenes, you pick the IR Device (whatever you created from the I_xxx.xml and D_xxx.xml files you posted), then you pick the actions you want to execute.  Given your generated files, the ones of interest will be:
    urn:micasaverde-com:serviceId:DiscretePower1
        Off
    urn:micasaverde-com:serviceId:TogglePower1
        OnOff


In hindsight, I probably should have mapped you to DiscretePower1's On and Off, but it doesn't impact the scenario...
I've attached a version of the UI4 UI, but something similar should be available under UI5, at least for these "hand-built" IR Device files.

b) SquareConnect's SQRemote...
It now shows up under SQRemote when you [Assign] an action to a button/control.  Since you already use SQRemote, this doesn't greatly buy you anything, but it will appear.... along with this IR Device's two actions.
Title: Re: Luup Plugin: SQBlaster interface
Post by: ehillis on February 08, 2012, 11:14:27 pm
Thanks for all your help. You are certainly a valuable resource to this forum. I have the open and close scenes all working and tomorrow I will call these scenes inside other scenes which isn't a problem at all.

This was to add control to vera to open and close ADD-A-MOTOR 1000 motorized drapery tracks. Now I have all the motorized drapes and blinds in the house automated. This includes Z-wave ones using ESI controller which are a dream to work with, Hunter-Douglas powerrise 2 blinds and the ADD-A_MOTOR. They are all in automated scenes which are scheduled for sunrise and sunset. Wife really likes them. Now on to the automatic door locks. Fifty years of computer technology and still learning. It's good for me.

Thanks for all. Until next time.................Ted
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on February 08, 2012, 11:42:08 pm
Glad it worked for you. 

I'm about to go down the automated roller-blind path myself, but I'll probably avoid Z-Wave and look at the other options (either bridging an RTS, or using Relay controller), just haven't worked out the right "package" of components just yet...
Title: Re: Luup Plugin: SQBlaster interface
Post by: ehillis on February 08, 2012, 11:58:17 pm
Check out ESI they have just brought out a new motor that seems to have Z-wave built in and the rest is just parts to put them together. It was difficult to find a qualified person to sew the Roman blinds though.
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on February 09, 2012, 12:05:07 am
My longer-term plan is to keep Z-Wave contained to lighting and thermostats, at least until there are better options for Thermostats... which I'm glad we're starting to see, they just need API support  8)

Everything else will be Wired (Ethernet etc) or Wifi, for resilience and better device security.
Title: Re: Luup Plugin: SQBlaster interface
Post by: ehillis on February 09, 2012, 12:25:27 am
Just ordered an RS232/network interface board to interface a full Carrier HRVAC setup to Vera. Got the RS232 commands/responses for the Carrier and chose a RS232 board that someone has set up the interface for in Vera. Lot of work to do to code up the interface but am gradually lining up all the ducks.
Title: Re: Luup Plugin: SQBlaster interface
Post by: manfaiho on April 24, 2012, 12:37:33 pm
I am new user to VeraLite3 and SQConnect Plus. I have tried to follow your previous steps to generate two XML files based on my box.net configuration backup from SQConnectHD to start my test. But I don't know how to upload these XML files into MIOS for the configuration of IR AUX Channel1 device that generated by SQPlugIn. Do we have a step-by-step guideline how to configure it and the procedure how to make necessary XML files and upload it to MIOS so that I can test it by creating approriate scene in MIOS and let my Windows Phone 7 control my IR device over Internet?

I already checked its WIKi from http://code.mios.com/trac/mios_sqblaster# and read through this thread but still have no idea. Sorry for my 101 question. 
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on April 25, 2012, 01:19:52 am
@manfaiho,
It sounds like you've already done step (d.3) from here:
   http://code.mios.com/trac/mios_sqblaster#

If this is the case, then you upload these files to VeraLite using the menu:
    Apps >> Develop Apps >> Luup Files

See attached image.  I've highlighted the relevant section on the right in a green box.  That will move/copy the files onto your Vera box.

After that, you can follow this (albeit from UI4, the principal is the same):
    http://wiki.micasaverde.com/index.php/Install_LUUP_Plugins

That will create an IR Device in Vera from the files you just uploaded.  The last step is to associate these files with the SQBlaster.


If you get stuck, feel free to post the original devxxxxxxx.xml file, your derived I_xxxxxx.xml and D_xxxxxxx.xml files, and a screenshot of how far you got.   I tend to make assumptions about how much people know about this stuff (esp uploading files, which was the norm prior to apps.mios.com and UI5)
Title: Re: Luup Plugin: SQBlaster interface
Post by: manfaiho on April 25, 2012, 09:00:39 am
Thank you so much :-)

I can succesfully uploaded these two XML files into MIOS. But I am not sure how to create the device? Should I go to "Add Device" then select "IR Device" then use "Manual" to create. But it requires me to add "codeset??"....

If I follow the link you provide for UI4 to generate a device, I should go "Develop App" and make the association with these XML files for the device fields. The device can be created but nothing I can control it. Is anywhere I go wrong for the next step? 
Title: Re: Luup Plugin: SQBlaster interface
Post by: manfaiho on April 25, 2012, 09:17:54 am
I think it may be the problem for these two XML files I attached for your review. I only created a learn command to restart my PC using iMon. I can do it in SQ HQ App. I also attache dev file from my box.com for your check. Seems a bit of diffculty for first learner :-)
Title: Re: Luup Plugin: SQBlaster interface
Post by: vascodp on April 27, 2012, 01:53:20 pm
@manfaiho,

I have exactly the same problem.

Everything seems fine when I manually upload the attached D+I files, generated with the XLS files, to create the device, but no IR Transmitter selection is available and no IR actions are shown at scenes/advanced.

Also tried to create a variable IODevice, and managed to associate it with SQ Blaster (or one of it's channels), but still no actions are available under scenes/advanced.



As a workaround, and because I control my IR devices via luup code only (no UI involved), it would be fine if, for example, luup.call_action( "urn:squareconnect-com:serviceId:PlaceHolderAV1", "CHANNEL UP", {}, 73 ) would work, with 73 representing the id of the IR device to be controlled. Unfortunately it doesn't...

To further test the plugin, I tried to use luup.call_action( "urn:micasaverde-com:serviceId:IrTransmitter1", "SendProntoCode", {ProntoCode="code"}, 67 ), with 67 representing the SQ Blaster plugin id. It doesn´t work, until I manually replace "I_SQBlasterController1.xml" by "I_SQBlaster1.xml", as described at http://forum.micasaverde.com/index.php/topic,10251.msg71419.html#msg71419.

Then, I can directly send pronto codes to the blaster, but I still can't address channels 1 to 4, so not even this workaround (of a workaround...) is good enough.


Every minute, my Vera logs the attached information. Not sure what it means...


@guessed, can you help ?
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on May 04, 2012, 10:08:02 am
I think it may be the problem for these two XML files I attached for your review. I only created a learn command to restart my PC using iMon. I can do it in SQ HQ App. I also attache dev file from my box.com for your check. Seems a bit of diffculty for first learner :-)
In your case, the generated files are expected to be called:
     D_SQdev3799787937.xml
     I_SQdev3799787937.xml

You can rename them, as you have, but you'll need to change the reference inside of D_WebCamXP.xml to match.  Currently it has the following reference inside of it:
    <implementationFile>I_SQdev3799787937.xml</implementationFile>
and this would need to be changed to:
    <implementationFile>I_WebCamXP.xml</implementationFile>

otherwise MiOS won't find the matching file correctly when you load it as a Device.
Title: Re: Luup Plugin: SQBlaster interface
Post by: manfaiho on May 04, 2012, 08:11:49 pm
Thank you very much. I changed D_WebCamXP.xml as you recommended but it still failed. I think it may have another problem in creating device. I want to confirm if it is the step I need. In Vera3, I need to go Device->Add Devices then click Add IR Device. It will show infrared device function is not completed then I still click OK button. Select SQBlaster device as infrared transmitter. I think I should only click Manual Setup instead of Guided setup, is it correct? If that, they will ask what codeset I need to use, that's my question I don't know what's this? See my first screen. If I really need to click "Create device" button, I need to fill in this codeset then create A/V device. Is that a correct step to create IR device? If that, then go to this device to configure its settings: SQConnect IP, I and D file name etc as my second screen shoot attached. Then go to the automation-> create scene then click Advance->pick this IR device from my third screen shoot? But I can't find my proper code set ToggetPower as XML pointing. What's wrong for this flow in Vera3? 
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on May 04, 2012, 08:53:06 pm
ok, something seems to be a bit screwy with UI5.  Let me run some tests over the weekend to see if I can isolate why it's going so astray.
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on May 07, 2012, 12:53:03 am
@manfaiho,
After you created the files, what Text editor (and OS) did you use to Save them to disk?

Looking at both the D_ and I_ files, they have a non-Textual leading characters on them.  For the most part, these characters don't show up in a regular editor (0xbb 0xef).  See the screenshot where I show the leading bytes.

I suspect it was Windows, and using a Save-As Character set of UTF-8, which results in these bytes on the beginning.  Anyhow, UI5 is choking on these when it's trying to parse both the D_ and I_ files, so the device itself isn't loading at all.
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on May 07, 2012, 01:12:52 am
Also tried to create a variable IODevice, and managed to associate it with SQ Blaster (or one of it's channels), but still no actions are available under scenes/advanced.

Then, I can directly send pronto codes to the blaster, but I still can't address channels 1 to 4, so not even this workaround (of a workaround...) is good enough.

Every minute, my Vera logs the attached information. Not sure what it means...


@guessed, can you help ?
Actually yours is a different problem.  In your case, the entire devxxxxxxx.xml file appears to be "Learnt".  Normally I'm used to seeing these files with a standardized SQKeyCode attribute attached to each of the command_info blocks.  I key off this to create the corresponding map to the MiOS IR stuff.

Historically, all of the stuff I get from SquareConnect SQRemote comes in this form:

  <command_info command_name="POWER TOGGLE" SQKeyCode="1" ir_data="0000 006C 0000 000C 000C 0019 0018 0019 0018 0019 0018 000D 000C 0019 0018 0019 000C 000D 000C 000D 0018 0019 0018 000D 000C 0019 000C 0D4D" source_id="1" SQSource="L" UEIDeviceType="T" support_ph="true" repeat_count="0"/>

but in your case, even for the standardized command_info records (like POWER TOGGLE), they're all coming through with a SQKeyCode='0' like this:

  <command_info command_name="POWER TOGGLE" SQKeyCode="0" ir_data="0000 006C 0000 000C 000C 0019 0018 0019 0018 0019 0018 000D 000C 0019 0018 0019 000C 000D 000C 000D 0018 0019 0018 000D 000C 0019 000C 0D4D" source_id="1" SQSource="L" UEIDeviceType="T" support_ph="true" repeat_count="0"/>

For "standard" stuff, there's a long/unique list of these SQKeyCode values that I'm using, and I simply ignore the command_name, since that's normally an arbitrary string.

I'll send a note to Mat & John to see if he can tell me why they're not filling in the SQKeyCode for these learned codes.  If they can't do it, I might be able to add a backup mapping in to handle a few of these cases.
Title: Re: Luup Plugin: SQBlaster interface
Post by: manfaiho on May 07, 2012, 01:30:54 am
Thank you very much  ;) yes, I have used windows 7 and just a simple notepad to paste the converted XML from the conversion site mentioned above. As I am not a developer and know nothing about XML stuff, any simple and good xml XML you can suggest that I can paste it into so as to avoid these leading characters. Besides, what's wrong for the steps I created the device in vera3?
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on May 07, 2012, 01:45:23 am
@manfaiho,
Might be a thing specific to Windows7 version of Notepad.  I just tried using the WinXP version, and it saved as a .txt file without any extra leading bytes.  I don't have access to a Windows7 box...

When you do SaveAs, are you given options at the bottom to select the Character Set?  If so, you might have an option for "ASCII" or "Latin-1" or "ISO-8859-1".

I do most of the work on a Mac, or on Linux directly, so I don't tend to see these things as I'm working with plain-text editors, not GUI and/or WYSIWYG ones that can interfere with the raw format.
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on May 07, 2012, 08:26:45 am
@vascodp,
Did the device get created via SQDesigner or SQRemote?  Also any more detail on how it was created (what selections etc) would be useful.
Title: Re: Luup Plugin: SQBlaster interface
Post by: vascodp on May 12, 2012, 07:04:47 pm
@Guessed,

I allways prefer to create IR devices from scratch than to use existing databases, independently of the sw I'm using...

So, using SQ Designer (not SQ Remote), I select "Add New (Empty) Device" -> "Manage IR Commands", select a pre-defined command name (eg: POWER TOGGLE), then "Add New Command".

Then, I copy my Pronto Codes (either learned with my old USBUIRT or Phillips Pronto remote) to "Paste / Replace IR Code (Pronto Hex)" and finally hit "Update Command", repeating the process for each button.

That should explain the SQKeyCode="0", but everything works fine at SQ Designer's level, where all commans can be successfully tested. When I download the configuration to my iPad, I have to re-assign my buttons to a device, but I already asked for support from Square Connect.

Should it make a difference If I add a device from the SQ Designer database, select a code set and then change the non-functional commands only (using learned codes) ? I could live with that...

Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on May 12, 2012, 08:09:06 pm
@vascodp,
Ok, thanks for the confirmation.  John mentioned that SQDesigner [currently] did that for stuf manually registered in the manner you've described.    He noted that it should be filling in the SQKeyCode's as well, and that it's a bug that it doesn't currently do that.

I'll re-work the XSLT routines to handle both cases as I'm not sure when SQDesigner will get the required fixes.

I've gotta drag out the API doc so I can make & test the new map with a "fallback" dependency on the command_name values.  I'll publish that as soon as I can.
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on May 12, 2012, 10:09:35 pm
@vascodp,
I've checked in new SQBlaster_I.xsl and SQBlaster_D.xsl files that handle this case.  I used them against your source dev469368230.xml file to create the attached files.

Note that there's 3 missing mappings, so these will show up with "Placeholder" in the I_SQdev469368230.xml file.

I did a quick-test against UI5 to see that the Advanced-scenes was showing all the various callouts.
Title: Re: Luup Plugin: SQBlaster interface
Post by: vascodp on May 14, 2012, 07:09:47 pm

@Guessed,

I created the IR device using the .xml files generated by your new .XLSs.

First, I didn't have to manually create the "IODevice" variable, as before. Not sure if it's related with the new files ...?

Second, the remote's keys (except for the 3 missing ones) are now available at Scenes -> Advanced, and work fine when the IR device is associated to SQ Blater's channel 0 (the blaster itself).

However, no commands are sent when the IR Device is associated with SQ Blaster's channel 1..4. The led does not flash, as if I send commands from SQ Remote to a specific channel directly. Also, luup.call_action( "urn:micasaverde-com:serviceId:IrTransmitter1", "SendProntoCode", {ProntoCode="code"}, <SQ Blaster transmitter id> ) doesn't work. Any clue ?

Thanks a lot for your efforts,
Vasco
Title: Re: Luup Plugin: SQBlaster interface
Post by: blargyblarg on May 15, 2012, 06:02:12 am
UPDATE: The below only seems to apply to the UI5 "app" version of the plugin, which seems to be using trunk code. Installing 0.3 manually seems to work all right (but sending out AUX channels still doesn't work). See the post below for the AUX fix.

Thought I'd mention that plugin support for the SQBlaster Plus seems to be incredibly broken.

If you haven't uploaded a PackageDevices.xml file (which isn't mentioned in the instructions), controllerStartup fails and the plugin never readies.

If you upload a PackageDevices.xml file, the plugin tries to synchronize your devices. Unfortunately, it thinks that the SQBlaster Plus temperature sensor and aux ports are devices which have been removed --- so it deletes them. This causes the LUUP to crash and die in an infinite loop.

I removed the sync code altogether, and the plugin is still mostly broken. Sending codes to the core unit works, but sending to the AUX ports does not. All of the AUX ports are instances of S_IrTransmitter1.xml, which has no implementation of SendProtoCode. This means the AUX ports have no instructions to send codes, and thus, sending codes to the AUX ports fails.

I've cobbled together some nasty hacks to make it work for me, but hopefully a fix will come down the line eventually.
Title: Re: Luup Plugin: SQBlaster interface
Post by: blargyblarg on May 15, 2012, 07:14:37 am

However, no commands are sent when the IR Device is associated with SQ Blaster's channel 1..4. The led does not flash, as if I send commands from SQ Remote to a specific channel directly.

Open I_SQBlaster1.xml, search for S_IrTransmitter1.xml, and replace it with I_SQBlaster1.xml

Then, reupload the file and reload.
Title: Re: Luup Plugin: SQBlaster interface
Post by: vascodp on May 15, 2012, 04:10:51 pm
@blargyblarg

Yeeeeeah, it works !!!  I can finally address SQ Blaster's individual channels.

Thanks,
vascodp

Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on May 16, 2012, 01:07:10 am
I can't test it at the moment, but this should do the same thing:
    http://code.mios.com/trac/mios_sqblaster/changeset/46/?format=zip&new=46

The change involves is similar to @blargyblarg's, but instead completely removes the "S_IrTransmitter1.xml" parameter from both luup.chdev.append() calls, passing "" instead, and defining the <handleChildren> element in the D_SQBlaster1.xml file to instruct it to call the parent device code when needed.

Not sure why the original was working on UI4, which is where I tested it, and not under UI5.  Once I restore my SQBlaster+ unit, and test it under UI5, I'll push the above changes more formally to apps.mios.com.
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on May 25, 2012, 02:39:50 am
These changes, along with the one for Temperature in Celsius, have been pushed to apps.mios.com tonight.  They're pending approval, but will be automatically deployed once they're approved (to UI5 users)

For UI4 Users, there's a new TAG (0.32) that has the revised files also:
    http://code.mios.com/trac/mios_sqblaster/browser/tags/0.32

The ZIP download link is at the bottom of that page, with the link:
    http://code.mios.com/trac/mios_sqblaster/changeset/48/tags/0.32?old_path=%2F&format=zip
Title: Re: Luup Plugin: SQBlaster interface
Post by: santoal on June 03, 2012, 10:18:05 am
Hi
I've been trying to follow this thread and resolve my issue but with no success. Like above, I can add devices by the commands do not appear on the advanced tab when creating a scene. Sometimes I get the error "Invalid Json for device..."
Details below...
Device: 12 V LED dimmers with IR Remote

Imported xml files from SQ Remote and used XSLT to transform resulting with the attached files. All commands are learnt with SQKeyCode = "0" (not sure if this is the issue).

IR Transmitter plugin works ok in Mios UI4 having added Samsung remote successfully from online catalogue.

Using notepad in Windows 7 with save as "ANSI".

Any hep appreciated. Thanks
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on June 03, 2012, 10:56:52 am
@santoal,
It looks like all of the codes in the original dev569779581.xml file are learned.  In this case, all will have SQKeyCode=0, and there's no obvious way to provide a mapping.

When there's no mapping, I put them all into a "Placeholder" ServiceId called urn:squareconnect-com:serviceId:PlaceHolderAV1.  There are only mappings for AV gear, since that's the interface that MiOS provides for IR-based stuff.

You'll see that in the I_LEDRemote.xml has a bunch of these. 

If you want to try something basic, you can manually map the 0%/100% codes to something like DiscretePower1's Off/On actions. 

In the I_LEDRemote.xml, for 100%, this would look like:
Code: [Select]
    <action>
      <serviceId>urn:micasaverde-com:serviceId:DiscretePower1</serviceId>
      <name>On</name>
      <sqblaster command_name="POWER ON" SQKeyCode="2"/>
      <ir>L1b 11800 d2832425 55555554 44444445 44545554 55454441 30823000 L1b 11800 d3832425 55555554 44444445 44545554 55454441 30823000 </ir>
    </action>

And you'd need to add the following to the D_LEDRemote.xml file:
Code: [Select]
      <service>
        <serviceType>urn:micasaverde-com:service:DiscretePower:1</serviceType>
        <serviceId>urn:micasaverde-com:serviceId:DiscretePower1</serviceId>
        <SCPDURL>S_DiscretePower1.xml</SCPDURL>
      </service>
Title: Re: Luup Plugin: SQBlaster interface
Post by: santoal on June 04, 2012, 11:06:41 am
Thanks... that has worked perfectly for the 100%.
Where can I find a list of standard AV functions for mapping other learned commands?
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on June 04, 2012, 11:15:55 am
The definitions are scattered inside the various S_*.xml files on your Vera unit.  Probably the easiest way to see some of the more common ones are to look at the source code of a few AV Plugins on http://code.mios.com

The S_*.xml define the ACTION names to use, but you have to glean the ServiceId's from other files.  It's a bit painful (no real doc here either) so it's sometimes easier to look at the working examples.  The downside is that they don't always exercise all of the potential ACTIONS from each of the S_*.xml files, just the common ones.
Title: Re: Luup Plugin: SQBlaster interface
Post by: vascodp on June 12, 2012, 09:01:10 am

My Vera got unstable, so I took a look at the logs and found two issues (among others) related with the Sonos plugin:
 
1. Every minute, the plugin logs several messages (log1.txt), but one of those has log level 1, so I guess it's an error. However, It's not explicit enough, so I don't know what it means... Is there something wrong with my configuration ? Is it due to the temperature being reported in fareneight ?
 
2. Plugin #188 fails to load. After rebooting, UI5 shows "Loading plugin #188" for a minute. The log shows the associated error. According to http://forum.micasaverde.com/index.php/topic,9052.msg59279.html#msg59279 It doesn't seem to be required at UI5, but the instructions for it's removal refer to a hidden plugin, and my SQ Blaster plugin, as well as the 4 independent IR channel plugins (using S Blaster plus) are visible at the interface. Should I remove as explained under the refered link ?

@guessed, is the new changeset, published at May 24, already avaliable ?
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on June 12, 2012, 09:22:45 am
The latest code samples the blaster every minute, to get Temperature readings from SQBlaster+ models.  This is logged at log level 1, not for any valid reasoning other than I like it to stand out in the logs ;)

You don't mention the specifics of what your seeing wrong, so I can't tell if it's this, or something else.



#188 is a long standing issue wit the SQRemote Plugin that MCV didn't automatically cleanup during UI5 upgrade.  It's benign and, in theory, can be cleaned up using a technique that @mcvflorin posted in one of the threads here.  I'm waiting for them to automatically clean it up, as CTs shouldn't have to do that upon product upgrade.

I can't tell If the 0.32 build is in apps.mios.com, as the site is erroring with a full screen SQL syntax error (no testing?)

 I suspect it is there, I just can't check it right now.
Title: Re: Luup Plugin: SQBlaster interface
Post by: drag0n on June 12, 2012, 03:26:34 pm

Should I remove as explained under the refered link ?

To get rid of the plugin #188 error message, you have to search and delete  the SQ Remote device (which is hidden), not the SQ Blaster devices which are visible and should remain intact.
http://forum.micasaverde.com/index.php/topic,9052.msg59279.html#msg59279
Title: Re: Luup Plugin: SQBlaster interface
Post by: vascodp on June 14, 2012, 06:16:35 pm

@guessed, I see nothing wrong with the plugin, except that the log level is 1. Besides, you deserve to stand out in the logs every minute  ;)

@dragon, guessed, my mistake for confusing SQ Remote with SQ Blaster. I used mcvflorin's technique and got rid of it  :D


Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on June 14, 2012, 11:41:01 pm
@guessed, I see nothing wrong with the plugin, except that the log level is 1. Besides, you deserve to stand out in the logs every minute  ;)
I've made mods to the code to move messages into better buckets. 

50 ... SQBlaster: ... Startup, and the periodic updates go into level=50
35 ... SQBlaster: ... debug: Debug now go into level=35
01 ... SQBlaster: ... error: Errors go into an error level=1 (red)

The periodic processing now goes into level 50, the first bucket, so they won't be red anymore, but they are still emitted.
Errors, like not being able to contact the SQBlaster are now errors, and will appear red in the log files.

When  we have a reasonable set of changes to bundle, these will be put into apps.mios.com (etc) but for now they're just untested in trunk.
Title: Re: Luup Plugin: SQBlaster interface
Post by: Weeves on May 01, 2013, 10:11:57 am
New to this, but am I right in thinking that if you parsed the devxxx.xml file into D_xxx.xml, I_xxx.xml and S_xxx.xml, and linked them correctly inside, you would end up with a device that exposed services for all IR codes in the devxxx file (and no extras)?

If so, what would be the disadvantage against using the "standard" service interfaces?
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on May 01, 2013, 11:12:58 am
New to this, but am I right in thinking that if you parsed the devxxx.xml file into D_xxx.xml, I_xxx.xml and S_xxx.xml, and linked them correctly inside, you would end up with a device that exposed services for all IR codes in the devxxx file (and no extras)?

If so, what would be the disadvantage against using the "standard" service interfaces?
More or less, except I don't create the S_xxx.xml file, it would be pointless since Vera's UI is really just for setup, not for use (in practice)

By implementing MCVs AV/IR services, control points can know what to expect when calling the device.  Right now, SQRemote and the built in HTML/Image one are the only control points that do, but it means they can pickup and work with the Devices directly.

Like anything, you can always go custom, but then the control points won't know how to call you.  It be akin to everyone building their own 'switch' service, no one would be able to call it.
Title: Re: Luup Plugin: SQBlaster interface
Post by: Pestus on May 29, 2013, 12:46:22 pm
Hello all.  I've been using the Vera for lighting, locks, alarm and HVAC for awhile now.  Thanks to help from Guessed and his fantastic drivers, I've got a great platform.

My next project is integrating audio/visual.  I've been looking at the SQ Blaster Plus, and I am pleased to see so much activity on this forum in regards to custom setups and troubleshooting.

My main question is the disturbing lack of Android support for the native apps.  I note the presence of aftermarket apps made by other people..  but is an apple handheld mission critical to use or install this device properly?  Will I lose any functionality or whatnot if I don't use the first party iOS apps?  I'd rather not spend the many hours and the money to learn the system, if I'd be limited by OS support.

My second question is I can't seem to find a database of compatible IR devices.  I'm looking for a cheap media box that has XBMC support.  I'm considering something like the G-Box Midnight MX2, or the Ouya if they ever get their act together. (And someone comes up with an IR dongle arrangement)  Anyone know how the IR support is for some of the newer more exotic computers?

Thanks in advance!
Title: Re: Luup Plugin: SQBlaster interface
Post by: Ruetech on September 19, 2015, 07:12:08 pm
Can someone please point me towards the xls files that I'm supposed to run through the transform process with my xml files for the devices. When I try to follow the links it says they are private and I need to login. Thanks in advance.
Title: Re: Luup Plugin: SQBlaster interface
Post by: guessed on September 20, 2015, 11:18:32 am
http://forum.micasaverde.com/index.php?topic=29848.0