We have moved at community.getvera.com

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

Offline guessed

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

Offline manfaiho

  • Jr. Member
  • **
  • Posts: 70
  • Karma: +0/-0
Re: Luup Plugin: SQBlaster interface
« Reply #61 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? 

Offline guessed

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

Offline guessed

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

Offline guessed

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

Offline manfaiho

  • Jr. Member
  • **
  • Posts: 70
  • Karma: +0/-0
Re: Luup Plugin: SQBlaster interface
« Reply #65 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?

Offline guessed

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

Offline guessed

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

Offline vascodp

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


Offline guessed

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

Offline guessed

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

Offline vascodp

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

Offline blargyblarg

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: Luup Plugin: SQBlaster interface
« Reply #72 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.
« Last Edit: May 15, 2012, 06:46:06 pm by blargyblarg »

Offline blargyblarg

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

Offline vascodp

  • Sr. Newbie
  • *
  • Posts: 41
  • Karma: +0/-0
Re: Luup Plugin: SQBlaster interface
« Reply #74 on: May 15, 2012, 04:10:51 pm »
@blargyblarg

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

Thanks,
vascodp