I am trying to combine different aspects of my Smart home into the blynk control panel. Simply, I have a smart bulb that can be activated by sending a webhook request. One way to do so will be to make a button on virtual pin assigned on a connected device (esp8266 in my case), and using the webhook widget to make a HTTP POST request like following:
The webrequest is in form of:
https://maker.ifttt.com/trigger/{event}/with/key/XXXXXXXXX
This triggers an IFTTT event like this:
This is fine, but only acts as a push button toggle, instead of a switch - as webhook widget just triggers on any write.
What I am hoping to do is make the http request on code side, so that I can use the button like a switch in following manner:
BLYNK_WRITE(V32){
int SwitchStatus = param.asInt();
if (SwitchStatus == 1){
http request for switching ON;
}
else if (SwitchStatus == 0){
http request for switching OFF;
}
}
What are the corresponding conditions to do such a thing, and what libraries do I need apart from the ones that are needed to connect the esp8266 to internet (esp8266wifi, arduinoOTA, Blynkesp8266)