Issue in sending Temperature Sensor Value to Google Asst via IFTTT

Hi,

I have successfully created the temperature monitor using the the below provided hardware and the code provided. I now want to get the temperature details on Google Assistant. I tried using the IFTTT +Webhook to get the Virtual Pin Data did not get any success. I have tried using content type as Jas0n and Text/Plain.

Hardware:
ESP8266 + ds18b20 (Temperature Sensor)



//#include <WiFiClientSecure.h>
#include <BlynkSimpleEsp8266.h>
#include <SoftwareSerial.h>
#include <Blynk.h>
#include <OneWire.h>
#include <DallasTemperature.h>

char auth[] = "xxxxxx";               //Input your AUTH CODE here
char ssid[] = "xxxxxx";               //Input your Wifi/Network Name here
char pass[] = "xxxxxx";               //Input your Wifi/Network password here

const int oneWireBus = 5;           //gpio 5     
OneWire oneWire(oneWireBus);
DallasTemperature sensors(&oneWire);

void setup()
{
  // Debug console
  
  Serial.begin(9600);
Blynk.begin(auth, ssid, pass);

  sensors.begin();
}

void loop()
{
  sensors.requestTemperatures(); 
  float temperatureC = sensors.getTempCByIndex(0)+2.45;
  Blynk.virtualWrite(V1,temperatureC);
  Blynk.run();
}```

@Nandan_Nansi please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```

Pete.

@PeteKnight thanks have made the required changes in the post.

First of all, you cant do this in your void loop…

You are attempting to read the sensor values and then send to Blynk on every cycle of the void loop, which should be hundreds of times per second.
You sensor probably isn’t designed to handle this, and sending more than 10 virtual writes per second will flood the Blynk server.

Read this explanation of the issue and how to solve it using a timer…

http://help.blynk.cc/getting-started-library-auth-token-code-examples/blynk-basics/keep-your-void-loop-clean

Secondly, you are writing the temperature value to Blynk virtual Pin 1 (V1) but querying digital pin 4 (D4) in IFTTT for the temperature value. There is no link between V1 and D4, so you will never retrieve the temperature by doing this.

Thirdly, you are trying to use the GET command syntax which will update the pin (with value 0 from the optional body part of the IFTTT recipe).

The correct IFTTT command is blynk_server_ip/auth_token/get/V1 in the URL part of the recipe and nothing in the body.

Fourthly, as you’ve obviously picked-up this example IFTTT recipe from somewhere on the forum without understanding what it does, I assume that you haven’t actually checked if 188.166.206.43 is the correct IP address for the Blynk server where your project lives. To do this you should open a command prompt on your PC and ping blynk-cloud.com

Finally, I assume that you have actually used your auth code in the IFTTT recipe rather than xxx ?

Pete.

3 posts were split to a new topic: Getting temperature feedback in Google Assistant with IFTTT