addition forwarding

This commit is contained in:
mrcory
2020-04-01 14:48:14 -04:00
parent b343d086cf
commit eefc30c1cb
2 changed files with 24 additions and 0 deletions
+19
View File
@@ -4,6 +4,20 @@
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
Blynk.virtualWrite(V49,temp.cur);
@@ -16,6 +30,11 @@ void sendBlynk() { //Feedback to the Blynk app
#else
Blynk.virtualWrite(V61,0);
#endif
#ifdef forwardTemp
blynkBridge1.virtualWrite(V51,temp.cur);
#endif
}
BLYNK_WRITE(V51) {
+5
View File
@@ -4,6 +4,7 @@
//to identify the device for OTA updates.
#define deviceName "Heater"
/*Uncomment the operating mode you wish to use.
* 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
@@ -34,3 +35,7 @@ int cooldownPeriod = 30;
// Attempts before giving up and leaving relay off until reset
#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