Author Topic: SQ Blaster Plugin for Vera - Almost Working  (Read 15722 times)

Offline chixxi

  • Hero Member
  • *****
  • Posts: 1036
  • Karma: +37/-14
SQ Blaster Plugin for Vera - Almost Working
« on: November 18, 2011, 08:21:23 am »
Hello Everybody.

I am using a Vera2 and a SQ Blaster remote, both controlled by the SQ Remote HD App. My target now is to send commands to the SQ Remote by running a scene on the Vera. The SQ Remote Plugin is installed and everything seems to work, if a scene is activated the the SQ Blaster blinks, but the TV shows no reaction.

Here is what I did in detail:

1. I Am using a Vera2 running on the Beta Firmware 1.1.1338. The following plugins are installed: dataMine, Ping Sensor, Generic IP Camera, Google Weather, Smart Phone Web Interface. The SQ Blaster is running on the Firmware A079.

2. I installed this plugin according to this procedure.

3. I created a device using the both files from the plugin D_SQBlaster1.xml and I_SQBlaster1.xml and called the device "SQ Blaster". In the Advanced-Tab of this device I entered the IP of my SQ Blaster. This seems to work fine since the device is shown as "up" and all information's about the SQ Blaster are shown.

4. According to this procedure I then created the two files D_SQdev1073736426.xml and I_SQdev1073736426.xml out of the SQ Blaster Backup from box.net. All three files are attached to this post.

5. I then created a new device to represent my TV using the two files created in step 4 and called in "Sony Bravia". In the tab "Settings" of this device I added the SQ Blaster as it's infrared transmitter.

6. Then I created a scene and in the tab "Advanced" added a step "Sony Bravia - Toggle OnOff".

Now if I run the scene the SQ Blaster blinks, so something seems to be sent, but the TV shows no reaction at all. When I use the SQ Blaster App on the iPhone everything works just perfectly. So I thought the wrong Pronto Code might be send, but by using "http://192.168.x.xxx/cgi-bin/cmh/log.sh?Device=LuaUPnP" I found that the pronto code which is sent is exactly the one which is also in the file dev1073736426.xml and I_SQdev1073736426.xml, basically the correct one:

Code: [Select]
02 11/17/11 18:30:45.012 LOG_CHECK_MEMORY_LEAK pMem start 0xa2a000 now 0xa4a000 last 0xab0000 leaked 131072 <0x803>
02 11/17/11 18:31:00.824 UPnPCallbackEventHandler 0 start PIDLOG2 23279 <0x2c0c>
08 11/17/11 18:31:00.824 JobHandler_LuaUPnP::HandleActionRequest device: 0 service: urn:micasaverde-com:serviceId:HomeAutomationGateway1 action: RunScene <0x2c0c>
08 11/17/11 18:31:00.825 JobHandler_LuaUPnP::HandleActionRequest argument SceneNum=15 <0x2c0c>
08 11/17/11 18:31:00.826 Scene::RunScene running 15 DREAM <0x2c0c>
08 11/17/11 18:31:00.826 JobHandler_LuaUPnP::HandleActionRequest device: 41 service: urn:micasaverde-com:serviceId:TogglePower1 action: OnOff <0x2c0c>
08 11/17/11 18:31:00.827 JobHandler_LuaUPnP::HandleActionRequest device: 36 service: urn:micasaverde-com:serviceId:IrTransmitter1 action: SendProntoCode <0x2c0c>
08 11/17/11 18:31:00.828 JobHandler_LuaUPnP::HandleActionRequest argument ProntoCode=P6501 802c 4a32 dbaa dc4d dd2c a526 3d20 427f 8cc4 0f67 d291 9f35 bff7 d926 dda7 137d eb0b ac1e eba4 fd0d 8a2b 872c e5aa 4772 7189 036c b892 7b93 8c96 7836 00af   <0x2c0c>
50 11/17/11 18:31:00.860 luup_log:36: Web request returned status=200 response=
in 0ms <0x2c0c>

Now I don't know what else to do. Did I miss a step in the installation procedure? Did anyone of you have similar problems? Can you help me analyse the log, although it seems right to me? Are the attached files correct or do I need to adjust them?

Any ideas are greatly appreciated, thanks so much for your help!



P.S: Thank you very very very much @guessed for creating the plugin and providing all these information's to this community!
« Last Edit: January 05, 2015, 12:50:37 pm by guessed »
Developer of Plugins: Virtual Switch, Variable Container, Popcorn Hour Remote, Vacation Ghost. => PLUGINS HAVE BEEN UNPUBLISHED BY ME.

