How to use Google Home + Blynk with ESP8266 { without " IFTTT " }

I have no chances, there are maybe 100 people with the same problem, and google doesn’t care.
https://productforums.google.com/forum/#!topic/googlehome/-_dExwelUPk

Probably more like market priorities. Much like this is a Blynk forum for Blynk discussions, not a Google Home forum for GH feature/engineer bashing :wink:

Thus if you have a question about how to make Blynk know which room you are in when you hit a button to turn on the light… Well now that might be a worthy Blynk topic :stuck_out_tongue: Although honestly, even that will be mostly programming and sensors, not necessarily a Blynk specific thing.

@PeteKnight

Hi Pete
where can I find a good tutorial for Node-Red ?
thanks

I found it very intuitive and easy to get staeted with. I watched a couple of YouTube videos about Node-Red and MQTT and was up and running in no time.
If you take a look at @scargill’s blog he has a script to automatically install Node-Red and the Blynk plugins on a Pi

The script used to install the old version of the Blynk plugin. I’m not sure if that’s still the case, but if it is then it’s easy to use Palet Manager to uninstall the old version and install node-red-contrib-blynk-ws instead.

I use Blynk quite a lot, but don’t have any Blynk code running on my MCUs. I do everything using MQTT messages and let Node-Red handle the Blynk, Amazon Alexa, Ikea TRÅDFRI etc integration.

Pete.

unfortunately I don’t have a pi and I am not planing to get one soon.
thanks Pete.

Looks like you could run it on Windows 10 as well…
https://nodered.org/docs/platforms/windows

Pete.

SINRIC Simple RGB Led strip activated with Google Home Voice .(natural speech commands)

@Jamin

voice command: “change LED 1 to deep sky blue
GH answer: "you got it changing LED 1 to deep sky blue"

voice command: “change LED 1 to blue violet
GH answer: "you got it changing LED 1 to blue violet"

voice command: “change LED 1 brightness to 50%
GH answer: "sure setting LED 1 brightness to 50%"

voice command: “change LED 1 to white
GH answer: "ok changing LED 1 to white"

    Switch  Relay C turn = 0
    [314390] Time sync: OK
    [614621] Time sync: OK
    [WSc] get text: {"deviceId":"xxxx","action":"action.devices.commands.ColorAbsolute","value":{"color":{"name":"yellow","spectrumRGB":16776960}}}
    [WSc] get text: {"deviceId":"xxxx","action":"action.devices.commands.BrightnessAbsolute","value":{"brightness":80}}
    [WSc] get text: {"deviceId":"xxxx","action":"action.devices.commands.ColorAbsolute","value":{"color":{"name":"royal blue","spectrumRGB":9062}}}
    [WSc] get text: {"deviceId":"xxxx","action":"action.devices.commands.ColorAbsolute","value":{"color":{"name":"deep sky blue","spectrumRGB":49151}}}
    [WSc] get text: {"deviceId":"xxxx","action":"action.devices.commands.ColorAbsolute","value":{"color":{"name":"blue violet","spectrumRGB":9055202}}}
    [WSc] get text: {"deviceId":"xxxx","action":"action.devices.commands.BrightnessAbsolute","value":{"brightness":50}}
    [WSc] get text: {"deviceId":"xxxx","action":"action.devices.commands.ColorAbsolute","value":{"color":{"name":"cool white","temperature":4000}}}
    [WSc] get text: {"deviceId":"xxxx","action":"action.devices.commands.BrightnessAbsolute","value":{"brightness":8}}
1 Like

Links that help me with code for Google Home and Amazon Echo

for Google Home
1- Smart Home ColorSpectrum Trait Schema

2- My Code

