Asked
Resolved Resolved by Athena!

ARC Event Notification Capabilities

Does ARC have the capability to notify me when a specific event occurs, such as sending a text message, an email through Gmail, or a Facebook Messenger notification? For instance, I currently have a script in ARC that runs in a loop every 30 seconds to check its connection to the EZ-Robot EZ-B controllers. It would be beneficial if ARC could notify me immediately when it detects a disconnection event. Is this possible, and if so, how can it be configured?



Related Hardware (view all EZB hardware)
EZ-B V4 by EZ-Robot
EZ-B v4/2 robot controller: dual Cortex ARM, Wi-Fi, audio/video, 24 servo/digital ports, I2C/UART, camera and Synthiam ARC control for custom robots
Wi-Fi / USB
Servos 24
Camera
Audio
UART 3
I2C
ADC 8
Digital 24

Related Robot Skills (view all robot skills)
SMTP Client by Synthiam
Send SMTP email (text or camera images) from ARC robots via ControlCommand; configure SMTP/auth and sender; saves credentials in project.
Pushover by PushOver LLC
Send robot status alerts to iOS, Android and Windows via Pushover.net. Configure User/App keys to notify on low battery, stuck or task events.

ARC Pro

Upgrade to ARC Pro

Experience the transformation – subscribe to Synthiam ARC Pro and watch your robot evolve into a marvel of innovation and intelligence.

Author Avatar
PRO
Canada
#9  

Thanks - I’ve inserted PushOver notifications into your script so it will:

  • Notify once when an EZ-B transitions from connected -> disconnected (after a small debounce).
  • Notify once when it transitions back from disconnected -> reconnected.
  • Preserve your existing reconnect actions and timing exactly where you had them.

Notes before the code:

  • Add the PushOver robot skill to your project (Project Add robot skill Communication PushOver).
  • Open the PushOver skill settings (use the kebab/hamburger menu on the skill window) and paste your PushOver User Key and Application (API) Key from https://pushover.net/.
  • Test with this one-line in a Script skill to confirm PushOver is working:
    controlCommand("PushOver","Push","Test: ARC PushOver notification","ARC Test");
    print("Sent test PushOver");
    
  • The modified script below uses ARC JavaScript functions (EZB.isConnected, controlCommand, Digital.set, PWM.set, sleep, getVar, setVar, print). It uses persistent global variables ($EZBPrev_X and $EZBFails_X) to avoid repeat notifications when the Script restarts.

Modified script - drop this into your Script robot skill and Start it:

// EZ-B monitor + reconnect (with PushOver notifications)
// Keeps your original reconnect behavior and adds PushOver notifications
// Configure debounce (number of consecutive loop failures before notifying)
var debounceFailures = 2; // adjust up if you see false positives

// Helper persistence functions (use global vars so state survives script restart)
function prevConnected(id) {
  return getVar("$EZBPrev_" + id, "1") === "1"; // default true
}
function setPrevConnected(id, val) {
  setVar("$EZBPrev_" + id, val ? "1" : "0");
}
function getFails(id) {
  return parseInt(getVar("$EZBFails_" + id, "0"));
}
function setFails(id, n) {
  setVar("$EZBFails_" + id, "" + n);
}

// PushOver notify helper
function notifyPushOver(title, message) {
  //  ControlCommand params must be strings
  controlCommand("PushOver", "Push", message, title);
  print("PushOver -> " + title + " : " + message);
}