Offline guessed

  • Master Member
  • *******
  • Posts: 5300
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: SQ Remote Plugin for Vera - Almost Working
« Reply #1 on: November 18, 2011, 10:24:49 am »
Ok, you've managed to stump me.  The generated files look correct, and the snippet of log file is showing it being passed through as well as a valid response status.

Have you tried other codes, ones like discrete on/off or. Volume perhaps?

If they don't work I'll have to ping Mat and see if he can help.  My Pucks are running older firmwares, but I doubt they changed any thing material.


Btw: Thanks for the detailed outline, it captures a perfect amount of information, and is well written.

Offline chixxi

  • Hero Member
  • *****
  • Posts: 1036
  • Karma: +37/-14
Re: SQ Remote Plugin for Vera - Almost Working
« Reply #2 on: November 21, 2011, 09:58:55 am »
First off all, thank you for taking the time to go through this!

Yes, I have tried other pronto codes. I have even tried other devices (dreambox) with other codes, the result is always the same: Log from Vera shows correct codes are sent, SQ Blaster is Blinking, but devices are not reacting.

The next step is going to be a complete re installation of the plugin an its according devices. Since the steps of converting are not very specificly noted I kind of messed around till I figured out how to do that, so I want to make sure everything is installed straight and clean. I will let you know about the results during this week.

To be honest, I wanted to try this that weekend, but the release of Minecraft 1.0.0 keept me from doing anything smart.  8)

Is it possible to send codes via http directly to the SQ Blaster? As you can with the following example through Vera?:
http://192.168.x.xxx:49451/data_request?id=lu_action&DeviceNum=202&serviceId=urn:micasaverde-com:serviceId:DiscretePower1&action=On

« Last Edit: November 21, 2011, 10:02:48 am by chixxi »
Developer of Plugins: Virtual Switch, Variable Container, Popcorn Hour Remote, Vacation Ghost. => PLUGINS HAVE BEEN UNPUBLISHED BY ME.

Offline SquareConnectMat

  • Moderator
  • Full Member
  • *****
  • Posts: 248
  • Karma: +0/-0
Re: SQ Remote Plugin for Vera - Almost Working
« Reply #3 on: November 21, 2011, 12:52:49 pm »
@Chixxi,

Sony codes (and many otehrs) require multiple 'repeats' for them to actually control a device. In SQRemote, we have two modes of blasting: 'press and hold' and macro mode. Press and hold emulates a traditional hard remote and will send the initial 'start IR command followed by multiple 'repeat commands' unitl you lift your finger off the button. In macro mode, you specifiy the number of repeats you want to be sent. Typically 3 to 5 is a good number, if your device needs a repeat. By default, SQRemote uses press and hold (it can be changed in the device configuration) fro buttons and macro mode when used in SQRemote macros.

I believe Guessed's plugin uses macro mode so when you use @Guessed's plug in, you must make sure you are also specifying the right number of repeats.. The best way to way to find out the number of repeats you need for a particular device and codeset is to use SQDesigner and try the various combinations from within that app. I find the best way to manage the IR devices and device files is through SQDesigner.

Hope this helps....

Let me know ifg it doesnt.

Regards,


Mat


Offline chixxi

  • Hero Member
  • *****
  • Posts: 1036
  • Karma: +37/-14
Re: SQ Remote Plugin for Vera - Almost Working
« Reply #4 on: November 22, 2011, 03:36:06 am »
@Mat:
WOW that sounds interesting! I tried very shortly yesterday afternoon and I realized that if I run a macro from the SQ Blaster App the result is the same as if
a command is sent by the Vera: SQ Blaster blinking but no reaction from device. Then I run out of time, I am going to try adding "repeats" in the macro till it works tonight and give you an update right away. Thank you!

@guessed:
So once i figured out the number of repeats necessary, where could I specify that in the Vera devices? I guess it should be added to the file I_SQdev1073736426.xml, but how?
Developer of Plugins: Virtual Switch, Variable Container, Popcorn Hour Remote, Vacation Ghost. => PLUGINS HAVE BEEN UNPUBLISHED BY ME.

Offline guessed

  • Master Member
  • *******
  • Posts: 5300
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: SQ Remote Plugin for Vera - Almost Working
« Reply #5 on: November 22, 2011, 10:26:08 am »
There's no mechanism in MiOS to specify repeats against their IR stuff.

A few potential alternatives.  The first is to copy/paste the code multiple times within the I_ declaration.  It's just a sequence of bytes to be transmitted so a few more copies shouldn't hurt.

