This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.

The Homey Community has been moved to https://community.athom.com.

This forum is now read-only for archive purposes.
Official

[APP] Simple HTTP Connector For Flows (2.0.0)

1246714

Comments

  • @ErikVanDongen When will 0.3.0 be in the appstore? Since an update of athom-cli I can't seem to load the github version :sweat_smile: 
  • MarcoWijk said:
    @ErikVanDongen When will 0.3.0 be in the appstore? Since an update of athom-cli I can't seem to load the github version :sweat_smile: 
    Version 0.4.0 is actually already submitted and under review. Probably somewhere on the todo list of Emile between task 1 and 536. :smiley: 
  • Phuturist said:
    MarcoWijk said:
    @ErikVanDongen When will 0.3.0 be in the appstore? Since an update of athom-cli I can't seem to load the github version :sweat_smile: 
    Version 0.4.0 is actually already submitted and under review. Probably somewhere on the todo list of Emile between task 1 and 536. :smiley: 
    Correct! Its still pending...
  • Allright, version 0.4.0 is available now!

  • @ErikVanDongen it's working! Whem Homey is acting 'normal' again, i will have a lot of fun with it :smiley:

    ...I saw you were working on a track and trace app for Homey? Awesome :smiley:  I'll keep an eye on that!
  • Can I actually use this to make HTTP calls to external, already existing urls? I tried to do the following flow: when nfc found, go to http://mytestwebsite. The API accepts POST requests without any body. Still, homey does not make the call. What am I missing :neutral: ? Many thanks
  • adi said:
    Can I actually use this to make HTTP calls to external, already existing urls? I tried to do the following flow: when nfc found, go to http://mytestwebsite. The API accepts POST requests without any body. Still, homey does not make the call. What am I missing :neutral: ? Many thanks
    Yes you can. Can you post a screenshot? Or PM me at slack? Possibly a POST request to a url with query parameters (http://website/page?query=parameter) could be a problem.
  • Beginners question here: can I do a GET JSON request and use the results as variables in a different flow?

    Example: 

    This url gets me sunset/rise info: http://api.sunrise-sunset.org/json?lat=52.6972155&lng=5.164657

    I'm able to create the action card, but where are the results stored?

    This comes back using Postman:

    {
      "results": {
        "sunrise": "6:28:00 AM",
        "sunset": "5:15:44 PM",
        "solar_noon": "11:51:52 AM",
        "day_length": "10:47:44",
        "civil_twilight_begin": "5:53:37 AM",
        "civil_twilight_end": "5:50:06 PM",
        "nautical_twilight_begin": "5:13:59 AM",
        "nautical_twilight_end": "6:29:45 PM",
        "astronomical_twilight_begin": "4:34:04 AM",
        "astronomical_twilight_end": "7:09:40 PM"
      },
      "status": "OK"
    }

    How can I use things like "civil_twilight_begin" in a different flow?
  • Beginners question here: can I do a GET JSON request and use the results as variables in a different flow?

    Example: 

    This url gets me sunset/rise info: http://api.sunrise-sunset.org/json?lat=52.6972155&lng=5.164657

    I'm able to create the action card, but where are the results stored?

    This comes back using Postman:

    {
      "results": {
        "sunrise": "6:28:00 AM",
        "sunset": "5:15:44 PM",
        "solar_noon": "11:51:52 AM",
        "day_length": "10:47:44",
        "civil_twilight_begin": "5:53:37 AM",
        "civil_twilight_end": "5:50:06 PM",
        "nautical_twilight_begin": "5:13:59 AM",
        "nautical_twilight_end": "6:29:45 PM",
        "astronomical_twilight_begin": "4:34:04 AM",
        "astronomical_twilight_end": "7:09:40 PM"
      },
      "status": "OK"
    }

    How can I use things like "civil_twilight_begin" in a different flow?
    Sorry, you can't retrieve the result body of requests. Maybe you can use the new trigger cards? Allthoug that requires some external trigger.
  • Where do I submit feature requests? :)
  • I've thought about this, but I think your use case requires a specific little app. (it's supereasy and fun to do). It will be too complex to create this flexibility on these little flow cards and therefore need a nice settings screen or so. Maybe as an addition to the better logic app.
  • I'll go hunt for a small example app to borrow from :)
  • With Improved actions as I suggested actions would also have output, which could be used in next action "set a variable"...
  • Perfect perfect!

    I have a couple of led strips and arduino's. Together with the NeoPixel/ArduinoPixel sketch (https://github.com/pAIgn10/ArduinoPixel) I can use put commands to control them.


  • UrandayUranday Member
    edited February 2016
    What I could try to make is a set json card. Input is a json document and it will set the matching variables that are found in the variables store. But that requires the http app to retrieve the document. 
  • Is that difficult to do? And how would the http app store the document?
  • I think the http app would have a string drop token that would be an input to a card I have to make. 
  • adi said:
    Can I actually use this to make HTTP calls to external, already existing urls? I tried to do the following flow: when nfc found, go to http://mytestwebsite. The API accepts POST requests without any body. Still, homey does not make the call. What am I missing :neutral: ? Many thanks
    Yes you can. Can you post a screenshot? Or PM me at slack? Possibly a POST request to a url with query parameters (http://website/page?query=parameter) could be a problem.
    Thanks Erik. I will PM you a bit later, but no, I have a URL with 2 path params, but no query params.  My flow is a simple when/then: when nfc detected, then POST https://mywebsite/pathparam1/pathparam2, no POST body (meaning, it seems like one cannot leave the body empty, but I made it an empty JSON object). I have a way to monitor requests coming to the endpoint I am posting to, but nothing comes in from Homey..  
  • ErikVanDongenErikVanDongen Member
    edited February 2016
    Uranday said:
    I think the http app would have a string drop token that would be an input to a card I have to make. 
    As @MatjaLipu said some sequential actions with draggable tokens for next cards would be ideal for this. For now you could allready create this flow with the HTTP and Better Logic apps:




  • yeah.. but in all this use cases you need another flow with variable change trigger. similar for youtube app (search song, play song)
  • adi said:
    adi said:
    Can I actually use this to make HTTP calls to external, already existing urls? I tried to do the following flow: when nfc found, go to http://mytestwebsite. The API accepts POST requests without any body. Still, homey does not make the call. What am I missing :neutral: ? Many thanks
    Yes you can. Can you post a screenshot? Or PM me at slack? Possibly a POST request to a url with query parameters (http://website/page?query=parameter) could be a problem.
    Thanks Erik. I will PM you a bit later, but no, I have a URL with 2 path params, but no query params.  My flow is a simple when/then: when nfc detected, then POST https://mywebsite/pathparam1/pathparam2, no POST body (meaning, it seems like one cannot leave the body empty, but I made it an empty JSON object). I have a way to monitor requests coming to the endpoint I am posting to, but nothing comes in from Homey..  
    Have you tried both Post cards?

  • Is that difficult to do? And how would the http app store the document?
    @Uranday and I decided we are going to support this (expect it in a few weeks). The HTTP app wil get two special cards, an action card for getting a variable with a GET request (and retrieving a value from a specific json path in the response) and throw a specific event.
    This specific event will trigger a trigger card with the retrieved value as a token. @Uranday will make a generic value set action that can convert the retrieved value to text/numeric/boolean/etc value.
  • Is that difficult to do? And how would the http app store the document?
    @Uranday and I decided we are going to support this (expect it in a few weeks). The HTTP app wil get two special cards, an action card for getting a variable with a GET request (and retrieving a value from a specific json path in the response) and throw a specific event.
    This specific event will trigger a trigger card with the retrieved value as a token. @Uranday will make a generic value set action that can convert the retrieved value to text/numeric/boolean/etc value.

    Yep, better logic will get an action card that sets all matching values in a json document. I'll look for key value pairs in the document. When it is found the value will be set and the trigger cards for those values will be triggered. 

  • Uranday said:
    Is that difficult to do? And how would the http app store the document?
    @Uranday and I decided we are going to support this (expect it in a few weeks). The HTTP app wil get two special cards, an action card for getting a variable with a GET request (and retrieving a value from a specific json path in the response) and throw a specific event.
    This specific event will trigger a trigger card with the retrieved value as a token. @Uranday will make a generic value set action that can convert the retrieved value to text/numeric/boolean/etc value.

    Yep, better logic will get an action card that sets all matching values in a json document. I'll look for key value pairs in the document. When it is found the value will be set and the trigger cards for those values will be triggered. 


    Sweet! With this almost anything with a web API can be used as a trigger! That's eh... a lot :)
  • That's way mooore than better logic! Good job. However we should consider where is the limit and start creating composable apps.
  • Just published version 0.5.1. New feature is a paired action and trigger card. It's a real geek thing: 
    Get a specific value from any json API with a get-request, and trigger another flow with this value in the token.
  • And it's in the App store! 
  • Nice! Do you have an example of the json get-request triggering another flow?
  • I'm pretty new to all this and hopefully anybody here can help me to get started with the http Homey app in combination with the app Tasker in android.

    I want to change a variable in Homey everytime my phone connects and disconnects to my WiFi network. So I guess I have to set a rule in Tasker that when my phone connects to WiFi I have to let Tasker do a HTTP Post to Homey and then in Homey I have to use the incoming get request card as a trigger. Is this correct?

    Could anybody share some print screens with me (on the forum or via mail if it is to difficult to explain on the forum). I believe I have to use the following action card in Tasker but I don't know what I exactly need to enter in each field so that Homey receives the HTTP post.



    Any help would be greatly appreciated :).
  • ErikVanDongenErikVanDongen Member
    edited March 2016
    Nice! Do you have an example of the json get-request triggering another flow?
    I have two flows to let Homey say the production of my solar panels (dutch: zonnepanelen):
    getProduction:

    The action card has 4 parameters:
     1. http://www.upp.nl/public/api/latest-realtime-measurements/100
     2. {}   (no queryparameters like ?var=1&name=13 needed in this example)
     3. $.[0][total]   (= JSONpath select to select the total production from the returned json object)
     4. solartrigger (= name for trigger in sayProduction flow)

    sayProduction:

    Using the droptoken 'waarde' or 'value' in an action with a simple calculation


Sign In or Register to comment.