Author Topic: Instapush  (Read 4541 times)

0 Members and 1 Guest are viewing this topic.

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Instapush
« on: December 16, 2014, 07:55:02 PM »
I am looking into integrating instapush (https://instapush.im/) with VC ... it works android and iOS ... python wrappers are available ... however making it a plug-in will give it ease of use and make it useable by all users without the need to dive in python ....
When Voice command gets tough, use hand gestures

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Instapush
« Reply #1 on: December 16, 2014, 09:03:01 PM »
What kind of usage scenario do you envision?
« Last Edit: December 16, 2014, 09:04:56 PM by nime5ter »

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Instapush
« Reply #2 on: December 17, 2014, 04:44:49 AM »
Mainly, feedback through notifications, and may be some interaction through actions from notifications (iOS support this now, not sure about android)
That would give VC tighter integration with mobile devices ...

Examples include, notification when alarm disarmed, main door has been opened or unlocked ... As well sending confirmations for actions like remotely locking doors ... I have IFTTT informing VC when I leave my home, VC checks if nobody is home, it will lock the main door ... With Instapush, VC can notify me of the situation and offer to lock the door... Sending reminders ... Etc.

I have something close through Skype. however, lately on iOS if Skype is not running messages do not deliver ...

For me VC is becoming the brain of the interconnected house, not merely VR interface ... And notification is more bullet proof for important stuff
When Voice command gets tough, use hand gestures

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Instapush
« Reply #3 on: December 17, 2014, 09:37:21 AM »
It is still not 100% clear, and I probably should have asked a better question.  Does InstaPush send any information to VoxCommando, or is it only possible to send notifications from VC to instaPush?

The problem I have with making a plugin for this is that it is probably quite easy to use InstaPush with existing VC tools, and there must be at least 50 different notification apps out there for iOs and Android.  Why make a plugin for this one in particular?

I expect that it will be possible to use our scrape.post actions, but if not then it should be possible using launch actions with curl (instaPush has examples on their site).  Once one user has figured out how to do it, it should be relatively easy (even for a newb) to plug in their api secret keys etc. to get it working for themselves.  I doubt that python will be required, so it will be a simple matter of copying xml and changing private info.

I had VC sending notifications to my iPod years ago using Prowl.  This is super easy to set up (you send an email to a special address and it notifies prowl).  Only takes a second or two to send, and Prowl only costs about $3.  Back then it might even have been free.

If you are already using IFTTT can't you use it to send notifications from VC to your phone?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Instapush
« Reply #4 on: December 17, 2014, 09:41:46 AM »
InstaPush does not appear to be compatible with any of our Android devices so that is a big strike against it.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Instapush
« Reply #5 on: December 17, 2014, 02:25:02 PM »
I have no mobile phone that works with Instapush, but I did manage to send event notifications from VC to Instapush without a problem. In my Instapush dashboard I can see that all the events were successfully transmitted.

My steps:

INSTAPUSH

1. Signed up for an Instapush account at https://instapush.im/
2. Noted my user token number, which is shown in the INFO tab of the dashboard.
3. Clicked on the APPS tab and added an application (+AddApplication). (I called mine "myVox". Call it whatever you want.) This generates an app id and application secret, both of which can be found under the Basic Info tab of the newly created myVox app.
4. My notification will send info on the song that is now playing on my computer. In the Events tab of the myVox app, I added a new event.
-->4a. I named the event "new_song"
-->4b. I will be passing it 2 "trackers": {title} and {artist}.
-->4c. I then entered the Push Message: "Now playing {title} by {artist}"

IN VOXCOMMANDO
1. Created an instapush map in VoxCommando in which to store user token, app id, and app secret for easy access later.
2. Created a command that is triggered by a new_song event within VC, when a new song starts playing on my computer (you can use existing event triggers or whatever you want -- I made this one up). In VC, my new_song event includes 2 payload values: {1} song title, {2} artist name. These are used in the command itself.
3. The command only requires a Scrape.Post request. To figure out the syntax, I referred to Instapush's REST API page: https://instapush.im/developer/rest.

They are giving curl examples, but it doesn't matter. -H in curl refers to the Header, -d to Datastring. Compare it to the parameters in VC and you'll see how it works.

(HTTP requests, used by "RESTful" web services, have standard parameters that must be used, no matter which programming language or tool you are using. Any example online in one particular language should be translatable. In VC, the scrape actions are how we handle basic get/put/post requests.)

For Scrape.Post actions in VC, it's usually easiest to enter the parameters using the Parameter Helper. http://voxcommando.com/mediawiki/index.php?title=Parameter_Helper

See below.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.2.3-->
<command id="273" name="New song notification" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Scrape.Post</cmdType>
    <params>
      <param>https://api.instapush.im/v1/post</param>
      <param>{"event":"new_song","trackers":{"title":"{1}","artist":"{2}"}}</param>
      <param />
      <param />
      <param>application/json</param>
      <param>x-instapush-appid: {M:instapush.appID}</param>
      <param>x-instapush-appsecret: {M:instapush.appSecret}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>Now playing {1} by {2}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <event>new_song</event>
</command>
« Last Edit: May 12, 2017, 03:54:05 PM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Instapush
« Reply #6 on: December 17, 2014, 02:32:24 PM »
Update. James figured out that he could load Instapush on his Omate smart watch. The notifications are successfully showing up on his device.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Instapush
« Reply #7 on: December 17, 2014, 02:40:22 PM »
Just a warning:

You will need a Bluetooth keyboard and the ability to navigate in the dark in order to set up InstaPush on the omate watch.

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Instapush
« Reply #8 on: December 20, 2014, 01:16:26 AM »
It is still not 100% clear, and I probably should have asked a better question.  Does InstaPush send any information to VoxCommando, or is it only possible to send notifications from VC to instaPush?

The problem I have with making a plugin for this is that it is probably quite easy to use InstaPush with existing VC tools, and there must be at least 50 different notification apps out there for iOs and Android.  Why make a plugin for this one in particular?

I expect that it will be possible to use our scrape.post actions, but if not then it should be possible using launch actions with curl (instaPush has examples on their site).  Once one user has figured out how to do it, it should be relatively easy (even for a newb) to plug in their api secret keys etc. to get it working for themselves.  I doubt that python will be required, so it will be a simple matter of copying xml and changing private info.

I had VC sending notifications to my iPod years ago using Prowl.  This is super easy to set up (you send an email to a special address and it notifies prowl).  Only takes a second or two to send, and Prowl only costs about $3.  Back then it might even have been free.

If you are already using IFTTT can't you use it to send notifications from VC to your phone?

Why instapush?, no specific reason ...  Just easy,  open, and supports android and iOS (in theory)
The problem for both prowl & IFTTT is it depends on email so there is no error trapping ... While insta push if message fails one can resend till it pass ... IFTTT other limitation it only receive emails from one account so you can't alert multiple users ...

Interaction is possible by providing links in the message that can be linked back to VC through TCP server.

You might be right it is straight forward from scrape command... So no need for plug-in I guess ... Maybe this thread should be moved to help with vc or integration ideas


Nime5ter thank you,  again you save me long hours of figuring stuff out ... I succeeded in sending notifications through curl ... But with your example I can go toward full integration
« Last Edit: December 20, 2014, 03:47:46 AM by Haddood »
When Voice command gets tough, use hand gestures

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Instapush
« Reply #9 on: December 20, 2014, 03:52:00 AM »
nime5ter,
I just noticed something in the code. you are accessing the values in the map like variables, is this new or always has been there?
When Voice command gets tough, use hand gestures

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Instapush
« Reply #10 on: December 20, 2014, 07:46:05 AM »
Yup, map variables have always been there. :) Super handy for many things.

http://voxcommando.com/mediawiki/index.php?title=Maps

You can just drag them from the map into your action, using the "drag" icon in the map. This is one reason there's a button for the map editor directly within the LCB.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Instapush
« Reply #11 on: April 22, 2015, 12:20:46 PM »
When applying this for the very first time ... for iOS use IFTTT recipe to trigger an InstaPush message .... this will add your device ... then VC can use the service
When Voice command gets tough, use hand gestures