The second is that Mat mentioned this is a problem
With Pronto codes but not with UEI codes that SQRemote can also use.  To do this you'd have to pick the UEI code based Sony device in the SqRemote interface instead of the Pronto code based one.

Offline chixxi

  • Hero Member
  • *****
  • Posts: 1036
  • Karma: +37/-14
Re: SQ Remote Plugin for Vera - Almost Working
« Reply #6 on: November 23, 2011, 02:40:09 am »
Yeahhhh it's working! Thank you @guessed! Thank you @mat!  :-*

I first tried to add the Pronto Codes to the I_Declaration multiple times, without success. And to be honest it seemed kind of an unclean solution to me so I didn't like it.

Then I went for the UEI Code solution. I have not realized anything about beeing able to choose different kind of codes in the SQ Remote App, but of course you were right and after about one hour of searching I addded a new device based on UEI codes. Using the same procedure mentioned in my first post in this thread I the created my new I_*.file and D_*.file and added a new device to the Vera using those files. All files are attached to this post. An this works! The UIE codes sent by Vera Scenes arrive at the SQ Blaster and the TV reacts according to it.

But one new Problem occurred:

In the Vera the commands to change the Inputs are completely missing, they are just not available in the drop down list when you want to add steps to a scene. But in the I_SQdev4285574198.xml they are specified. For example the code "VID6,AV2,VDP,DVD,DVI" in line 356 is the code for choosing HDMI3. I figured that out by using the direct commands from the iPhone SQ Remote App.

I thought it could be that the commas in the device names are confusing the Vera, i removed them, re uploaded the I_SQdev4285574198.xml. No success, still no possibility to choose "VID6AV2VDPDVDDVI".

Then I saw that in the line 355 "urn:squareconnect-com:serviceId:PlaceHolderAV1" the command is added to the section "PlaceHolderAV1", since I couldn't see this section in the drop down at all I thought it might be smart to change this to "Misc1" since all the commans which are added to "Misc1" are actually shown in the drop down list. No success, still not being able to choose this command in the commad list.

Now I just realized that compared to the files I uploaded in the first post in the D_*.file I am missing the lines:
Code: [Select]
      <service>
        <serviceType>urn:micasaverde-com:service:InputSelection:1</serviceType>
        <serviceId>urn:micasaverde-com:serviceId:InputSelection1</serviceId>
        <SCPDURL>S_InputSelection1.xml</SCPDURL>
      </service>

But now it's getting way over my understanding of this plugin. Do I need to add that section? How to the D_*.file and the S_InputSelection1.xml (which is already available in the Vera) play together or connect? How can I make the command "VID6,AV2,VDP,DVD,DVI" show up as HDMI3 in the drop down list on the Vera?
Developer of Plugins: Virtual Switch, Variable Container, Popcorn Hour Remote, Vacation Ghost. => PLUGINS HAVE BEEN UNPUBLISHED BY ME.

Offline chixxi

  • Hero Member
  • *****
  • Posts: 1036
  • Karma: +37/-14
Re: SQ Remote Plugin for Vera - Almost Working
« Reply #7 on: November 23, 2011, 04:00:53 am »
I just figured out that the file "SQBlaster_I.xls" provided by guessed to transform the file dev4285574198.xml into the file I_SQdev4285574198.xml is not able to recognize a command named "VID6,AV2,VDP,DVD,DVI" as an command for Input selection. Therefore I renamed the commands to "INPUT HDMI X" and "INPUT VIDEO X".

After transforming the files D_*.file now includes the section for Input Selection and in the I_*.file the commands are now assigned to this section. All files are attached to this post.

After adding a new device with these new files I am now actually able to choose these commands in a Vera Scene.

So basically I know the command "VID6,AV2,VDP,DVD,DVI" is HDMI3, in the file dev4285574198.xml I changed its name to "INPUT VIDEO 2" so that its recognized as an input selection during transformation. In the file I_SQdev4285574198NEW.xml this command is assigned to "Input 6". So running the command Input6 from the Vera should switch the TV Input to HDMI3.

But since I am not at home and I have no camera seeing my TV and for some reason I can't see the log I can not yet confirm that my TV is actually changing the Input. I'll let you know as soon as possible...

EDIT: According to the log the right code for choosing the Input6 is sent:

