How to use the trigger options in the Portal

Related to the Portal
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: How to use the trigger options in the Portal

Post by rimai »

Just to confirm, but you do have this on the features file, righ?

Code: Select all

#define ENABLE_EXCEED_FLAGS
Roberto.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: How to use the trigger options in the Portal

Post by rimai »

I tested your code and got the same thing I posted earlier.
Seems it is working fine here.
Roberto.
lukeluke
Posts: 88
Joined: Mon Apr 04, 2011 4:12 am
Location: Rome, Italy

Re: How to use the trigger options in the Portal

Post by lukeluke »

i try it now...and it's work

<RA><T1>266</T1><T2>0</T2><T3>0</T3><PH>924</PH><R>11</R><RON>0</RON><ROFF>255</ROFF><ATOLOW>0</ATOLOW><ATOHIGH>0</ATOHIGH><EM>0</EM><REM>0</REM><PWMA>0</PWMA><PWMD>0</PWMD><C0>1</C0><C1>0</C1><C2>0</C2><C3>0</C3><C4>0</C4><C5>0</C5><C6>0</C6><C7>0</C7></RA>
lukeluke
Posts: 88
Joined: Mon Apr 04, 2011 4:12 am
Location: Rome, Italy

Re: How to use the trigger options in the Portal

Post by lukeluke »

Hi,
i enable the Portal in my .ino code, and it' s work.

Now, i have the ATO in Alarms :

<RA><T1>270</T1><T2>0</T2><T3>0</T3><PH>665</PH><R>15</R><RON>0</RON><ROFF>255</ROFF><ATOLOW>0</ATOLOW><ATOHIGH>1</ATOHIGH><EM>0</EM><REM>0</REM><PWMA>0</PWMA><PWMD>0</PWMD><C0>1</C0><C1>0</C1><C2>0</C2><C3>0</C3><C4>0</C4><C5>0</C5><C6>0</C6><C7>0</C7></RA>

i set the trigger, but the portal don't send the email.

Image

Image

What is wrong ?
lukeluke
Posts: 88
Joined: Mon Apr 04, 2011 4:12 am
Location: Rome, Italy

Re: How to use the trigger options in the Portal

Post by lukeluke »

Roberto, have any news?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: How to use the trigger options in the Portal

Post by rimai »

Yes, it should've been fixed a while ago.
Sorry I forgot to post.
Can you try?
Roberto.
lukeluke
Posts: 88
Joined: Mon Apr 04, 2011 4:12 am
Location: Rome, Italy

Re: How to use the trigger options in the Portal

Post by lukeluke »

rimai wrote:Yes, it should've been fixed a while ago.
Sorry I forgot to post.
Can you try?
i don't try it....

but,
do you think is possible add at the trigger a lable ?

for example i set this:

T1 <= 23.7
T1 >= 27.5
RON > 0
C0 = 1
C1 = 1

Is possible add a lable, so the email object use it ?

Like :

T1 <= 23.7 Label: Water temp too low
T1 >= 27.5 Label: Water temp too high
RON > 0 Label: test
C0 = 1 Label: ATO Alarm
C1 = 1 Label: Overheat Alarm

Do you think is possible configure a rearm ?

TNX ;-)
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: How to use the trigger options in the Portal

Post by rimai »

I think it already sends the trigger as well as the actual value, so you know exactly what happened.
The trigger is always active and will send alerts every consecutive hour if the alert condition is still active.
Roberto.
btorrenga
Posts: 100
Joined: Mon Apr 16, 2012 10:22 pm

Re: How to use the trigger options in the Portal

Post by btorrenga »

I am trying to do similar. I would like to set a custom variable when the ATO timeout is exceeded. The code compiles fine, but my custom variable is not set for some reason. Here are (I think) the relevant portions of my ino file:

Code: Select all

/* The following features are enabled for this File: 

#define DisplayImages
#define SetupExtras
#define OverheatSetup
#define DateTimeSetup
#define VersionMenu
#define wifi
#define SaveRelayState
#define RelayExp
#define InstalledRelayExpansionModules 1
#define DosingPumpIntervalSetup
#define WDT
#define CUSTOM_MENU
#define CUSTOM_MENU_ENTRIES 9
#define CUSTOM_MAIN
#define COLORS_PDE
#define ENABLE_ATO_LOGGING
#define ENABLE_EXCEED_FLAGS
#define IOEXPANSION
#define FONT_8x8
#define FONT_8x16
#define FONT_12x16
#define NUMBERS_8x8
#define NUMBERS_8x16
#define NUMBERS_12x16
#define NUMBERS_16x16
#define CUSTOM_VARIABLES

*/


