addition forwarding
This commit is contained in:
+19
@@ -4,6 +4,20 @@
|
|||||||
|
|
||||||
bool resetFlag = false;
|
bool resetFlag = false;
|
||||||
|
|
||||||
|
// This function runs every time Blynk connection is established.
|
||||||
|
BLYNK_CONNECTED()
|
||||||
|
{
|
||||||
|
if ( isFirstConnect )
|
||||||
|
{
|
||||||
|
Blynk.syncAll();
|
||||||
|
isFirstConnect = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef forwardTemp
|
||||||
|
blynkBridge1.setAuthToken(forwardAuth); // Device to forward to
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void sendBlynk() { //Feedback to the Blynk app
|
void sendBlynk() { //Feedback to the Blynk app
|
||||||
Blynk.virtualWrite(V49,temp.cur);
|
Blynk.virtualWrite(V49,temp.cur);
|
||||||
@@ -16,6 +30,11 @@ void sendBlynk() { //Feedback to the Blynk app
|
|||||||
#else
|
#else
|
||||||
Blynk.virtualWrite(V61,0);
|
Blynk.virtualWrite(V61,0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef forwardTemp
|
||||||
|
blynkBridge1.virtualWrite(V51,temp.cur);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
BLYNK_WRITE(V51) {
|
BLYNK_WRITE(V51) {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
//to identify the device for OTA updates.
|
//to identify the device for OTA updates.
|
||||||
#define deviceName "Heater"
|
#define deviceName "Heater"
|
||||||
|
|
||||||
|
|
||||||
/*Uncomment the operating mode you wish to use.
|
/*Uncomment the operating mode you wish to use.
|
||||||
* Normal - Used for heating. If temp.cur < desired, turn on
|
* Normal - Used for heating. If temp.cur < desired, turn on
|
||||||
* Inverse - Operates in the inverse. If temp.cur > desired turn on | This mode could be used for an exhaust fan to limit
|
* Inverse - Operates in the inverse. If temp.cur > desired turn on | This mode could be used for an exhaust fan to limit
|
||||||
@@ -34,3 +35,7 @@ int cooldownPeriod = 30;
|
|||||||
|
|
||||||
// Attempts before giving up and leaving relay off until reset
|
// Attempts before giving up and leaving relay off until reset
|
||||||
#define loadConnectAttempts 3
|
#define loadConnectAttempts 3
|
||||||
|
|
||||||
|
//If you wish to forward the temperature to another device uncomment this line.
|
||||||
|
//And, add the token in "blynk.h"
|
||||||
|
#define forwardTemp
|
||||||
|
|||||||
Reference in New Issue
Block a user