Voice control with Tasker,Autovoice , Blynk and Google Now

Voice control with Tasker,Autovoice , Blynk and Google Now.

First you have to download tasker and install tasker.To use tasker there are many tutorials on Youtube one can follow.

Download Autovoice and install it.Autovoice is a plugin that works with tasker.
Setting up is easy.Again youtube comes to hand with many tutorials.

Next is to download RESTask Api.

This procedure is from the Bylnk community.

Here is a tutorial on how to bind tasker and Blynk, via the restfull api blynkapi · Apiary

we will use a plugin called RESTask

we will fist cover how to write data :

  1. download the plugin https://play.google.com/store/apps/details?id=com.freehaha.restask&hl=en95
  2. open tasker, new task, click the “+”, plugin, then “RESTask”
  3. click the pen
  4. request type : PUT
  5. host : http://cloud.blynk.cc/your_token/pin/D1 (for real pin)
    or http://cloud.blynk.cc/your_token/pin/V1 (for virtual pin)
  6. enable “custom body”
  7. custom body : if you want to activated pin : [“1”]
    if you want to deactivate pin: [“0”]
  8. Go to “header tab”
  9. click “add more”
    10 : name : Content-Type
    value: application/json

you can check if your program work by clicking the play triangle, if it works, click the save icon and enjoy !

if you want to read data, you have to change:
step 4 : it will be “get” instead of “put”, and at
step 6: you have to uncheck the custom body

Your data will be stored in the tasker variable %rtres

ps : if you want to add more security between your phone and the server, check the discussion under this post :wink:

NB:5.should be (https://blynk-cloud.com/your_token/pin/D1 (for real pin) V1 (for virtual pin)

Blynk software

In my case i have use four virtual buttons to communicate with tasker/Restask.

// #define BLYNK_DEBUG
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
int state1;

char auth[] = "xxxxxxxxxxxxxxxxxxxxxxxxxx";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "xxxxxxx";
char pass[] = "xxxxxx";

void setup()
{
  Serial.begin(9600);

  //WiFi.config(ip, gateway, subnet);
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);

  while (Blynk.connect() == false) {
    // Wait until connected
  }


  pinMode (2, OUTPUT); //relay pin
  pinMode (12, OUTPUT); //relay pin
  pinMode (13, OUTPUT); //relay pin
  pinMode (14, OUTPUT); //relay pin
  digitalWrite(12, LOW); //Turn off relay on GP12 on ESP 8266-12
  digitalWrite(13, LOW); //Turn off relay on GP13 on ESP 8266-12
  digitalWrite(2, LOW); //Turn off relay on GP02 on ESP 8266-1
  digitalWrite(14, LOW); //Turn off relay on GP01 on ESP 8266-12
}

BLYNK_WRITE(V1) // turn light on - ESP 8266-12
{
  int state1 = param.asInt();
  if (state1) {
    Serial.println("ON ");
    Blynk.virtualWrite(V4, 255);// turn off led for light
    Blynk.virtualWrite(V1, HIGH);//turn on V1 light
    digitalWrite(12, HIGH); //Turn  relay on pin GP12
  } else {
    Serial.println("OFF ");
    Blynk.virtualWrite(V4, 0);// turn off led for light
    Blynk.virtualWrite(V1, LOW);//turn off V1 light
    digitalWrite(12, LOW); //Turn  relay off pin GP12
  }
}

BLYNK_WRITE(V2)// turn tv on - ESP8266-1 GPIO2
{
  int state2 = param.asInt();
  if (state2) {
    Serial.println("ON ");
    Blynk.virtualWrite(V5, 255);// turn on led for TV
    Blynk.virtualWrite(V2, HIGH);//turn on V2 for  TV
    digitalWrite(2, HIGH); //Turn  relay on pin GPIO2

  } else {
    Serial.println("OFF ");
    Blynk.virtualWrite(V5, 0);// turn off led for TV
    Blynk.virtualWrite(V2, LOW);//turn off V2 for TV
    digitalWrite(2, LOW); //Turn  relay off pin GPIO2
  }
}

BLYNK_WRITE(V3)// turn kitchen on - ESP8266-12
{
  int state3 = param.asInt();
  if (state3) {
    Serial.println("ON ");
    Blynk.virtualWrite(V6, 255);// turn on led for kitchen light
    Blynk.virtualWrite(V3, HIGH);//turn on V3 for kitchen
    digitalWrite(13, HIGH); //Turn  relay on pin GP13
  } else {
    Serial.println("OFF ");
    Blynk.virtualWrite(V6, 0);// turn off led for kitche light
    Blynk.virtualWrite(V3, LOW);//turn off V3 for kitchen
    digitalWrite(13, LOW); //Turn  relay off pin GP13
  }
}

BLYNK_WRITE(V7)// turn conservatory on - ESP8266-12 GPI14
{
  int state4 = param.asInt();
  if (state4) {
    Serial.println("ON ");
    Blynk.virtualWrite(V8, 255);// turn on led for conservatory
    Blynk.virtualWrite(V7, HIGH);//turn on V7 for conservatory light
    digitalWrite(14, HIGH); //Turn  relay on pin GP014

  } else {
    Serial.println("OFF ");
    Blynk.virtualWrite(V8, 0);// turn off led for conservatory
    Blynk.virtualWrite(V7, LOW);//turn off V7 for conservatory light
    digitalWrite(14, LOW); //Turn  relay off pin GPo14
  }
}


void loop()
{
  Blynk.run();

}

The hardware is home made.Using ESP8266-12 and ESP8266-01.It is best to use ESP8266-12
as it is more reliable and easy to wire.
I currently have 4 units built and will add some more as i require.

I hope you have as much fun trying this project as I have had buildig is.

2 Likes