#include <ReefAngel_Features.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>
#include <RA_ATO.h>
#include <RA_Joystick.h>
#include <LED.h>
#include <RA_TempSensor.h>
#include <Relay.h>
#include <Timer.h>
#include <Memory.h>
#include <IO.h>
#include <ReefAngel.h>
#include <RA_PWM.h>
#include <avr/pgmspace.h>

.
.
.


void MyCustomATO(int ATOTimeout)
{
    /*
    This function works as follows:

    When it's time to topoff the system, we check the levels of each
    of the three reservoirs.  If a reservoir is empty, we set a custom
    flag to indicate it's empty on the portal and we do not start that
    pump.  Otherwise, we clear the custom flag for the reservoir and
    start the pump.
    The function monitors the switch levels like normal.
    Monitor the status of the reservoirs while topping off.
    When the high switch is triggered (aka, finished topping off), 
    ALL ports are turned off regardless of status (doesn't hurt to do this).
    If the timeout occurs, the LED light comes on and all ports are 
    turned off just like when we finish topping off.
    
    */
    unsigned long TempTimeout = ATOTimeout;
    TempTimeout *= 1000;

    if ( ReefAngel.LowATO.IsActive() && ( !ReefAngel.LowATO.IsTopping()) )
    {
        ReefAngel.LowATO.Timer = millis();
        ReefAngel.LowATO.StartTopping();

        // Check the level of each reservoir
        // If empty, set the alert and don't start topping off
        // otherwise if not empty, clear the alert and start topping
        CheckReservoirStatus(0, Port5);
        CheckReservoirStatus(1, Port6);
        CheckReservoirStatus(2, Box1_Port5);
    }

    // Monitor levels while topping off, to prevent a reservoir from running dry
    // Might need to remove this check here -- Nope, this seems to work fine.
    
    if ( ReefAngel.LowATO.IsTopping() )
    {
        CheckReservoirStatus(0, Port5);
        CheckReservoirStatus(1, Port6);
        CheckReservoirStatus(2, Box1_Port5);
    }

    if ( ReefAngel.HighATO.IsActive() )
    {
        ReefAngel.LowATO.StopTopping();  // stop the low ato timer
        ReefAngel.Relay.Off(Port5);
        ReefAngel.Relay.Off(Port6);
        ReefAngel.Relay.Off(Box1_Port5);
    }

    if ( (millis()-ReefAngel.LowATO.Timer > TempTimeout) && ReefAngel.LowATO.IsTopping() )
    {
        ReefAngel.LED.On();
#ifdef ENABLE_EXCEED_FLAGS
        InternalMemory.write(ATO_Exceed_Flag, 1);
#endif  // ENABLE_EXCEED_FLAGS
        ReefAngel.Relay.Off(Port5);
        ReefAngel.Relay.Off(Port6);
        ReefAngel.Relay.Off(Box1_Port5);
#ifdef ENABLE_ATO_LOGGING
        // bump the counter if a timeout occurs
        AtoEventCount++;
        if ( AtoEventCount >= MAX_ATO_LOG_EVENTS ) { AtoEventCount = 0; }
#endif  // ENABLE_ATO_LOGGING
    }
}

.
.
.

loop section:


//If the ATO float switch is stuck, and the topoff pump timeout flag is set, then set C5=1
if ( InternalMemory.read(ATO_Exceed_Flag) == 1 )
{
ReefAngel.CustomVar[5]=1;
}
else
{
ReefAngel.CustomVar[5]=0;
}
When compiling I get this output, which I think indicates the exceed flagging is enabled, and which I think is required for the custom ATO function to set the ato flag properly:

Code: Select all

The following feature was automatically added:
Watchdog Timer
Version Menu

The following features were detected:
Dimming Signal
I/O Expansion Module
Wifi
Relay Expansion Module
Number of Relay Expasions: 1
Custom Main Screen
Custom Menu
Number of Menu Options: 9
Custom Variable
Exceed Flagging
Extra Font - Medium Size (8x8 pixels)
Extra Font - Large Size (8x16 pixels)
Extra Font - Extra Large Size (12x16 pixels)
Extra Font - Numbers Only - Medium Size (8x8 pixels)
Extra Font - Numbers Only - Large Font (8x16 pixels)
Extra Font - Numbers Only - Extra Large Font (12x16 pixels)
Extra Font - Numbers Only - Huge Font (16x16 pixels)
Date/Time Setup Menu
Binary sketch size: 41,740 bytes (of a 258,048 byte maximum)
What the heck am I missing?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: How to use the trigger options in the Portal

