Plugin to create buttons to send TalkBack commands | ThingSpeak Plugins | Forum

Avatar

Please consider registering
Guest

Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

Register Lost password?
sp_Feed sp_TopicIcon
Plugin to create buttons to send TalkBack commands
Avatar
bborncr
New Member
Forum Posts: 4
sp_UserOfflineSmall Offline
1
June 28, 2014 - 1:56 pm
sp_Permalink sp_Print

Is it possible to create a plugin to create buttons to send TalkBack commands? A point in the right direction would be appreciated.

Regards,

Avatar
lee

Forum Posts: 457
sp_UserOfflineSmall Offline
2
June 29, 2014 - 1:08 pm
sp_Permalink sp_Print

Hi,

Yes you can create a plugin to send TalkBack commands. The easiest way to do this would be to create a HTML button, add an "onclick" event handler, and then use jQuery.ajax() ( http://api.jquery.com/jQuery.ajax/ ) to send the command data to ThingSpeak ( https://thingspeak.com/docs/talkback#add_command ). Please let me know if you need further help!

lee

Avatar
bborncr
New Member
Forum Posts: 4
sp_UserOfflineSmall Offline
3
June 30, 2014 - 5:08 pm
sp_Permalink sp_Print sp_EditHistory

Thanks for the reply. I tried the following which doesn't seem to be working:

https://thingspeak.com/plugins/4376/edit

Avatar
lee

Forum Posts: 457
sp_UserOfflineSmall Offline
4
June 30, 2014 - 8:30 pm
sp_Permalink sp_Print

Hi,

I can't view your plugin, it's currently set to "private". Please edit the plugin and uncheck the "private" field and I'll take a look at it.

lee

Avatar
bborncr
New Member
Forum Posts: 4
sp_UserOfflineSmall Offline
5
June 30, 2014 - 10:12 pm
sp_Permalink sp_Print

The private field is unchecked. I just went in and saved it again. It's still unchecked.

Avatar
lee

Forum Posts: 457
sp_UserOfflineSmall Offline
6
July 1, 2014 - 1:58 am
sp_Permalink sp_Print

Hi,

Sorry you're right, the plugin is public, the link was just to the edit page which I couldn't access.

In your code, it may be helpful to update jQuery to a newer version. Also, your post function looks like it should be changed to:

$.post('https://api.thingspeak.com/talkbacks/499/commands.json?apikey=MYAPIKEY&command_string=TURN_ON&position=1');

The turnOff function should follow the same format. Also make sure to set MYAPIKEY correctly to your TalkBack API key.

lee

Avatar
bborncr
New Member
Forum Posts: 4
sp_UserOfflineSmall Offline
7
July 1, 2014 - 5:37 am
sp_Permalink sp_Print

That was it! Just sloppy syntax errors!

Thanks,

Avatar
zesty
New Member
Forum Posts: 3
sp_UserOfflineSmall Offline
8
December 28, 2014 - 12:20 am
sp_Permalink sp_Print sp_EditHistory

I see there isn't a button example posted in the forums yet. I need help implementing a Talkback button.

This is that I have now that doesn't return anything using the "execute" API.
HTML Window between body: (arrows left out on purpose)
button onclick="myFunction()">Click me</button

And Javascript window:

function myFunction()
{
$.post('https://api.thingspeak.com/talkbacks/1026/commands.json?apikey=[MYKEY]&command_string=TURN_ON&position=1');
}

Thank you.
Scott

Avatar
lee

Forum Posts: 457
sp_UserOfflineSmall Offline
9
December 29, 2014 - 9:29 am
sp_Permalink sp_Print

Hi Scott,

Can you provide me with the ID of your plugin (or its URL) and I'll take a look at it?

lee

Avatar
zesty
New Member
Forum Posts: 3
sp_UserOfflineSmall Offline
10
December 29, 2014 - 10:59 am
sp_Permalink sp_Print sp_EditHistory

Here it is. I don't know what I'm doing. :) As far as I'm concerned, I'd settle for the easiest means to send TalkBack commands from a weblink or button on webpage.

https://thingspeak.com/plugins/6998

Avatar
lee

Forum Posts: 457
sp_UserOfflineSmall Offline
11
December 29, 2014 - 1:43 pm
sp_Permalink sp_Print

Hi Scott,

It looks like your code is correct, but you need to add a link to the jQuery library so that your JavaScript will run correctly. In the head tags inside the body section, add the following line:

Here's a full example that I made: https://thingspeak.com/plugins/6664 .

lee

Avatar
zesty
New Member
Forum Posts: 3
sp_UserOfflineSmall Offline
12
December 29, 2014 - 2:07 pm
sp_Permalink sp_Print

This is fantastic. Thank you!

I'd suggest adding this code to the TalkBack documentation as an example.

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online: jacktheripper125, pudderz
20 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 252

Vinod: 164

cstapels: 96

piajola: 75

vespapierre: 63

Adarsh_Murthy: 59

Newest Members:

bbruno22

pudderz

Utkya

Poornak26

LindasHed

reddysiva

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

 

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Administrators: Hans, lee