Square Connect SQ Blaster support

Forum rules

Questions about hardware that can be controlled by Indigo (but not through the interfaces and plugins listed). If Indigo doesn't support some bit of hardware you're interested in, and you don't find a 3rd Party Plugin for it, add it to this forum. Be sure to include links to as much information as you can find about it.

Note: adding it here does not mean we're going to add it - in fact it's possible one of our 3rd party developers may decide to write a plugin for it. We add hardware/features based on a lot of different factors beyond just having a request for it.

Posted on
Tue Sep 16, 2014 8:31 am
oddhenrik offline
User avatar
Posts: 19
Joined: Aug 26, 2014
Location: Norway

Square Connect SQ Blaster support

http://www.squareconnect.com/index.html

Is there or will there be support for the SQ Blaster or how would I approach making an integration?

OH

Yours,
ʞᴉɹuǝH-ppO

Posted on
Tue Sep 16, 2014 8:55 am
wiery offline
Posts: 288
Joined: Jun 02, 2008
Location: Ireland

Re: Square Connect SQ Blaster support

I integrated this with a shell script that worked quite well but to be honest it was a far better option to get the Global Cache ones. If you want the script I can get it for you if you want

Posted on
Tue Sep 16, 2014 9:01 am
jay (support) offline
Site Admin
User avatar
Posts: 18212
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Square Connect SQ Blaster support

Assuming it has an API, you could build an Indigo Plugin for it using our Plugin API/SDK... ;)

We have no current plans to build any integration ourselves.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Sep 17, 2014 1:05 am
oddhenrik offline
User avatar
Posts: 19
Joined: Aug 26, 2014
Location: Norway

Re: Square Connect SQ Blaster support

wiery wrote:
I integrated this with a shell script that worked quite well but to be honest it was a far better option to get the Global Cache ones. If you want the script I can get it for you if you want


Yes please :)

jay (support) wrote:
Assuming it has an API, you could build an Indigo Plugin for it using our Plugin API/SDK... ;)

We have no current plans to build any integration ourselves.


Hi Jay, yes it has an API, yes I know I could make one using the Plugin API/SDK, and yes I'm a programmer also. But the reason I don't make my own home automation system is my lack of time. I rather buy what I need to get going :wink:

I used a couple of hours last night testing out Indigo, setting up a dimmer, a multisensor from Fibaro and a scene controller, and also the wera bridge I like what I see and already many issues that I have with Vera is solved :) . But I have a very large and complex z-wave network and setup. I hope to migrate it all to Indigo without to much hassle. I will order a Mac Mini today and hoping this with Indigo will be a faster, more flexible, function rich and more reliable platform then the vera.

Will continue and try to post nice and clean post on the forum for needs and issues that comes along the path, that I cannot find elsewhere. When I have the basic stuff set up I will look into the Plugin API for refinements.. :)

Yours,
ʞᴉɹuǝH-ppO

Posted on
Wed Sep 17, 2014 1:56 am
wiery offline
Posts: 288
Joined: Jun 02, 2008
Location: Ireland

Re: Square Connect SQ Blaster support

This is a bash shell so put it somewhere on your mac. You will need to download the xml file from the sqblaster after you have configured some devices in the iPhone app and place this in the same directory, or change the path at top of script. Obviously change the IP address to that of your blaster

Code: Select all
#!/bin/bash
# Called as: send_ir_cmd <command name>
#       e.g. send_ir_cmd POWER ON
#         or send_ir_cmd "POWER ON"

# Get name and location of the script
me=${0##*/}

mydir=$(which $0)
mydir=${mydir%/*}
mydir=${mydir:-/}
mydir=$(cd "$mydir"; pwd)

# Command name (join command line arguments)
# If no arguments, reset them to UPPERCASED "_" seperated words of link call name
#if [[ $# -eq 0 && -L $0 ]]; then
#set -- $(echo "$me" | tr '_a-z' ' A-Z')
#fi

# Command name (join command line arguments)
cmd="$*"

# Set the server name
# (will make command line option later)
server=192.168.0.8

# Set the API to call
# (will make command line option later)
api=docmnd.xml

# Set the device
# (will make command line option later)
dev=dev2898133276

# Set location of XML ir_data file to use (based on script location and device name)
# (will make command line option later)
ir_data_file=$mydir/$dev.xml

# Just list command names if $1 is "-l"
if [[ $1 = "-l" ]]; then
   awk '
      BEGIN {RS="<"; FS="\""; rc=1}
      $0~/ command_name="/ {sub(/^.* command_name="/,""); print $1}
   ' $ir_data_file |
   sort
   exit $?
elif [[ $1 = "-c" ]]; then
   awk '
      BEGIN {RS="<"; FS="\""; rc=1}
      $0~/ command_name="/ {sub(/^.* command_name="/,""); print $1}
   ' $ir_data_file |
   sort |
   awk 'BEGIN {ORS=", "}; {printf "%-20s",$0}; NR%5==0 {printf "\n"}; END {printf "\n"}'
   exit $?
fi

# Get the ir_data for the command passed, exit if not found
if ! ir_data=$(awk -v cmd="$cmd" '
      BEGIN {RS="<"; FS="\""; rc=1}
      rc!=0 && $0~"command_name=\""cmd"\"" {sub(/^.* ir_data="/,""); print $1; rc=0}
      END {exit rc}
   ' $ir_data_file)
then
   echo "$me: No IR data found for device \"$dev\" command \"$cmd\" in data file \"$ir_data_file\"" >&2
   exit 1
fi

# Set the data to POST
data='<docommand
key="'$dev'"
repeat= "100"
seq = "0"
command="'"$cmd"'"
ir_data="'"$ir_data"'"
ch="0"
/>'

echo "--- Data to POST ---"
echo "$data"
echo "--- End of data to POST ---"

# Supply data on STDIN to curl to POST to server API
# (let response go to STDOUT - script exit code will be that of curl)
#echo "${data:?}" | curl -v -d @- --dump-header - http://${server:?}/${api:?}
/usr/bin/wget -O - -v --post-data="${data:?}" http://${server:?}/${api:?}
echo=$?
echo
exit $rc

Posted on
Tue Sep 23, 2014 2:00 pm
oddhenrik offline
User avatar
Posts: 19
Joined: Aug 26, 2014
Location: Norway

Re: Square Connect SQ Blaster support

Thx,

Will look into it. Trying to learn how to make plugins now....

OH

Yours,
ʞᴉɹuǝH-ppO

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 6 guests