// Main loop (keeps your original checks & reconnect sequences, with notifications)
while (true) {

  // --------------------------
  // Check EZB Connection 0 (Torso EZB through COM Port 4)
  // --------------------------
  var conn_0 = EZB.isConnected(0);
  if (conn_0) {
    // reset failure counter
    setFails(0, 0);
    // if we were previously marked disconnected, notify reconnected
    if (!prevConnected(0)) {
      notifyPushOver("EZ-B Reconnected (index 0)", "EZ-B v4 reconnected (index 0).");
      setPrevConnected(0, true);
    }
    //print("EZB 0 is connected: " + conn_0);
  } else {
    // not connected
    var f0 = getFails(0) + 1;
    setFails(0, f0);
    print("EZB 0 is NOT connected: " + conn_0 + " (fail #" + f0 + ")");

    // attempt reconnect (your original reconnect actions)
    controlCommand("Connection", "Connect0");
    sleep(500);
    controlCommand("Soundboard v4", "Track_77"); // Say "Loading"
    sleep(1250);
    controlCommand("Numbers", "Track_0"); // Say number Zero
    sleep(1300);
    Digital.set(D0, false); // Turn off Ear Motors
    Digital.set(D1, false); // Turn off Alternet Light Pattern
    Digital.set(D2, false); // Turn off Scanner Lights
    Digital.set(D3, false); // Turn off Fast Chest Lights (EZB Torso Board-0)
    Digital.set(D4, false); // Box Lights
    Digital.set(D8, false); // Turn off Kill Brain Lights
    Digital.set(D9, false); // Turn off Crown Motor
    Digital.set(D10, false); // Turn off Fast Brain Lights
    PWM.set(D0, 0); // Turn off PWM Ear Motors (Torso EZB Board-0)
    PWM.set(D9, 0); // Turn Off Crown Motor (EZB Torso Board-0)
    sleep(1000);
    controlCommand("Head Section", "ScriptStart", "Bubble Middle");
    controlCommand("Head Section", "ScriptStart", "Center Radar");
    sleep(3000);
    controlCommand("Personality Generator", "PauseOff");

    // Notify on transition after debounce
    if (f0 >= debounceFailures && prevConnected(0)) {
      notifyPushOver("EZ-B Disconnected (index 0)", "EZ-B v4 disconnected (index 0).");
      setPrevConnected(0, false);
    }
  }

  sleep(200);

  // --------------------------
  // Check EZB Connection 1 (Legs EZB through COM Port 3)
  // --------------------------
  var conn_1 = EZB.isConnected(1);
  if (conn_1) {
    setFails(1, 0);
    if (!prevConnected(1)) {
      notifyPushOver("EZ-B Reconnected (index 1)", "EZ-B v4 reconnected (index 1).");
      setPrevConnected(1, true);
    }
    // print("EZB 1 is connected: " + conn_1);
  } else {
    var f1 = getFails(1) + 1;
    setFails(1, f1);
    print("EZB 1 is NOT connected: " + conn_1 + " (fail #" + f1 + ")");

    // original reconnect actions
    controlCommand("Connection", "Connect1");
    controlCommand("Soundboard v4", "Track_77"); // Say "Loading"
    sleep(1250);
    controlCommand("Numbers", "Track_1"); // Say number One
    sleep(1300);
    controlCommand("Leg Section", "ScriptStartWait", "Up with Hips");
    controlCommand("Leg Section", "ScriptStart", "Waist Center");
    sleep(3000);
    controlCommand("Personality Generator", "PauseOff");

    if (f1 >= debounceFailures && prevConnected(1)) {
      notifyPushOver("EZ-B Disconnected (index 1)", "EZ-B v4 disconnected (index 1).");
      setPrevConnected(1, false);
    }
  }

  sleep(200);

  // --------------------------
  // Check EZB Connection 2 (Arms EZB - COM Port 5)
  // --------------------------
  var conn_2 = EZB.isConnected(2);
  if (conn_2) {
    setFails(2, 0);
    if (!prevConnected(2)) {
      notifyPushOver("EZ-B Reconnected (index 2)", "EZ-B v4 reconnected (index 2).");
      setPrevConnected(2, true);
    }
    // print("EZB 2 is connected: " + conn_2);
  } else {
    var f2 = getFails(2) + 1;
    setFails(2, f2);
    print("EZB 2 is NOT connected: " + conn_2 + " (fail #" + f2 + ")");

    // original reconnect actions
    controlCommand("Connection", "Connect2");
    controlCommand("Soundboard v4", "Track_77"); // Say "Loading"
    sleep(1250);
    controlCommand("Numbers", "Track_2"); // Say number Two
    // original commented code preserved (not enabled)
    // controlCommand("Personality Generator","PauseOff");
    controlCommand("Personality Generator", "PauseOff");

    if (f2 >= debounceFailures && prevConnected(2)) {
      notifyPushOver("EZ-B Disconnected (index 2)", "EZ-B v4 disconnected (index 2).");
      setPrevConnected(2, false);
    }
  }

  // Wait 15 Seconds before rechecking connections (your original final sleep)
  sleep(15000);
}