Post by rimai »

Just to be sure, you do have MyCustomATO() inside loop(), correct?
Other than that, everything looks good.
Does the red status led turn on when the you get ato timeout?
Roberto.
btorrenga
Posts: 100
Joined: Mon Apr 16, 2012 10:22 pm

Re: How to use the trigger options in the Portal

Post by btorrenga »

Yes, MyCustomATO() is inside loop(), and the red status light comes on. I just retested it all to make sure, too. Here is the (now lengthy) code:

Code: Select all

/* The following features are enabled for this File: 

#define DisplayImages
#define SetupExtras
#define OverheatSetup
#define DateTimeSetup
#define VersionMenu
#define wifi
#define SaveRelayState
#define RelayExp
#define InstalledRelayExpansionModules 1
#define DosingPumpIntervalSetup
#define WDT
#define CUSTOM_MENU
#define CUSTOM_MENU_ENTRIES 9
#define CUSTOM_MAIN
#define COLORS_PDE
#define ENABLE_ATO_LOGGING
#define ENABLE_EXCEED_FLAGS
#define IOEXPANSION
#define FONT_8x8
#define FONT_8x16
#define FONT_12x16
#define NUMBERS_8x8
#define NUMBERS_8x16
#define NUMBERS_12x16
#define NUMBERS_16x16
#define CUSTOM_VARIABLES

*/


#include <ReefAngel_Features.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>
#include <RA_ATO.h>
#include <RA_Joystick.h>
#include <LED.h>
#include <RA_TempSensor.h>
#include <Relay.h>
#include <Timer.h>
#include <Memory.h>
#include <IO.h>
#include <ReefAngel.h>
#include <RA_PWM.h>
#include <avr/pgmspace.h>

////// Place global variable code below here
// Initialize Buzzer variables
// the follow variables is a long because the time, measured in miliseconds,
// will quickly become a bigger number than can be stored in an int.
long buzzerinterval = 1000;           // interval at which to sound buzzer (milliseconds)
long previousMillis = 0;

////// Place global variable code above here


prog_char menu1_label[] PROGMEM = "Feeding";
prog_char menu2_label[] PROGMEM = "Water Change";
prog_char menu3_label[] PROGMEM = "ATO Clear";
prog_char menu4_label[] PROGMEM = "Overheat Clear";
prog_char menu5_label[] PROGMEM = "PH Calibration";
prog_char menu6_label[] PROGMEM = "Date / Time";
prog_char menu7_label[] PROGMEM = "Version";
prog_char menu8_label[] PROGMEM = "Turn ON/OFF Skimmer";
prog_char menu9_label[] PROGMEM = "Turn Off Skimmer";
// Group the menu entries together
PROGMEM const char *menu_items[] = {
menu1_label, menu2_label, menu3_label,
menu4_label, menu5_label, menu6_label,
menu7_label, menu8_label, menu9_label
};
    
void MenuEntry1()
{
ReefAngel.FeedingModeStart();
}
void MenuEntry2()
{
ReefAngel.WaterChangeModeStart();
}
void MenuEntry3()
{
ReefAngel.ATOClear();
ReefAngel.DisplayMenuEntry("Clear ATO Timeout");
}
void MenuEntry4()
{
ReefAngel.OverheatClear();
ReefAngel.DisplayMenuEntry("Clear Overheat");
}
void MenuEntry5()
{
ReefAngel.SetupCalibratePH();
ReefAngel.DisplayedMenu = ALT_SCREEN_MODE;
}
void MenuEntry6()
{
ReefAngel.SetupDateTime();
ReefAngel.DisplayedMenu = ALT_SCREEN_MODE;
}
void MenuEntry7()
{
ReefAngel.DisplayVersion();
}
void MenuEntry8()
{
ReefAngel.Relay.Toggle(Box1_Port8);
ReefAngel.Relay.Write();
ReefAngel.DisplayedMenu = ALT_SCREEN_MODE;
}
void MenuEntry9()
{
ReefAngel.Relay.Off(Box1_Port8);
ReefAngel.Relay.Write();
ReefAngel.DisplayedMenu = ALT_SCREEN_MODE;
}

