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.
SINRIC Simple RGB Led strip activated with Google Home Voice .(natural speech commands)
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}}
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);
}
}
//---------------------------------
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.
-
Goto Sinric.com. register for an account if you do not have one (Use Chrome, FireFox)
-
Log in and create a smart home device
-
Copy your API Key
-
Connect.
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.
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)
Yeah, I’m happy that Google understood the problem eventually
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.
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
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
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
- it will make grip more users to use Blynk cloud just as a gateway server to redirect the requests to GH or Alexa
- will raise the operation cost of blynk servers because of the undesired traffic and processing power required etc.
- it will take the great blynk platform out of it’s scope.
- 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
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 .
This was Pavel (Founder of Blynk) answer for “Is there plans for Google Home support?” few lines above ( post 3)
I am able to use IFTT and Blynk with Google Home, but I now want to make it stateful, for example when I say turn on the lights, it actually checks the status and only turn on if it is off, or tells me that the lights are already turned on, is that possible - Thanks