Code: [Select]
02 11/23/11 10:57:18.852 UPnPCallbackEventHandler 0 start PIDLOG2 11499 <0x2c0c>
08 11/23/11 10:57:18.852 JobHandler_LuaUPnP::HandleActionRequest device: 0 service: urn:micasaverde-com:serviceId:HomeAutomationGateway1 action: RunScene <0x2c0c>
08 11/23/11 10:57:18.853 JobHandler_LuaUPnP::HandleActionRequest argument SceneNum=13 <0x2c0c>
08 11/23/11 10:57:18.854 Scene::RunScene running 13 PS3 <0x2c0c>
08 11/23/11 10:57:18.854 JobHandler_LuaUPnP::HandleActionRequest device: 44 service: urn:micasaverde-com:serviceId:InputSelection1 action: Input6 <0x2c0c>
08 11/23/11 10:57:18.855 JobHandler_LuaUPnP::HandleActionRequest device: 36 service: urn:micasaverde-com:serviceId:IrTransmitter1 action: SendProntoCode <0x2c0c>
08 11/23/11 10:57:18.856 JobHandler_LuaUPnP::HandleActionRequest argument ProntoCode=UT081067 <0x2c0c>
50 11/23/11 10:57:18.918 luup_log:36: Web request returned status=200 response=in 0ms <0x2c0c>


BTW: Sorry for those long posts, I am just trying to give you descriptions as accurate as possible.
« Last Edit: November 23, 2011, 05:00:03 am by chixxi »
Developer of Plugins: Virtual Switch, Variable Container, Popcorn Hour Remote, Vacation Ghost. => PLUGINS HAVE BEEN UNPUBLISHED BY ME.

Offline guessed

  • Master Member
  • *******
  • Posts: 5300
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: SQ Remote Plugin for Vera - Almost Working
« Reply #8 on: November 23, 2011, 07:30:07 am »
Yes, MiOS has a fixed number of predefined IR names (and ServiceIds).  My transforms attempt to map the SQBlaster codes to their MiOS equivalents but there isn't always an obvious mapping.

For the most part it uses the sqkey's but there's a limited amount of fallback logic for the "named" IR codes that SQBlaster sometimes uses

Offline drag0n

  • Full Member
  • ***
  • Posts: 130
  • Karma: +1/-1
Re: SQ Remote Plugin for Vera - Almost Working
« Reply #9 on: November 23, 2011, 09:25:40 am »
after about one hour of searching I addded a new device based on UEI codes.

Can you explain how to add a device based on UEI codes?
_____________________________________
Vera Lite, Remotec Z-URC 550, MiniMote, TKB TZ66D, TKB TZ-71, ZXT-120, ACT ZRP200 , SmartSwitch, Quad Relay, Poly Lock & Poly Pad, SQ Blaster & SQ Blaster+, HMS100, Everspring SF812, Current Cost EnviR, RFXtrx, RollerTrol , Flamingo FA20RF

Offline chixxi

  • Hero Member
  • *****
  • Posts: 1036
  • Karma: +37/-14
Re: SQ Remote Plugin for Vera - Almost Working
« Reply #10 on: November 23, 2011, 09:44:55 am »
after about one hour of searching I addded a new device based on UEI codes.

Can you explain how to add a device based on UEI codes?

Yes, example for Sony Bravia TV with UEI code:
1. Open the "SQ Remote HD" App on our iPhone/iPad.
2. Goto "Setup".
3. Goto "SQ Blaster & Devices".
4. Goto "Add New Device to Blaster" (of course you need to have an SQ Blaster connected to the iPhone to do that)
5. Choose the brand. In this case "Sony".
6. Choose the device Type. In this case "TV".
7. Now you can choose the code type (underlined in green in the attached screenshot) on the top with "left" and "right" (circled in yellow in the attached screenshot)
8. Use the TEST buttons to see which code works for your device.

I don't know if this option exists for every device.

I hope this is understandable, i think its hidden quite nice, or at least i didn't realize the option...

EDIT: This selection is not available for all devices. For example I can not choose the code for my Dreambox.
« Last Edit: November 24, 2011, 03:12:48 am by chixxi »
Developer of Plugins: Virtual Switch, Variable Container, Popcorn Hour Remote, Vacation Ghost. => PLUGINS HAVE BEEN UNPUBLISHED BY ME.

Offline chixxi

  • Hero Member
  • *****
  • Posts: 1036
  • Karma: +37/-14
Re: SQ Remote Plugin for Vera - Almost Working
« Reply #11 on: November 24, 2011, 03:20:23 am »
I CAN CONFIRM EVERYTHING IS WORKING!

Brief Summary:
Problem: Vera is sending commands to SQ Blaster, but Sony Bravia TV does not react.
Problem resulting from: Vera plugin not supporting repeating of Pronto Codes.
Solution: Switch to UEI Codes.

