hello guys i have made a project that control the light switch on&off through google Assistant with the help of this video i made it “https://www.youtube.com/watch?v=5SvRolROPxA” and i have integrated temperature sensor to the nodemcu and the readings are from nodemcu and displayed via blynk app and now what i need is if ask google assistant about my room temperature it should get reading from node mcu and tell me the temperature this is the code i have used
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <SPI.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
#include <DHT.h>
// float DHT11_h;
// float DHT21_h;
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "XXXXXXXXXXXXXXXXX5";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "home WIFI";
char pass[] = "shXXXXXXXX";
DHT dht1(D7,DHT11);
DHT dht2(D8,DHT11);
SimpleTimer timer;
void sendSensor()
{
float DHT11_h = dht1.readHumidity();
float DHT11_t = dht1.readTemperature(); // or dht.readTemperature(true) for Fahrenheit
if (isnan(DHT11_h) || isnan(DHT11_t)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// You can send any value at any time.
// Please don't send more that 10 values per second.
Blynk.virtualWrite(V5, DHT11_h);
Blynk.virtualWrite(V6, DHT11_t);
//sensor 2
float DHT21_h = dht2.readHumidity();
float DHT21_t = dht2.readTemperature(); // or dht.readTemperature(true) for Fahrenheit
if (isnan(DHT21_h) || isnan(DHT21_t)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// You can send any value at any time.
// Please don't send more that 10 values per second.
Blynk.virtualWrite(V3, DHT21_h);
Blynk.virtualWrite(V4, DHT21_t);
}
BLYNK_WRITE(V1)
{
int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
// You can also use:
// String i = param.asStr();
// double d = param.asDouble();
Serial.print("V1 Slider value is: ");
Serial.println(pinValue);
}
void setup()
{
Serial.begin(9600); // See the connection status in Serial Monitor
Blynk.begin(auth, ssid, pass);
dht2.begin();
dht1.begin();
// Setup a function to be called every second
timer.setInterval(1000L, sendSensor);
}
void loop()
{
Blynk.run(); // Initiates Blynk
timer.run(); // Initiates SimpleTimer
}
and the mechanism how my google and nodemcu working is on requesting anything from my mobile is
google assistant–>IFTTT–>Webhook–>blynk server request–>nodmcu
and now i need reverse of that mechanism please any ideas or anyone help me with this issue