void DrawCustomMain()
{
  ReefAngel.LCD.DrawDate(6, 119);
  pingSerial();
#if defined DisplayLEDPWM && ! defined RemoveAllLights
  ReefAngel.LCD.DrawMonitor(15, 60, ReefAngel.Params,
  ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue());
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
  ReefAngel.LCD.DrawMonitor(15, 60, ReefAngel.Params);
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
  pingSerial();
  // draw main relay
  byte TempRelay = ReefAngel.Relay.RelayData;
  TempRelay &= ReefAngel.Relay.RelayMaskOff;
  TempRelay |= ReefAngel.Relay.RelayMaskOn;
  ReefAngel.LCD.DrawOutletBox(12, 93, TempRelay);
#ifdef RelayExp
  pingSerial();
  // draw 1st expansion relay
  TempRelay = ReefAngel.Relay.RelayDataE[0];
  TempRelay &= ReefAngel.Relay.RelayMaskOffE[0];
  TempRelay |= ReefAngel.Relay.RelayMaskOnE[0];
  ReefAngel.LCD.DrawOutletBox(12, 105, TempRelay);
#endif  // RelayExp
}
void DrawCustomGraph()
{
  // Change the 45 to adjust the horizontal position of the text 
  ReefAngel.LCD.DrawGraph(5, 5);
}


void CheckReservoirStatus(byte channel, byte pump)
{
    if ( ReefAngel.IO.GetChannel(channel) )
    {
        // If empty, shutoff the port, trigger alert
        ReefAngel.CustomVar[channel] = 1;
        ReefAngel.Relay.Off(pump);
    }
    else
    {
        // If not empty, turn on the port, clear alert
        ReefAngel.CustomVar[channel] = 0;
        ReefAngel.Relay.On(pump);
    }
}


void MyCustomATO(int ATOTimeout)
{
    /*
    This function works as follows:

    When it's time to topoff the system, we check the levels of each
    of the three reservoirs.  If a reservoir is empty, we set a custom
    flag to indicate it's empty on the portal and we do not start that
    pump.  Otherwise, we clear the custom flag for the reservoir and
    start the pump.
    The function monitors the switch levels like normal.
    Monitor the status of the reservoirs while topping off.
    When the high switch is triggered (aka, finished topping off), 
    ALL ports are turned off regardless of status (doesn't hurt to do this).
    If the timeout occurs, the LED light comes on and all ports are 
    turned off just like when we finish topping off.
    
    */
    unsigned long TempTimeout = ATOTimeout;
    TempTimeout *= 1000;

    if ( ReefAngel.LowATO.IsActive() && ( !ReefAngel.LowATO.IsTopping()) )
    {
        ReefAngel.LowATO.Timer = millis();
        ReefAngel.LowATO.StartTopping();

        // Check the level of each reservoir
        // If empty, set the alert and don't start topping off
        // otherwise if not empty, clear the alert and start topping
        CheckReservoirStatus(0, Port5);
        CheckReservoirStatus(1, Port6);
        CheckReservoirStatus(2, Box1_Port5);
    }

    // Monitor levels while topping off, to prevent a reservoir from running dry
    // Might need to remove this check here -- Nope, this seems to work fine.
    
    if ( ReefAngel.LowATO.IsTopping() )
    {
        CheckReservoirStatus(0, Port5);
        CheckReservoirStatus(1, Port6);
        CheckReservoirStatus(2, Box1_Port5);
    }

    if ( ReefAngel.HighATO.IsActive() )
    {
        ReefAngel.LowATO.StopTopping();  // stop the low ato timer
        ReefAngel.Relay.Off(Port5);
        ReefAngel.Relay.Off(Port6);
        ReefAngel.Relay.Off(Box1_Port5);
    }

    if ( (millis()-ReefAngel.LowATO.Timer > TempTimeout) && ReefAngel.LowATO.IsTopping() )
    {
        ReefAngel.LED.On();
#ifdef ENABLE_EXCEED_FLAGS
        InternalMemory.write(ATO_Exceed_Flag, 1);
#endif  // ENABLE_EXCEED_FLAGS
        ReefAngel.Relay.Off(Port5);
        ReefAngel.Relay.Off(Port6);
        ReefAngel.Relay.Off(Box1_Port5);
#ifdef ENABLE_ATO_LOGGING
        // bump the counter if a timeout occurs
        AtoEventCount++;
        if ( AtoEventCount >= MAX_ATO_LOG_EVENTS ) { AtoEventCount = 0; }
#endif  // ENABLE_ATO_LOGGING
    }
}

