Author Topic: Luup Plugin: SQBlaster interface  (Read 32160 times)

Offline guessed

  • Master Member
  • *******
  • Posts: 5294
  • Karma: +90/-22
  • Release compat is not a bolted-on afterthought
Re: Luup Plugin: SQBlaster interface
« Reply #15 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.

Offline IamLegend

  • Newbie
  • *
  • Posts: 18
  • Karma: +0/-0
Re: Luup Plugin: SQBlaster interface
« Reply #16 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 :)

Offline z-waver.ru

  • Newbie
  • *
  • Posts: 13
  • Karma: +0/-0
Re: Luup Plugin: SQBlaster interface
« Reply #17 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

Offline guessed

  • Master Member
  • *******
  • Posts: 5294
  • Karma: +90/-22
  • Release compat is not a bolted-on afterthought
Re: Luup Plugin: SQBlaster interface
« Reply #18 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.

Offline guessed

  • Master Member
  • *******
  • Posts: 5294
  • Karma: +90/-22
  • Release compat is not a bolted-on afterthought
Re: Luup Plugin: SQBlaster interface
« Reply #19 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.

Offline fall-line

  • Beta Testers
  • Full Member
  • *****
  • Posts: 248
  • Karma: +1/-0
Re: Luup Plugin: SQBlaster interface
« Reply #20 on: April 18, 2011, 01:17:53 pm »
Looking good - thank you again for all the work you have put into this @guessed.

Offline SquareConnectMat

  • Moderator
  • Full Member
  • *****
  • Posts: 248
  • Karma: +0/-0
Re: Luup Plugin: SQBlaster interface
« Reply #21 on: April 19, 2011, 02:39:59 am »
@guessed,

And a heartfelt thanks from us too...

Mat

Offline z-waver.ru

  • Newbie
  • *
  • Posts: 13
  • Karma: +0/-0
Re: Luup Plugin: SQBlaster interface
« Reply #22 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).

Offline guessed

  • Master Member
  • *******
  • Posts: 5294
  • Karma: +90/-22
  • Release compat is not a bolted-on afterthought
Re: Luup Plugin: SQBlaster interface
« Reply #23 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.

Offline tbever

  • Sr. Newbie
  • *
  • Posts: 40
  • Karma: +0/-0
Re: Luup Plugin: SQBlaster interface
« Reply #24 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.
« Last Edit: April 23, 2011, 01:46:16 am by tbever »

Offline guessed

  • Master Member
  • *******
  • Posts: 5294
  • Karma: +90/-22
  • Release compat is not a bolted-on afterthought
Re: Luup Plugin: SQBlaster interface
« Reply #25 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.

Offline SquareConnectMat

  • Moderator
  • Full Member
  • *****
  • Posts: 248
  • Karma: +0/-0
Re: Luup Plugin: SQBlaster interface
« Reply #26 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


Offline tbever

  • Sr. Newbie
  • *
  • Posts: 40
  • Karma: +0/-0
Re: Luup Plugin: SQBlaster interface
« Reply #27 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.

Offline guessed

  • Master Member
  • *******
  • Posts: 5294
  • Karma: +90/-22
  • Release compat is not a bolted-on afterthought
Re: Luup Plugin: SQBlaster interface
« Reply #28 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.

Offline tbever

  • Sr. Newbie
  • *
  • Posts: 40
  • Karma: +0/-0
Re: Luup Plugin: SQBlaster interface
« Reply #29 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?