//G=>{"deviceId":"xxxx","action":"action.devices.commands.ColorAbsolute","value":{"color":{"name":"sky blue","spectrumRGB":8900331}}}

        else if(action == "action.devices.commands.ColorAbsolute") { // color 
            S = "Google Home";
            String Name = json ["value"]["color"]["name"];     
            int spectrumRGB = json ["value"]["color"]["spectrumRGB"];
            int temperature = json ["value"]["color"]["temperature"];

        Gcolor = Name ;

        String strRGB = String(spectrumRGB, HEX);  
        while (strRGB.length() < 6) strRGB = "0" + strRGB;
        strRGB.toUpperCase();
        strRGB = "#" + strRGB ;

        // Split them up into r, g, b values
        byte r = spectrumRGB >> 16;
        byte g = spectrumRGB >> 8 & 0xFF;
        byte b = spectrumRGB & 0xFF;
  
          rr = r ; gg = g ; bb = b ;
          RGB_Out(rr,gg,bb) ;

For Alexa it needs a function to convert HSB to RGB

     // For Light device type
        // {"deviceId": xxxx, "action": "setPowerState", value: "ON"} // https://developer.amazon.com/docs/device-apis/alexa-powercontroller.html
        // {"deviceId": xxxx, "action": "AdjustBrightness", value: 3} // https://developer.amazon.com/docs/device-apis/alexa-brightnesscontroller.html
        // {"deviceId": xxxx, "action": "setBrightness", value: 42} // https://developer.amazon.com/docs/device-apis/alexa-brightnesscontroller.html

        // {"deviceId": xxxx, "action": "SetColor", value: {"hue": 350.5,  "saturation": 0.7138, "brightness": 0.6501}} // https://developer.amazon.com/docs/device-apis/alexa-colorcontroller.html

        // {"deviceId": xxxx, "action": "DecreaseColorTemperature"} // https://developer.amazon.com/docs/device-apis/alexa-colortemperaturecontroller.html
        // {"deviceId": xxxx, "action": "IncreaseColorTemperature"} // https://developer.amazon.com/docs/device-apis/alexa-colortemperaturecontroller.html
        // {"deviceId": xxxx, "action": "SetColorTemperature", value: 2200} // https://developer.amazon.com/docs/device-apis/alexa-colortemperaturecontroller.html

3- HSV → RGB

*** Color math ***

//H, S and V input range = 0 ÷ 1.0
//R, G and B output range = 0 ÷ 255

if ( S == 0 )
{
   R = V * 255
   G = V * 255
   B = V * 255
}
else
{
   var_h = H * 6
   if ( var_h == 6 ) var_h = 0      //H must be < 1
   var_i = int( var_h )             //Or ... var_i = floor( var_h )
   var_1 = V * ( 1 - S )
   var_2 = V * ( 1 - S * ( var_h - var_i ) )
   var_3 = V * ( 1 - S * ( 1 - ( var_h - var_i ) ) )

   if      ( var_i == 0 ) { var_r = V     ; var_g = var_3 ; var_b = var_1 }
   else if ( var_i == 1 ) { var_r = var_2 ; var_g = V     ; var_b = var_1 }
   else if ( var_i == 2 ) { var_r = var_1 ; var_g = V     ; var_b = var_3 }
   else if ( var_i == 3 ) { var_r = var_1 ; var_g = var_2 ; var_b = V     }
   else if ( var_i == 4 ) { var_r = var_3 ; var_g = var_1 ; var_b = V     }
   else                   { var_r = V     ; var_g = var_1 ; var_b = var_2 }

   R = var_r * 255
   G = var_g * 255
   B = var_b * 255
}

4-void HSV_to_RGB(float h, float s, float v, byte &r, byte &g, byte &b)

My Code

  void HSV_to_RGB(float h, float s, float v, byte rgb[])
    {
      int i;
      float f,p,q,t;   //http://www.easyrgb.com/en/math.php
  
    h = constrain(h, 0.0, 360.0);
    s = constrain(s, 0.0, 100.0);
    v = constrain(v, 0.0, 100.0);
  
    s /= 100;
    v /= 100;
  
    if (s == 0) {
      // Achromatic (grey)
      rgb[0] = rgb[1] = rgb[2] = round(v*255);
      return;
    }

    h /= 60.0; 
    i = floor(h); // sector 0 to 5
    f = h - (float)i; // factorial part of h
    p = v * (1.0 - s);
    q = v * (1.0 - s * f);
    t = v * (1.0 - s * (1 - f));
  
    switch(i) {                //http://colorizer.org/
      case 0:
        rgb[0] = round(255*v);
        rgb[1] = round(255*t);
        rgb[2] = round(255*p);
        break;
      case 1:
        rgb[0] = round(255*q);
        rgb[1] = round(255*v);
        rgb[2] = round(255*p);
        break;
      case 2:
        rgb[0] = round(255*p);
        rgb[1] = round(255*v);
        rgb[2] = round(255*t);
        break;
      case 3:
        rgb[0] = round(255*p);
        rgb[1] = round(255*q);
        rgb[2] = round(255*v);
        break;
      case 4:
        rgb[0] = round(255*t);
        rgb[1] = round(255*p);
        rgb[2] = round(255*v);
        break;
      default: // case 5:
        rgb[0] = round(255*v);
        rgb[1] = round(255*p);
        rgb[2] = round(255*q);
      }
  }                   
//---------------------------------

5- Color picker, calculator and generator with high precision and contrast test. Converts also RGB, HEX, HSL, HSV/HSB, CMYK and CIE-LAB colors and lots of other formats. In the Hex-field, you can write a known color name, too.

6- Arilux RGB LED controllers for use with Home Assistant and an IR remote
Alternative firmware for Arilux AL-LC0X LED controllers

NEW Android application

A simple and elegant way to link your development boards like RaspberryPi, ESP8226, ESP32 or Arduino with Amazon Alexa or Google Home for FREE!

**** App only supports turning on/off devices as of v1.0. other features will be added soon.

  1. Goto Sinric.com. register for an account if you do not have one (Use Chrome, FireFox)

  2. Log in and create a smart home device

  3. Copy your API Key

  4. Connect.

1 Like

@Deimos

after a GH update
now if you say , “turn on lights” it will turn ON lights of the room where Home Mini is present only and not all rooms like before.

@Deimos

also with sinric Thermostat example you can

// For Thermostat

=====================================================================
now if you ask GH “ what is sensor temperature ? ”
it will answer “ it is currently 24.5 degrees ” (depending on your room sensor temperature)

1 Like

Yeah, I’m happy that Google understood the problem eventually :slight_smile:
I was the first one who tested thermostat: https://github.com/kakopappa/sinric/issues/73 so yes I know, thanks.
Sinric is amazing! reliable and fast.

1 Like

great
so you are Deimos1994

something i wanted to add
I am using Amazon Echo and GH in the same ESP8266 sketch
for me the response of Echo Dot is faster and more accurate than GH.
there is never word mismatch with Amazon Echo like GH that sometimes change the complete sentence.

I hope soon we will get humidity and fan control.
thanks.

It could be, but I think it has nothing to do with Sinric, it is Google issue.
It seems to me that just after I bought GH the voice recognition was much better than it is now. Microphones in my GH seems to be fine, so I think Google changed something on their servers. And as far as I remember Amazon Echo uses 7 microphones, and GH uses just 2 microphones, so in theory Amazon Echo should be better, but in reality software may be way more important than hardware… Anyways I don’t have Amazon Echo, so I can’t compare them.
I hope the competition will improve both of them :slight_smile:

1 Like

Does this mean, that I can add the Blynk App directly to Google Home like shown on the screenshot?
And then I can control blynk with voice command?
Maybe it is that simple and this is why no-one is talking about it.

it is Sinric that passes your Google Home voice commands to your Blynk App. & ESP8266.
you need to get Sinric first then add it to your working Blynk sketch.

here you can find examples :slight_smile:

This seems to be double up. Now we have another server involved. Why can Google not connect with the Blynk server?

i think blynk team not doing that because

  1. it will make grip more users to use Blynk cloud just as a gateway server to redirect the requests to GH or Alexa
  2. will raise the operation cost of blynk servers because of the undesired traffic and processing power required etc.
  3. it will take the great blynk platform out of it’s scope.
  4. this should be in the paid plans so blynk still continue generating revenue and keep the R&D for more great features

everybody knows that the blynk power we purchased for almost no money is way far from even the servers cost
no need to mention the development team and rent , etc i think @Dmitriy and the rest of the great team should know the we like there platform an wish them a great future

1 Like

This is in our roadmap. We are limited in resources so we have to prioritize new features.

The server cost is covered, no worries here :slight_smile:.

2 Likes

This was Pavel (Founder of Blynk) answer for “Is there plans for Google Home support?” few lines above ( post 3)

1 Like