void setup()
{
    // This must be the first line
    ReefAngel.Init();  //Initialize controller
    // Initialize the custom menu
    ReefAngel.InitMenu(pgm_read_word(&(menu_items[0])),SIZE(menu_items));

    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = Port8Bit;
    ReefAngel.FeedingModePortsE[0] = Port4Bit | Port7Bit;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port2Bit | Port4Bit;
    ReefAngel.OverheatShutoffPortsE[0] = Port1Bit | Port2Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = Port4Bit;
    ReefAngel.LightsOnPortsE[0] = Port1Bit | Port3Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port2Bit | Port5Bit | Port6Bit | Port8Bit;
    ReefAngel.WaterChangePortsE[0] = Port2Bit | Port5Bit | Port6Bit | Port8Bit;

    // Ports that are always on
    ReefAngel.Relay.On(Port3);
    ReefAngel.Relay.On(Port8);
    ReefAngel.Relay.On(Box1_Port4);
    ReefAngel.Relay.On(Box1_Port7);
    ReefAngel.Relay.On(Box1_Port8);
    ////// Place additional initialization code below here
    ReefAngel.OverheatProbe = T1_PROBE; // Use Temperature probe 1 to check for overheat




    ////// Place additional initialization code above here
}

void loop()
{
    // Specific functions that use Internal Memory values
    ReefAngel.StandardLights(Port1,23,0,2,0); // Moon lights on 23:00-02:00
    ReefAngel.StandardHeater(Port2,780,790); // 800w heater on at 78.0, off at 79.0
    ReefAngel.MHLights(Port4); // MH on 14:00-22:00, delay 15m if power fails
    ReefAngel.StandardLights(Port7,21,0,13,0); // Sump lights on 21:00-13:00
    ReefAngel.MHLights(Box1_Port1); // MH on 14:00-22:00, delay 15m if power fails
    ReefAngel.StandardHeater(Box1_Port2); // 250w heater on at 78.5, off at 79.0
    ReefAngel.StandardLights(Box1_Port3); // Actinics on 13:00-23:00
    ////// Place your custom code below here
    //ATO function
    MyCustomATO(InternalMemory.ATOTimeout_read());
    
    //Notify when sump level is low
    if ( ReefAngel.IO.GetChannel(4) )
    {
      ReefAngel.CustomVar[4]=1;
        // If the sump level is about to cavitate the pumps, then sound the alarm
        unsigned long currentMillis = millis();
        if(currentMillis - previousMillis > buzzerinterval) {
    // save the last time the buzzer turned on 
    previousMillis = currentMillis;   
    // if the buzzer is off turn it on and vice-versa:
    if (ReefAngel.PWM.GetDaylightValue() == 0)
      ReefAngel.PWM.SetDaylight(25);
    else
      ReefAngel.PWM.SetDaylight(0);
  }
    }
    else
    {
        // Turn the buzzer off when the sump level is above cavitation levels
        ReefAngel.PWM.SetDaylight(0);
        ReefAngel.CustomVar[4]=0;
    }

//If the ATO float switch is stuck, and the topoff pump timeout flag is set, then set C5=1
if ( InternalMemory.read(ATO_Exceed_Flag) == 1 )
{
ReefAngel.CustomVar[5]=1;
}
else
{
ReefAngel.CustomVar[5]=0;
}
    
//Vodka dosing 
      if ( ReefAngel.IO.GetChannel(3) )  //Check there is vodka in the reservoir
  {
    ReefAngel.Relay.Off(Box1_Port6);  //If no vodka, then set a variable and turn off the port
    ReefAngel.CustomVar[3]=1;
  }
  else  //If there is vodka, then dose
  {
    ReefAngel.CustomVar[3]=0;
    ReefAngel.DosingPumpRepeat1(Box1_Port6);
  }
    ////// Place your custom code above here
    // This sends all the data to the portal
    // Do not add any custom code that changes any relay status after this line
    // The only code after this line should be the ShowInterface function
    ReefAngel.Portal("btorrenga");

    // This should always be the last line
    ReefAngel.ShowInterface();
}
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: How to use the trigger options in the Portal

Post by rimai »

How about the other custom variables??
Are they working?
Roberto.
btorrenga
Posts: 100
Joined: Mon Apr 16, 2012 10:22 pm

Re: How to use the trigger options in the Portal

Post by btorrenga »

All the other variables are working great. I have been testing them all afternoon and am very pleased.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: How to use the trigger options in the Portal

Post by rimai »

