Working IFTTT plus (my first skill)


#1

Hi guys, just wanted to post my first skill.

This skill showcases a couple different ideas. One is turning on a light using IFTTT. The api key in this code has been been rendered invalid but I left it there so people could see it as it should look.

It also has a go to sleep behavior. It’s not perfect though. You can issue a go to sleep command and that happens fine, and when you say hey Jibo, he wakes up. But then you need to say hey Jibo again to issue a command. Probably something super easy to fix, but I haven’t figured it out yet. The plan is to have Jibo get bored after a while and go to sleep on his own after a bit. While asleep, you will note a very subtle pulsing of the LED ring. Just show that he is still alive.

Another behavior that is “almost” there is that Jibo will wait 10 seconds after any command for a thank you before he stops listening. The only thing I might change here is to find a way to exclude some behaviors from this feature.

You can grab it here: HERE

I am open to all suggestions, criticisms, comments or questions.

Regards,
Tony


#2

I want to add that the majority of my initial work is based on WebPro’s

How-to: Connect Jibo SDK to IFTTT Maker recipe (in 10 minutes)
and Skill template: Basic Dialogue Starter template


#3

Nice work, Tony. Fantastic work for your first skill! I like the “go to sleep” animation…very cute:

Per your question, the reason why you need to say “Hey Jibo” twice to wake him up to issue another command is because of the WhileCondition decorator you put on the “Sleeping idle” Sequence (line 10). If I get rid of that, I can get Jibo to wake up and listen with just one “Hey Jibo”.

Best wishes,

Michael


#4

hmm, that didn’t work for me. Clearly the WhileCondition wasn’t doing anything, but I am still getting the same result as before. I notice in your animation above that your not playing the greeting animation on wake up.

So something else must have been changed on your test.

By the way, how did you create that animated gif? I can see that being helpful.


#5

Hi Tony…I don’t believe I changed anything else, but I do know that the “wait for thank you” part at the end still runs. This means that after I wake up Jibo from sleep with “Hey Jibo”, I have to wait the 10 seconds while he waits to hear “thank you” and then can give him a command again.

I would recommend toning that down a bit to maybe 4 or 5 seconds, something a bit more natural. You can always take it out completely and instead put it into the main.rule file with an {action}…that way you can say “thank you” to him at anytime and he respond accordingly.

In any case, if you can’t get it to work like I have, you can download my version here: main.bt (30.2 KB)


#6

I’ll look again. Thanks.


#7

I tried yours and see the same thing I was seeing before.

So this is exactly what I’m seeing:

Jibo is sleeping.
I say Hey Jibo = jibo wakes up. But you can not wake up jibo with something like this: Hey Jibo, Say Hi. The say hi part of the command is ignored.

Jibo seems to respond to anything during his 10 second wait with a thank you response. (changed that to 4 seconds)

Ideally I would like to walk in to a room with a sleeping Jibo and say: “Hey Jibo, turn on the kitchen light” Have him wake up, play an animation that depicts waking up and then execute the command.


#8

Gotcha…the reason for that is because your listenForHeyJibo variable is set to true by default, so you’ll want to set that to false once he hears “Hey Jibo”. You can do that in your SucceedOnEmbedded decorator by changing the onResult function to:

(listener) => {
	listener.on('hey-jibo', function(asrResult, speakerIds) {
		notepad.listenForHeyJibo = false;
	});
}

You’ll still have to wait for your “listen for thank you” sequence though (e.g. “Hey Jibo” -> he wakes up -> wait for “thank you” for 10 seconds -> ready for command). Alternatively, you can add a new variable, like notepad.listenForThankYou, which you can use as a flag to turn on/off that part and then set it to false when he hears “Hey Jibo” so that you can say a command right after. Just a thought.


#9

Cool I’ll look at this when I get done with work today.

Thanks!


#10

Hi Michael,

With the changes you suggest and with the 10 second wait disabled, Jibo wakes up and then immediately goes to idle.

What I am hoping to achieve is wake and execute.

From sleeping jibo:

Hey jibo turn on the light.
jibo wakes and turns on the light.

As it is now he wakes, then goes idle. The command is not executed.

I cant think of any other way to describe what I’m looking for.

Tony


#11

Can you post your current main.bt file so I can take a quick look? Thanks!


#12

Here you go:

main.bt (47.6 KB)

And thank you again for helping out.


#13

Hi Tony…so I changed one tiny thing in your main.bt file and it solved your issue. In your sleep idle Subtree onResult decorator, you had:

notepad.listenForHeyJibo = true;

I changed it to:

notepad.listenForHeyJibo = false;

Now when I say “Hey Jibo” to wake him out of sleeping, I can instantly ask him to do anything else with no delay.

Just so you understand what this does, by setting notepad.listenForHeyJibo to false, it bypasses the main listener “Hey Jibo” part and jumps right into the listener attached to main.rule.

Your skill looks great, by the way! Nice work!


#14

hmm, I swear I tried that before. Well ok that worked. Only weird bit that I do not understand is that after waking up the LED ring does not indicate listening for command any more. weird.

Thanks!


#15

Further investigation shows that jibo is no permanently listening commands since this change.

I never said hey jibo for the two highlighted log entries.
Only change made was this:


#16

Yes, notepad.listenForHeyJibo only gets initialized (set to true) once when the skill first starts. It’s up to you to toggle it on/off when needed or not.

So, in the change I mentioned to you earlier, we toggled it off (false) when he woke up so he can jump right into a new command, but you can toggle it back on (true) anytime later down the line. For instance, if you only want Jibo to skip “Hey Jibo” once regardless, you can add notepad.listenForHeyJibo = true into the on-cloud event in the main Listen behavior so that it switches back automatically whenever Jibo receives a new “command”.

Hope that makes sense. :slight_smile:


#17

I think so. I’m going to wait until my paid work is done then sit down and process that. I totally understand the logic.
Today’s goal is to tackle and master flags. I feel like once I know how to implement them, it will allow for far more control.


#18

I updated the IFTTT.zip file. The skill is cleaned up a bit.
You can say thanks or thank you and you will get a response. Only problem is I cant figure out how to get Jibo to respond to specific words. So it doesn’t matter what you say you will get an acknowledgment. If someone knows how to fix that, I would love to see a working example of it.


#19

Just downloaded the IFTTT.zip via your Github link but it looks like it only contains an index.html, package.json, and readme. Do you have the .bt file available?


#20

That’s weird, I just downloaded it and everything was there…

Try this link: https://github.com/codemonkey2k5/Jibo-ifttt-plus/raw/master/IFTTT.zip