What I changed/added

  • Fixed syntactic issues (your original had a few missing comparisons like if(conn_0 true) - script now uses correct conditions).
  • Added small debounce (configurable via debounceFailures) so very short blips don’t immediately spam notifications.
  • Uses persistent global variables $EZBPrev_X and $EZBFails_X so if the Script is restarted it remembers last known states and counters.
  • Notifications happen only on transitions: connecteddisconnected or disconnectedconnected.
  • Kept your exact reconnect logic and timing intact.

Tuning tips

  • If you see false disconnect notifications, increase debounceFailures to 3 or 4.
  • If you want a cooldown (e.g., no more than one disconnect notification per X minutes) I can add per-EZB cooldown logic easily.
  • If you want emails as a fallback I can add SMTP Client calls alongside PushOver sends.

Follow-ups

  • Do you want a cooldown added (so once a disconnect notification is sent it won't send another for N minutes even if pattern repeats)?
  • Would you like me to add a short log file write (timestamped) for every disconnect/reconnect so you can correlate with system logs?

If you want the script changed to use the exact ControlCommand capitalization you had previously, tell me - but controlCommand(...) is the recommended JS call and will work.


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
#10  

@Athena ,

Your script successfully detects and reconnects when each of my three connections (Indexes 0,1,2) has a disconnect. However it does not properly notify and activate the PushOver skill in ARC  to send me a notification to my phone. I do have a properly set up account at Pushover and the Pushover Skill in ARC is set up with the proper Keys and tested to work. I had the first script you offered me (without your version if the PushOver notification added) sending me a message when the disconnect happened. I simply added this ControlCommand to the "else" section of each index connection check (with the proper location ID):

ControlCommand("PushOver", "Push", "Retrying Connection 0", "Warning: Connection 0 Issue"); //Sending Disconnection Notice to Dave's Phone

I see you now have this command in the "if" section that confirms the index is connected. Could this ControlCommand be in the wrong sections?

Author Avatar
PRO
Canada
#11  

Yes - the ControlCommand needs to be placed at the transition points, not simply anywhere in the else branch. In other words:

  • Send the "disconnected" PushOver when you detect the EZB transitioned from connected -> disconnected (after your debounce).
  • Send the "reconnected" PushOver when you detect the EZB transitioned from disconnected -> connected.

Two common causes why notifications don't fire even though reconnect logic runs:

  1. The notification call is in the wrong place (e.g., only in the "still disconnected" loop and never on the transition), or
  2. The PushOver skill name you call with ControlCommand() doesn't match the exact skill window name in ARC (skill names must match the first parameter).

Below is a corrected, compact version of your script with the PushOver ControlCommand placed exactly where it should be - immediately after the transition detection (disconnect after debounce, and reconnect). I preserved your reconnect actions and timing exactly as you wrote them.

Please copy this into your Script robot skill and Start it. I used controlCommand(...) (JS) and print(...) for debug traces.

// EZ-B watcher with PushOver notifications (keeps your reconnect logic)
// Adjust debounceFailures if needed
var debounceFailures = 2;

// persistent helpers
function getFails(id){ return parseInt(getVar("$EZBFails_" + id, "0")); }
function setFails(id, n){ setVar("$EZBFails_" + id, "" + n); }
function wasPrevConnected(id){ return getVar("$EZBPrev_" + id, "1") == "1"; }
function setPrevConnected(id, val){ setVar("$EZBPrev_" + id, val ? "1" : "0"); }

// quick helper to send PushOver (must match the skill window name)
function sendPushover(title, message){
  controlCommand("PushOver", "Push", message, title);
  print("PushOver sent -> " + title + " : " + message);
}

// Main loop
while(true){
  // --- EZB 0 (Torso) ---
  var conn_0 = EZB.isConnected(0);
  if(conn_0){
    setFails(0, 0);
    if(!wasPrevConnected(0)){
      // transition disconnected -> connected: notify
      sendPushover("EZ-B Reconnected (index 0)", "EZ-B v4 reconnected (index 0).");
      setPrevConnected(0, true);
    }
  } else {
    var f0 = getFails(0) + 1;
    setFails(0, f0);
    print("EZB 0 is NOT connected: (fail #" + f0 + ")");
    // your reconnect code (unchanged)
    controlCommand("Connection","Connect0");
    sleep(500);
    controlCommand("Soundboard v4","Track_77"); // "Loading"
    sleep(1250);
    controlCommand("Numbers","Track_0"); // Zero
    sleep(1300);
    Digital.set(D0,false);
    Digital.set(D1,false);
    Digital.set(D2,false);
    Digital.set(D3,false);
    Digital.set(D4,false);
    Digital.set(D8,false);
    Digital.set(D9,false);
    Digital.set(D10,false);
    PWM.set(D0,0);
    PWM.set(D9,0);
    sleep(1000);
    controlCommand("Head Section","ScriptStart","Bubble Middle");
    controlCommand("Head Section","ScriptStart","Center Radar");
    sleep(3000);
    controlCommand("Personality Generator","PauseOff");

    // Notify on first confirmed disconnect (after debounce) and only if previously connected
    if(f0 >= debounceFailures && wasPrevConnected(0)){
      sendPushover("EZ-B Disconnected (index 0)", "EZ-B v4 disconnected (index 0). Retrying connection.");
      setPrevConnected(0, false);
    }
  }

  sleep(200);

  // --- EZB 1 (Legs) ---
  var conn_1 = EZB.isConnected(1);
  if(conn_1){
    setFails(1, 0);
    if(!wasPrevConnected(1)){
      sendPushover("EZ-B Reconnected (index 1)", "EZ-B v4 reconnected (index 1).");
      setPrevConnected(1, true);
    }
  } else {
    var f1 = getFails(1) + 1;
    setFails(1, f1);
    print("EZB 1 is NOT connected: (fail #" + f1 + ")");
    // your reconnect code
    controlCommand("Connection","Connect1");
    controlCommand("Soundboard v4","Track_77");
    sleep(1250);
    controlCommand("Numbers","Track_1");
    sleep(1300);
    controlCommand("Leg Section","ScriptStartWait","Up with Hips");
    controlCommand("Leg Section","ScriptStart","Waist Center");
    sleep(3000);
    controlCommand("Personality Generator","PauseOff");

    if(f1 >= debounceFailures && wasPrevConnected(1)){
      sendPushover("EZ-B Disconnected (index 1)", "EZ-B v4 disconnected (index 1). Retrying connection.");
      setPrevConnected(1, false);
    }
  }

  sleep(200);

  // --- EZB 2 (Arms) ---
  var conn_2 = EZB.isConnected(2);
  if(conn_2){
    setFails(2, 0);
    if(!wasPrevConnected(2)){
      sendPushover("EZ-B Reconnected (index 2)", "EZ-B v4 reconnected (index 2).");
      setPrevConnected(2, true);
    }
  } else {
    var f2 = getFails(2) + 1;
    setFails(2, f2);
    print("EZB 2 is NOT connected: (fail #" + f2 + ")");
    // your reconnect code
    controlCommand("Connection","Connect2");
    controlCommand("Soundboard v4","Track_77");
    sleep(1250);
    controlCommand("Numbers","Track_2");
    // (preserved commented code)
    controlCommand("Personality Generator","PauseOff");

    if(f2 >= debounceFailures && wasPrevConnected(2)){
      sendPushover("EZ-B Disconnected (index 2)", "EZ-B v4 disconnected (index 2). Retrying connection.");
      setPrevConnected(2, false);
    }
  }

  // Wait 15 seconds before rechecking (your original final sleep)
  sleep(15000);
}

Quick checks if you still see no PushOver messages

  • Confirm the PushOver skill is in the same ARC project and the skill window name is exactly "PushOver" (or change the controlCommand's first parameter to match the skill window name).
  • Test a one-off push from a separate Script skill (outside the loop) to verify credentials: controlCommand("PushOver", "Push", "Test message from ARC", "ARC Test"); print("Sent test PushOver");
  • Watch ARC's Script Console (print messages) to verify your script actually executes the branch that calls sendPushover(...). The print(...) calls in the snippet will help.
  • If push works in a one-off test but not from the loop, check for errors printed in the Script Console.

Do you want me to:

  • add a per-EZB cooldown so you don't get repeated disconnect notifications within N minutes, or
  • add file logging for each disconnect/reconnect to help correlate with system logs?

I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
#12  

I dropped your latest script into my project and it still will not the ARC PushOver Skill that there has been a disconnect.

This script I have below does activate the installed ARC PushOver skill and I do get a notification sent to my phone. This script does not have any fail retry or debounce features like your version of this script does. I can't really understand your script enough to troubleshoot it. so I can nave it activate the PushOver skill when it sees and reconnects an index after a disconnect.

Here's my working script (without debouncing and fail retry) that does activates the PushOver skill and I do get a notice on my phone. As you can see I have the PushOver skill ControlCommand in the "else" section of each index connection check. I see you have a function that sets a variable to call the Pushover skill.  Something in your script is seeing the disconnect, successfully reconnecting the disconnected index connection but not activating the PushOver skill.

while (true) {
    // Check EZB Connection 0 (Torso EZB through COM Port 4)
    var conn_0 = EZB.isConnected(0);
    if (conn_0 === true) {
        //print("EZB 0 is connected: " + conn_0);
    } else {
        print("EZB 0 is NOT connected: " + conn_0);
        ControlCommand("Connection", "Connect0");
        sleep(500);
        ControlCommand("Soundboard v4", "Track_77"); // Say "Loading"
        sleep(1250);
        ControlCommand("Numbers", "Track_0"); // Say number Zero
        sleep(1300);
        Digital.set(D0, false); //Turn off Ear Motors
        Digital.set(D1, false); //Turn off Alternet Light Pttern)
        Digital.set(D2, false);//Turn off Scanner Lights
        Digital.set(D3, false); //Turn off Fast Chest Lights(EZB Torso Board-0)
        Digital.set(D4, false); //Box Lights
        Digital.set(D8, false);//Turn off Kill Brain Lights Lights
        Digital.set(D9, false); //Turn off Crown Motor
        Digital.set(D10,false);//Turn off Fast Brain Lights
        PWM.set(D0, 0);//Turn off PWM Ear Motors (Torso EZB Board-0)
        PWM.set(D9, 0);//Turn Off Crown Motor,(EZB Torso Board-0)
        sleep(1000);
       ControlCommand("Head Section", "ScriptStart", "Bubble Middle");
       //ControlCommand("Head Section", "ScriptStart", "Center Radar");
       sleep(3000);
       ControlCommand("PushOver", "Push", "Retrying Connection 0", "Warning: Connection 0 Issue"); //Sending Disconnection Notice to Dave's Phone
       ControlCommand("Personality Generator", "PauseOff");

    }
    sleep(200);

    // Check EZB Connection 1 (Legs EZB through COM Port 3)
    var conn_1 = EZB.isConnected(1);
    if (conn_1 === true) {
       // print("EZB 1 is connected: " + conn_1);
    } else {
        print("EZB 1 is NOT connected: " + conn_1);
        ControlCommand("Connection", "Connect1");
        ControlCommand("Soundboard v4", "Track_77"); // Say "Loading"
        sleep(1250);
        ControlCommand("Numbers", "Track_1"); // Say number One
        sleep(1300);
        ControlCommand("Leg Section", "ScriptStartWait", "Up with Hips");
        ControlCommand("Leg Section", "ScriptStart", "Waist Center");
        sleep(3000)        
        ControlCommand("PushOver", "Push", "Retrying Connection 1", "Warning: Connection 1 Issue"); //Sending Disconnection Notice to Dave's Phone
        sleep(250);
        ControlCommand("Personality Generator", "PauseOff");
    }
    sleep(200);

    // Check EZB Connection 2 (Arms EZB - COM Port 5)
    var conn_2 = EZB.isConnected(2);
    if (conn_2 === true) {
        //print("EZB 2 is connected: " + conn_2);
    } else {
       print("EZB 2 is NOT connected: " + conn_2);
       ControlCommand("Connection", "Connect2");
       ControlCommand("Soundboard v4", "Track_77"); // Say "Loading"
       sleep(1250);
       ControlCommand("Numbers", "Track_2"); // Say number Two
       //sleep(1300)
        //var Both_ARS_Extended = getVar("$Both_ARS_Extended");
        //sleep(500);
        //if (Both_ARS_Extended === 1){
        //ControlCommand("Auto Both Arms", "AutoPositionActionWait", "Both Ars In");
        //print( "Both Arms In" );
        //sleep(4000);
        //}
        sleep(3000);
        ControlCommand("PushOver", "Push", "Retrying Connection 2", "Warning: Connection 2 Issue"); //Sending Disconnection Notice to Dave's Phone
        ControlCommand("Personality Generator", "PauseOff");
    }

    // Wait 15 Seconds before rechecking connections
    sleep(15000);
    } 
Author Avatar
PRO
Canada
#13  

Thanks - that explanation and your working script helped a lot. The issue was that my earlier version only sent PushOver on a state transition (connected -> disconnected) after debounce, so if the disconnect was brief or the debounce prevented the transition the notification never fired. Your original script sent the PushOver immediately inside the else branch on first detection - which is why that reliably worked.

Below I’ve merged your working reconnect logic with debounce/fail-retry while preserving the immediate PushOver behavior you had. This version will:

  • Attempt your reconnect sequence exactly as before.
  • Send a PushOver immediately when a disconnect is detected (like your working script).
  • Send a PushOver once when the connection comes back (so you get both Disconnect and Reconnect messages).
  • Use persistent global vars ($EZBPrev_X and $EZBFails_X) so restarting the script won’t spam notifications.
  • Includes small debug print lines so you can see what branch ran.

Before you run:

  1. Confirm the PushOver skill window name in ARC is exactly "PushOver" (skill window title). If it’s different, change the first parameter of ControlCommand() to match it exactly.
  2. Make sure the PushOver skill settings (User Key & Application Key) are configured and testable: controlCommand("PushOver","Push","Test","ARC Test");print("Sent test");.

Updated script - drop into a Script robot skill and Start:

// EZ-B monitor + reconnect + immediate PushOver notify on disconnect
// Keeps your original reconnect actions and timing, adds reconnect notify

// Change debounceFailures if you want to require multiple successive fails
// before other logic (we still send PushOver on first fail as you requested)
var debounceFailures = 2; // unused for immediate notify, useful for internal counting

// Persistent helpers (survive script restart)
function wasPrevConnected(id){
  return getVar("$EZBPrev_" + id, "1") == "1"; // default = connected
}
function setPrevConnected(id, val){
  setVar("$EZBPrev_" + id, val ? "1" : "0");
}
function getFails(id){
  return parseInt(getVar("$EZBFails_" + id, "0"));
}
function setFails(id, n){
  setVar("$EZBFails_" + id, "" + n);
}

// PushOver helper - first parameter must match skill window name exactly
function sendPushOver(title, message){
  controlCommand("PushOver", "Push", message, title);
  print("PushOver sent -> " + title + " : " + message);
}

// Main loop
while(true){

  // ---------------------
  // EZB 0 (Torso - COM4)
  // ---------------------
  var conn_0 = EZB.isConnected(0);
  if(conn_0){
    // Connected
    setFails(0, 0);
    if(!wasPrevConnected(0)){
      // Transition: disconnected -> connected
      sendPushOver("EZ-B Reconnected (index 0)", "EZ-B v4 reconnected (index 0).");
      setPrevConnected(0, true);
    }
    //print("EZB 0 is connected: " + conn_0);
  } else {
    // Not connected: do your original reconnect sequence
    var f0 = getFails(0) + 1;
    setFails(0, f0);
    print("EZB 0 is NOT connected: (fail #" + f0 + ")");

    controlCommand("Connection", "Connect0");
    sleep(500);
    controlCommand("Soundboard v4", "Track_77"); // "Loading"
    sleep(1250);
    controlCommand("Numbers", "Track_0"); // Zero
    sleep(1300);
    Digital.set(D0, false); // Turn off Ear Motors
    Digital.set(D1, false); // Turn off Alternet Light Pattern
    Digital.set(D2, false); // Turn off Scanner Lights
    Digital.set(D3, false); // Turn off Fast Chest Lights (EZB Torso Board-0)
    Digital.set(D4, false); // Box Lights
    Digital.set(D8, false); // Turn off Kill Brain Lights
    Digital.set(D9, false); // Turn off Crown Motor
    Digital.set(D10, false); // Turn off Fast Brain Lights
    PWM.set(D0, 0); // Turn off PWM Ear Motors (Torso EZB Board-0)
    PWM.set(D9, 0); // Turn Off Crown Motor (EZB Torso Board-0)
    sleep(1000);
    controlCommand("Head Section", "ScriptStart", "Bubble Middle");
    //controlCommand("Head Section", "ScriptStart", "Center Radar");
    sleep(3000);

    // Immediate PushOver notify (keeps your working behavior)
    // This is the line you had in your working script
    controlCommand("PushOver", "Push", "Retrying Connection 0", "Warning: Connection 0 Issue");

    controlCommand("Personality Generator", "PauseOff");

    // Mark state as disconnected (so when it reconnects we'll notify)
    if(wasPrevConnected(0)){
      setPrevConnected(0, false);
    }
  }

  sleep(200);

  // ---------------------
  // EZB 1 (Legs - COM3)
  // ---------------------
  var conn_1 = EZB.isConnected(1);
  if(conn_1){
    setFails(1, 0);
    if(!wasPrevConnected(1)){
      sendPushOver("EZ-B Reconnected (index 1)", "EZ-B v4 reconnected (index 1).");
      setPrevConnected(1, true);
    }
    //print("EZB 1 is connected: " + conn_1);
  } else {
    var f1 = getFails(1) + 1;
    setFails(1, f1);
    print("EZB 1 is NOT connected: (fail #" + f1 + ")");

    controlCommand("Connection", "Connect1");
    controlCommand("Soundboard v4", "Track_77");
    sleep(1250);
    controlCommand("Numbers", "Track_1");
    sleep(1300);
    controlCommand("Leg Section", "ScriptStartWait", "Up with Hips");
    controlCommand("Leg Section", "ScriptStart", "Waist Center");
    sleep(3000);

    // Immediate PushOver notify
    controlCommand("PushOver", "Push", "Retrying Connection 1", "Warning: Connection 1 Issue");
    sleep(250);
    controlCommand("Personality Generator", "PauseOff");

    if(wasPrevConnected(1)){
      setPrevConnected(1, false);
    }
  }

  sleep(200);

  // ---------------------
  // EZB 2 (Arms - COM5)
  // ---------------------
  var conn_2 = EZB.isConnected(2);
  if(conn_2){
    setFails(2, 0);
    if(!wasPrevConnected(2)){
      sendPushOver("EZ-B Reconnected (index 2)", "EZ-B v4 reconnected (index 2).");
      setPrevConnected(2, true);
    }
    //print("EZB 2 is connected: " + conn_2);
  } else {
    var f2 = getFails(2) + 1;
    setFails(2, f2);
    print("EZB 2 is NOT connected: (fail #" + f2 + ")");

    controlCommand("Connection", "Connect2");
    controlCommand("Soundboard v4", "Track_77");
    sleep(1250);
    controlCommand("Numbers", "Track_2");
    //sleep(1300)
    //var Both_ARS_Extended = getVar("$Both_ARS_Extended");
    //sleep(500);
    //if(Both_ARS_Extended == 1){
    //  controlCommand("Auto Both Arms", "AutoPositionActionWait", "Both Ars In");
    //  print("Both Arms In");
    //  sleep(4000);
    //}
    sleep(3000);

    // Immediate PushOver notify
    controlCommand("PushOver", "Push", "Retrying Connection 2", "Warning: Connection 2 Issue");
    controlCommand("Personality Generator", "PauseOff");

    if(wasPrevConnected(2)){
      setPrevConnected(2, false);
    }
  }

  // Wait 15 Seconds before rechecking connections (your original final sleep)
  sleep(15000);
}

Why this should work for you

  • It keeps the same PushOver call placement you used successfully (inside each else block).
  • It also adds reconnect PushOver notifications (on the transition back to connected).
  • It uses persistent flags so a script restart won't produce duplicate reconnect messages repeatedly.

If you still get no PushOver messages from this script, please check:

  1. The exact skill window name: open the PushOver skill window title/header and confirm it's "PushOver". If different, replace "PushOver" in the script with the exact name.
  2. Do a quick one-off test from ARC Script Console (outside the loop) to confirm PushOver credentials: controlCommand("PushOver","Push","Test from ARC","ARC Test"); print("test sent");
  3. Watch the Script Console output (print lines) to confirm your script reached the branch that calls controlCommand("PushOver"...). Copy any printed lines or errors here if it still fails.

Would you like me to:

  • Add a per-EZB cooldown (e.g., don’t send more than 1 disconnect message per X minutes) to reduce spam?
  • Add a small log file (timestamped) for each disconnect/reconnect to help correlate with OS/USB logs?
  • Convert the immediate notify to a debounced notify (only notify after N consecutive fails) instead of immediate?

Tell me which and I’ll modify the script.


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
#14  

OK, that last one seemed to work as expected. I think I understand this script enough now to make any changed needed.    Thanks.

Author Avatar
PRO
Canada
#15  

Great - glad it’s working and you understand the flow now!

If you want next steps, I can add any of these quickly (pick one or more and I’ll provide the ready-to-drop-in code):

  • Per-EZB cooldown (don’t send another disconnect notification for N minutes).
  • Timestamped file logging for disconnect/reconnect events (helps correlate with OS Event Viewer).
  • SMTP fallback (use SMTP Client skill to email when PushOver fails or as a copy).
  • Convert immediate notify to debounced notify (only notify after N consecutive fails).

Below are two small, copy/paste helpers you can drop into your script where you call PushOver - one for cooldown and one for logging.

Cooldown helper (prevents repeated notifications within cooldownMs):

// Place this at top of script (helpers)
function canNotify(id, cooldownMs){
  var last = parseInt(getVar("$EZBLastNotify_" + id, "0"));
  var now = (new Date()).getTime();
  if (now - last >= cooldownMs){
    setVar("$EZBLastNotify_" + id, "" + now);
    return true;
  }
  return false;
}

// Example usage before sending PushOver:
var cooldownMs = 15 * 60 * 1000; // 15 minutes
if (canNotify(0, cooldownMs)) {
  controlCommand("PushOver","Push","Retrying Connection 0","Warning:Connection 0 Issue");
  print("PushOver sent for EZB 0");
}

File logging helper (append timestamped lines):

// Place at top of script (helpers)
function logEvent(line){
  var ts = (new Date()).toISOString();
  // Ensure folder exists (e.g., C:\ARCLogs)
  File.appendStringLine("C:\\ARCLogs\\ezb_events.log", ts + " - " + line);
  print("Logged: " + line);
}

// Example usage:
logEvent("EZB 0 disconnected, attempting reconnect");
logEvent("EZB 0 reconnected");

Notes & links:

Want me to:

  • Add cooldown into your current script and return the updated full script?
  • Add file logging lines to every disconnect/reconnect and return the updated script?
  • Add SMTP fallback as well?

Tell me which and I’ll produce the edited script.


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.