Try doing this instead to see what values you are getting:

Code: Select all

ReefAngel.CustomVar[5]=InternalMemory.read(ATO_Exceed_Flag);
Technically, it should be the same thing, but simplified.
Roberto.
btorrenga
Posts: 100
Joined: Mon Apr 16, 2012 10:22 pm

Re: How to use the trigger options in the Portal

Post by btorrenga »

Getting some results now. The values I have seen reported in the portal have been 181, 191, 255 and 255. I am not sure how those numbers are determined, but at least something is happening. I assumed the value of ATO_Exceed_Flag would be 1 or 0 only. How is the value determined?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: How to use the trigger options in the Portal

Post by rimai »

Weird.
It should be 0 or 1.

Code: Select all

InternalMemory.write(ATO_Exceed_Flag, 1);
This line writes 1 and when you clear ATO timeout, it writes 0.
Roberto.
btorrenga
Posts: 100
Joined: Mon Apr 16, 2012 10:22 pm

Re: How to use the trigger options in the Portal

Post by btorrenga »

I would expect that behavior, too. I have cleared the ATO and now ATO_Exceed_Flag is reporting to the portal as 254.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: How to use the trigger options in the Portal

Post by rimai »

Can you add this to your loop() and open Tools->Serial Monitor and see what you get?

Code: Select all

Serial.print("CustomVar[5]: ");
Serial.println(InternalMemory.read(ATO_Exceed_Flag));
Make sure to set Serial Monitor to use 57600 baud.
Roberto.
alexwbush
Posts: 327
Joined: Tue Mar 22, 2011 12:45 am
Location: San Diego, CA

Re: How to use the trigger options in the Portal

Post by alexwbush »

what is the water level variable? I'd like to see a graph.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: How to use the trigger options in the Portal

Post by rimai »

I update the list.
Roberto.
alexwbush
Posts: 327
Joined: Tue Mar 22, 2011 12:45 am
Location: San Diego, CA

Re: How to use the trigger options in the Portal

Post by alexwbush »

you're the man!
wtitb
Posts: 32
Joined: Sun Nov 17, 2013 3:32 pm

Re: How to use the trigger options in the Portal

Post by wtitb »

Hi,

there is also a trigger simply called "Alarm". Can this be used to get notified whenever any alarm occures? If so, what are its values?

cheers,
Christian
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: How to use the trigger options in the Portal

Post by rimai »

No, that tag is for a new input port that is reserved for a future product.
Roberto.
Ferdi
Posts: 31
Joined: Thu Jan 02, 2014 1:02 pm

Re: How to use the trigger options in the Portal

Post by Ferdi »

Hi Guys,

Read the hole thread and uhm ya, i have no knowledge of programing or coding.

Played around with the portal settings and can't seem to get my trigger saved. What i want to do is for RA to inform me when my pump stops working. Port 8 = return pump. ROFF8 <= "what needs to be put in here"

Hope you understand whatim trying to explaine.

Thanks in advance
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: How to use the trigger options in the Portal

Post by lnevo »

You can't do that unfortunately. What we need is bitwise operators in the portal settings. Maybe their there I haven't looked in a bit.

ROFF8 represents an 8 bit byte that represents the OFF overrides on the 8th Relay expansion.

The easier way to do what you want is add code like this into your custom section in the loop() function

ReefAngel.CustomVar[0]=ReefAngel.Relay.Status(Port8);
ReefAngel.CustomVar[7]=255;

What this will do is the following C0 in the portal will then match the status of the port. I believe 0 is off and 1 is on, but it could be reversed, I forget. C7 being 255 will make sure you always have the Custom Variables activated. It's really just a dummy variable to make sure the portal has this feature turned on.

Now that you have the status of your pump in one of the CustomVariables, you can set your trigger for C0 and you can alarm if it's 0 or 1 or whatever it is when it's not on :)

I know this sounds confusing and I'm not sure why the relay status variables are even in the portal alert options without having bitwise operators to act on them, they are kind of pointless. Even more so, sometimes to find the true status you need to combine them with each other. It would be great to have that functionality... but it would also be very confusing because now people will need to learn how to do bitwise operations. Obviously this piece of the alerting needs some help .. *cough* *cough* :)
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: How to use the trigger options in the Portal

Post by rimai »

I have changed the Portal today to allow for individual ports to be used.
Let me know how it works out for you.
Roberto.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: How to use the trigger options in the Portal

Post by lnevo »

Awesome!!!! Will def try that out!!
Post Reply