Now all that's left to say again: My very greatest appreciations to guessed and mat for helping me solve this problem and providing this plugin. Thank you GUESSED! Thank you SQUARECONNECTMAT!
Developer of Plugins: Virtual Switch, Variable Container, Popcorn Hour Remote, Vacation Ghost. => PLUGINS HAVE BEEN UNPUBLISHED BY ME.

Offline teonebello

  • Sr. Member
  • ****
  • Posts: 405
  • Karma: +0/-0
  • Macs, Home Automation, Bikers
Re: SQ Remote Plugin for Vera - Almost Working
« Reply #12 on: December 02, 2012, 02:07:11 pm »
I CAN CONFIRM EVERYTHING IS WORKING!

Brief Summary:
Problem: Vera is sending commands to SQ Blaster, but Sony Bravia TV does not react.
Problem resulting from: Vera plugin not supporting repeating of Pronto Codes.
Solution: Switch to UEI Codes.

Now all that's left to say again: My very greatest appreciations to guessed and mat for helping me solve this problem and providing this plugin. Thank you GUESSED! Thank you SQUARECONNECTMAT!

Hi chixxi, I have the same problem mentioned in the tread but I cannot solve it. Sqbalster plus is working correctly with Sq remote. But it is not working using the IR remote or scene in Vera.
When you say "Solution: Switch to UEI Codes", where should I do it? Do you mean in Vera? If you mean in Sqremote, then how can I use this command from VEra?

Thank you in advance
Regards,
Matteo

Offline guessed

  • Master Member
  • *******
  • Posts: 5300
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: SQ Remote Plugin for Vera - Almost Working
« Reply #13 on: December 02, 2012, 05:03:59 pm »
When you configure a TV via the SQRemote application, you select the Vendor (etc) and it presents you with a screen of the commands for that Model.

eg

[POWER TOGGLE]      [Test]
[POWER ON       ]       [Test]
(etc)

The default list is presents is that of the build-in catalog.  In addition to these codes, there's a control at the top of the UI that says:

    <   Select Code Set (1 of 5)   >

You can use this to page through the other potential codesets that might work for your TV.  IF you've got a well known TV, then there will be additional sets of "UEI" codes for that brand/device.

The UEI codes represent IR-sets from a built in "chip" catalog that the SQBlaster has in it's hardware.  "UEI" comes from the name of the chip vendor, since they're a large provider of IR Remote control chips.

When you select from this set, you're natively using the built in chip functionality.

Either way, once you've made the selection, then the devnnnnnnnnn.xml file from the backup will contain either a Pronto code from the Installer catalog, a Learned code or a UEI Code.

Each one brings with it different reliability characteristics.

Offline teonebello

  • Sr. Member
  • ****
  • Posts: 405
  • Karma: +0/-0
  • Macs, Home Automation, Bikers
SQ Remote Plugin for Vera - Almost Working
« Reply #14 on: December 02, 2012, 05:11:55 pm »
When you configure a TV via the SQRemote application, you select the Vendor (etc) and it presents you with a screen of the commands for that Model.

eg

[POWER TOGGLE]      [Test]
[POWER ON       ]       [Test]
(etc)

The default list is presents is that of the build-in catalog.  In addition to these codes, there's a control at the top of the UI that says:

    <   Select Code Set (1 of 5)   >

You can use this to page through the other potential codesets that might work for your TV.  IF you've got a well known TV, then there will be additional sets of "UEI" codes for that brand/device.

The UEI codes represent IR-sets from a built in "chip" catalog that the SQBlaster has in it's hardware.  "UEI" comes from the name of the chip vendor, since they're a large provider of IR Remote control chips.

When you select from this set, you're natively using the built in chip functionality.

Either way, once you've made the selection, then the devnnnnnnnnn.xml file from the backup will contain either a Pronto code from the Installer catalog, a Learned code or a UEI Code.

Each one brings with it different reliability characteristics.

Thank you for your explanation.

I found the XML with the code

  <command_info command_name="On,Power On/Off" SQKeyCode="2" ir_data="2" source_id="1" SQSource="U" UEIDeviceType="T" UEISetupCode="0810"/>
  <command_info command_name="Off,Power On/Off" SQKeyCode="3" ir_data="3" source_id="1" SQSource="U" UEIDeviceType="T" UEISetupCode="0810"/>

Now it miss the last step. Where should I put the uei code in Vera.

Doing a scene I can add the action choosing the sqblaster "send pronto code".

Can I put the uei code there? E.g. O810?

Thank you
Matteo