send an email ... to trigger a GET request

Does anyone know?  I see that I can send an email via NEEO

Can that email trigger a GET request?   How do I do that?

If I could open a URL I would have what I need, but all I seem to be able to do from a Recipe is to send an email.

Thanks!

Reply
8replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Bill Kaczmarek the easiest way is to use forward action in the NEEO app and forward it to a webhook. At the endpoint, you can evaluate each keystroke or action and then trigger a GET / POST request, e.g. with curl

    Like 1
    • Fonzo  Thanks!  It looks like an opportunity for me to learn some more goodies, e.g. curl.  Appreciate it!

      Like
      • Fonzo
      • Fonzo
      • 4 yrs ago
      • Reported - view

      Bill Kaczmarek You can use any kind of PHP Server

       

      # Capture JSON content
      $neeo_json = file_get_contents('php://input');
      echo "Webhook NEEO";
      
      $neeo_data = json_decode($neeo_json);
      $action = "";
      if (property_exists($neeo_data, 'action')) {
         $action = $neeo_data->action;
      
      }
      $device = "";
      if (property_exists($neeo_data, 'device')) {
         $device = $neeo_data->device;
      
      }
      $room = "";
      if (property_exists($neeo_data, 'room')) {
         $room = $neeo_data->room;
      
      }
      $actionparameter = "";
      if (property_exists($neeo_data, 'actionparameter')) {
         $actionparameter = $neeo_data->actionparameter;
      
      }
      $recipe = "";
      if (property_exists($neeo_data, 'recipe')) {
         $recipe = $neeo_data->recipe;
      
      }
      

      Depending on the recipe or device or action, you can then send something

       public function SendGET(string $URL)
          {
              $ch = curl_init();
              curl_setopt($ch, CURLOPT_URL, $URL);
              curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
              $result = curl_exec($ch);
              curl_close($ch);
              return $result;
          }
      Like
    • Fonzo Lot's of food for thought... now I need to digest.  I don't know PHP or JSON... just faking it (learning on the go).  So I'll look at some YouTube and set up a forward request in NEEO.  I know webhooks from IFTTT.  and have used with JOIN urls.   I see how to enable PowerShell and run CURL on it... now need to figure out how to automate it with a forward request.  I'm sure you gave breadcrumbs for me to follow... so will do that.  Really appreciate the friendly help!

      Like
    • Fonzo I've educated myself a tiny bit.  A question now.  Might something like this work?  Just to move me in the right direction?

      I don't have a PHP server now, but read here https://stackoverflow.com/questions/36245837/is-there-any-way-to-run-php-on-android  (as quoted below),  that i might be able to load Palapa Web Server on an old Android (that I use as my 'server' for IFTTT).    Might that work for a very very simple use case?  I just need to send one URL which triggers my action.

      Once I have a PHP server, then i can figure out the curl etc etc to tie it together, is my hope.

       

      QUOTE THAT I READ AT LINK ABOVE:    

      "Okay, this is a bit of a personal recommendation, but I've had success with the free Palapa Web Server, which is essentially a web / mysql server which runs on Android, which will run your PHP scripts, and it will also work offline.

      "To use it, install the app, and copy your PHP / HTML files onto your phone. By default, the app uses /sdcard/pws/www/, so if you put your files there, it should pick them up. Then, launch the app, click "Start server", and go to http://127.0.0.1:8080 with your web browser on your android device, and it should work.

      "Note that setting up PHPMyAdmin (if you need that for managing databases) can be a bit tricky, as you will need to download the extra packages for it.

      "Let me know if it works for you. (Note: I'm not affiliated with this app, I'm just a mostly satisfied user.)"

      Like
      • Fonzo
      • Fonzo
      • 4 yrs ago
      • Reported - view

      Bill Kaczmarek If you already use an Android device as a "server" you can try it out. I would prefer a mini computer as a raspberry, which has a power supply and is not broken so quickly. An Android device is usually designed as a mobile device with a battery. The battery can at least take permanent damage if you load it continuously, after all, the "server" must indeed be accessible around the clock otherwise it does not work responding to a keystroke.

      Like
    • Fonzo  Thanks once more!

      Raspberry Pi frightens me - I've never actually ever seen one in the flesh ;-). 

      The old Android charger runs on a timer. Also, if it gets to 100% it alerts me on my phone via JOIN.

      I blew up the battery on it once - a very dramatic part of the leaning curve ;-)

      Like
  • Bill Kaczmarek said:
    Raspberry Pi frightens me

     Those small babies perform magic in a big way!😮

    Eman.

    Like
Like Follow