Luup Plugin: SQBlaster interface

In your case, the generated files are expected to be called:
[tt] D_SQdev3799787937.xml
I_SQdev3799787937.xml
[/tt]
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:
[tt] I_SQdev3799787937.xml[/tt]
and this would need to be changed to:
[tt] I_WebCamXP.xml[/tt]

otherwise MiOS won’t find the matching file correctly when you load it as a Device.

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?

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.

@manfaiho,
After you created the files, what Text editor (and OS) did you use to Save them to disk?

Looking at both the [tt]D_[/tt] and [tt]I_[/tt] files, they have a non-Textual leading characters on them. For the most part, these characters don’t show up in a regular editor ([tt]0xbb 0xef[/tt]). 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 [tt]D_[/tt] and [tt]I_[/tt] files, so the device itself isn’t loading at all.

[quote=“vascodp, post:60, topic:167682”]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 ?[/quote]
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 [tt]SQKeyCode[/tt] attribute attached to each of the [tt]command_info[/tt] 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:

[tt] <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”/>[/tt]

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

[tt] <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”/>[/tt]

For “standard” stuff, there’s a long/unique list of these [tt]SQKeyCode[/tt] values that I’m using, and I simply ignore the [tt]command_name[/tt], 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 [tt]SQKeyCode[/tt] 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.

Thank you very much :wink: 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?

@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.

@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.

@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…

@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 [tt]command_name[/tt] values. I’ll publish that as soon as I can.

@vascodp,
I’ve checked in new [tt]SQBlaster_I.xsl[/tt] and [tt]SQBlaster_D.xsl[/tt] files that handle this case. I used them against your source [tt]dev469368230.xml[/tt] file to create the attached files.

Note that there’s 3 missing mappings, so these will show up with “Placeholder” in the [tt]I_SQdev469368230.xml[/tt] file.

I did a quick-test against UI5 to see that the Advanced-scenes was showing all the various callouts.

@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”}, ) doesn’t work. Any clue ?

Thanks a lot for your efforts,
Vasco

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.

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

Then, reupload the file and reload.

@blargyblarg

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

Thanks,
vascodp

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 “[tt]S_IrTransmitter1.xml[/tt]” parameter from both [tt]luup.chdev.append()[/tt] calls, passing “” instead, and defining the [tt][/tt] element in the [tt]D_SQBlaster1.xml[/tt] 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.

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

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

@santoal,
It looks like all of the codes in the original [tt]dev569779581.xml[/tt] file are learned. In this case, all will have [tt]SQKeyCode=0[/tt], and there’s no obvious way to provide a mapping.

When there’s no mapping, I put them all into a “Placeholder” ServiceId called [tt]urn:squareconnect-com:serviceId:PlaceHolderAV1[/tt]. 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 [tt]I_LEDRemote.xml[/tt] 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 [tt]I_LEDRemote.xml[/tt], for 100%, this would look like:

<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 [tt]D_LEDRemote.xml[/tt] file:

<service> <serviceType>urn:micasaverde-com:service:DiscretePower:1</serviceType> <serviceId>urn:micasaverde-com:serviceId:DiscretePower1</serviceId> <SCPDURL>S_DiscretePower1.xml</SCPDURL> </service>

Thanks… that has worked perfectly for the 100%.
Where can I find a list of standard AV functions for mapping other learned commands?