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)

189101214

Comments

  • HansieNL said:
    I installed version 1.5, but my flows activating Domoticz switches don't work anymore. Am I missing something?
    This what I use now: Homey fw 1.1.2 and HTTP Get JSON card "http://domoticz-ip:port/json.htm" and "{type":"command","param":"switchlight","idx":123,"switchcmd":"On"}"
    If I install v 1.3.3 via CLI everything works again.
    Can you check the console output when run this command with 1.5.0 via cli for me?
  • HansieNLHansieNL Member
    edited January 2017
    ErikVanDongen are you on slack now?

    19:07:29 Api Authorization Required setting { value: false }
    19:07:58 action.http_get_json { args:
         data: '{"type":"command","param":"switchlight","idx":168,"switchcmd":"Toggl
    e"}' },
      method: 'get',
      urlOptions:
         query: '{"type":"command","param":"switchlight","idx":168,"switchcmd":"Togg
    le"}',
         timeout: 30000 } }
    19:07:58 action.http_get_json { status: 200, response: '{\n   "status" : "ERR"\n
    }\n' }

  • That's about the same I get on a "Get variable step 1" action card.

    URL: http://192.168.0.110:8084/json.htm
    Parameters: {"type":"devices","rid":32}
    JSONpath: $.[result][0][CounterToday]
    Trigger: someName

    The debug log:
    19:45:48 action.http_get_variable_1 { status: 200, response: '{\n   "status" : "ERR"\n}\n' }
    19:45:48   --> data: { status: 'ERR' }
    19:45:48   --> jsonPath: $.[result][0][CounterToday]
    19:45:48   --> result { variable: undefined, type: 'undefined' }

    Guess I missed while testing the GitHub version ... sorry about that .. :anguished:
  • @HansieNL  Thank you. This shows me exactly what went wrong. I'll have a fix ready this evening. 
    @Phuturist Are you able to test v 1.5.1 now available on Git?
  • @Phuturist Are you able to test v 1.5.1 now available on Git?
    Yes, works again ... :+1:

  • ErikVanDongenErikVanDongen Member
    edited January 2017
    Ok. Sorry I didn't noticed this in my tests. Fix 1.5.1 is available on Github and submitted in the app store. Thanks for helping out diagnosing and testing @HansieNL @Phuturist !

    Update: In store now! 
  • After the update this trigger don't work anymore  :(
    http://inlognaam:wachtwoord@ipadres/web/powerstate
    {"newstate":4}


    Thanks @ErikVanDongen , its working again, after update to 1.5.1
  • Hey guys, I am using 1.5.1 and had API auth set to off. Now with the new white list option turned back API auth to ON. Restarted the app and even restarted Homey (both twice) but I am still able to access the API without auth.

    Is this a known error/bug? 
  • I'm using the HTTP POST JSON and want to use the JSON-information in the response of this call.
    Is it possible to do this?
  • Hey guys, I am using 1.5.1 and had API auth set to off. Now with the new white list option turned back API auth to ON. Restarted the app and even restarted Homey (both twice) but I am still able to access the API without auth.

    Is this a known error/bug? 
    Thanks for reporting. I'll look into it.
  • thayoung1 said:
    I'm using the HTTP POST JSON and want to use the JSON-information in the response of this call.
    Is it possible to do this?
    Not with the cards now available. 
    I can make POST variants of the existing GET variable (JSONpath) cards. With that you can trigger a flow with the extracted value available as a token, or save the extracted value in a Better Logic variable. Can you share some more info / details about your objective?
  • Hey guys, I am using 1.5.1 and had API auth set to off. Now with the new white list option turned back API auth to ON. Restarted the app and even restarted Homey (both twice) but I am still able to access the API without auth.

    Is this a known error/bug? 
    Thanks for reporting. I'll look into it.
    I checked and it is ok. Be aware that when testing from Chrome your cookies will send with the request and requests will get authorized based on these cookies. So please try again with another browser or incognito mode.
  • Hey guys, I am using 1.5.1 and had API auth set to off. Now with the new white list option turned back API auth to ON. Restarted the app and even restarted Homey (both twice) but I am still able to access the API without auth.

    Is this a known error/bug? 
    Thanks for reporting. I'll look into it.
    I checked and it is ok. Be aware that when testing from Chrome your cookies will send with the request and requests will get authorized based on these cookies. So please try again with another browser or incognito mode.
    Ah, makes sense did not think of that. I will double check to make sure. Thanks for the update. 
  • thayoung1 said:
    I'm using the HTTP POST JSON and want to use the JSON-information in the response of this call.
    Is it possible to do this?
    Not with the cards now available. 
    I can make POST variants of the existing GET variable (JSONpath) cards. With that you can trigger a flow with the extracted value available as a token, or save the extracted value in a Better Logic variable. Can you share some more info / details about your objective?
    Update: I think it *is* most likely possible. With the advanced HTTP options you can override the GET method by POST. Check this: https://github.com/irritanterik/homey-http-request-actions#advanced-http-options
  • Some more information: I'm trying to call the ANWB Connected Car API to get the location of my vehicle.

    The method I'm calling requires a HTTP POST with JSON in the body and some bearer token in the header. The method returns information in the body of the response including the last known lat / lon of my car. 

    The HTTP POST card first parameter is:

    {"method":"post","protocol":"https:","hostname":"eu1-r40-prod.delphiconnect.com","path":"/mobile.svc/users/9999/vehicles/locations","headers":{"Authorization":"WRAP access_token = ****","Content-Type":"application/json"}}

    The second parameter is:

    {"userId":9999}

    I tried using the card "GET variable stap 1" but I don't know where to put what information and how to use the next step (the flow to trigger). Can you help me? 
  • Hi I need some help please ...

    I am starting to learn to use this app and making use of API to trigger actions on devices but I am kind of stuck at the moment. Maybe someone can get me in the right direction ;)

    I was able to execute these with the app on my Axis camera:
    http://myserver/axis-cgi/io/lightcontrol.cgi?action=L1:-0

    But I am having trouble executing these on my Axis camera:
    http://myserver/axis-cgi/io/virtualinput.cgi?action=1:/
    http://myserver/axis-cgi/io/virtualinput.cgi?action=1:\

    It looks to me that the problem is in the "/" and "\" characters but I am not sure.

    Anybody any clue?
  • Hi I need some help please ...

    I am starting to learn to use this app and making use of API to trigger actions on devices but I am kind of stuck at the moment. Maybe someone can get me in the right direction ;)

    I was able to execute these with the app on my Axis camera:
    http://myserver/axis-cgi/io/lightcontrol.cgi?action=L1:-0

    But I am having trouble executing these on my Axis camera:
    http://myserver/axis-cgi/io/virtualinput.cgi?action=1:/
    http://myserver/axis-cgi/io/virtualinput.cgi?action=1:\

    It looks to me that the problem is in the "/" and "\" characters but I am not sure.

    Anybody any clue?
    Do you have some logging available of these requests? You can get logging by running the app from CLI or with my realtime logpage , available on Github. 

    It's probably the / and \ characters. You can try \\ instead of \ .
    Another approach is to use the advanced HTTP options. It allows to put the URI between quotes. You can read about that in the readme (app store description).
  • After the update this trigger don't work anymore  :(
    http://inlognaam:wachtwoord@ipadres/web/powerstate
    {"newstate":4}


    Thanks @ErikVanDongen , its working again, after update to 1.5.1
    I'm doing something similar and now want to use a password with the "@" symbol in it, which I can't get working with a simple http get card.

    Example: http://username:passw@rd@ipaddress:port/variables/test?value=true&_method=put

    I tried replacing the "@" with %40 which works in a normal browser, but that didn't work in the app.

    Any idea how I can get this working?

  • wming75 said:

    I'm doing something similar and now want to use a password with the "@" symbol in it, which I can't get working with a simple http get card.

    Example: http://username:passw@rd@ipaddress:port/variables/test?value=true&_method=put

    I tried replacing the "@" with %40 which works in a normal browser, but that didn't work in the app.

    Any idea how I can get this working?

    @wming75
    You could try advanced http options instead of putting a url in the first parameter.
    So use a value like:
    {"protocol":"http:","hostname":"ipaddress","port":80,"path":"/variables/test?value=true&_method=put","headers":{"authorization":"Basic bXl1c2VyOm15cGFzc3dvcmQ="}}
    The value bXl1c2VyOm15cGFzc3dvcmQ= (for example) is the Base64 encoded value for "username:password" (between brackets). You can use https://www.base64encode.org to calcuate this value.
  • wming75 said:

    I'm doing something similar and now want to use a password with the "@" symbol in it, which I can't get working with a simple http get card.

    Example: http://username:passw@rd@ipaddress:port/variables/test?value=true&_method=put

    I tried replacing the "@" with %40 which works in a normal browser, but that didn't work in the app.

    Any idea how I can get this working?

    @wming75
    You could try advanced http options instead of putting a url in the first parameter.
    So use a value like:
    {"protocol":"http:","hostname":"ipaddress","port":80,"path":"/variables/test?value=true&_method=put","headers":{"authorization":"Basic bXl1c2VyOm15cGFzc3dvcmQ="}}
    The value bXl1c2VyOm15cGFzc3dvcmQ= (for example) is the Base64 encoded value for "username:password" (between brackets). You can use https://www.base64encode.org to calcuate this value.
    Thanks for the suggestion. I tried that today, but it didn't work. I was doing some reading on the server I want to do the HTTP get against and apparantly it uses digest authentication by default when authentication is enabled. The little I can figure out it seems like the advanced http option suggestion made is for basic authentication. Is digest authentication supported or even possible for what I'm trying to do? 
  • Hi guys - I don't want to double post yet I'm not sure if my issue is related to HTTP Request or BetterLogic (or both :P).

    So if you feel like helping a clueless user, please check out my post here: https://forum.athom.com/discussion/comment/43851/#Comment_43851. I'm trying to integrate Google Assistant with Homey. Almost there I think...
  • JschuetzJschuetz Member
    edited February 2017
    Hey there i will link a webhook application with the http request flow cards.

    On the web hook site i can configure my host like: 
    {
    }

    But nothing more. Every state change and topology change will be posted (method POST) to that URL webhook": "http://192.168.10.106/api/app/com.internet/Event , as JSON.

    How can i now use the http request cards to get some information from this json post request? 
  • Jschuetz said:
    Hey there i will link a webhook application with the http request flow cards.

    On the web hook site i can configure my host like: 
    {
    }

    But nothing more. Every state change and topology change will be posted (method POST) to that URL webhook": "http://192.168.10.106/api/app/com.internet/Event , as JSON.

    How can i now use the http request cards to get some information from this json post request? 
    Show the JSON content here and tell what you want to do with it and we can help.
  • Jschuetz said:
    Hey there i will link a webhook application with the http request flow cards.

    On the web hook site i can configure my host like: 
    {
    }

    But nothing more. Every state change and topology change will be posted (method POST) to that URL webhook": "http://192.168.10.106/api/app/com.internet/Event , as JSON.

    How can i now use the http request cards to get some information from this json post request? 
    Show the JSON content here and tell what you want to do with it and we can help.
    I think the problem is that the http request app needs /event/value but the webhook application sends directly json to event!
  • Jschuetz said:
    Jschuetz said:
    Hey there i will link a webhook application with the http request flow cards.

    On the web hook site i can configure my host like: 
    {
    }

    But nothing more. Every state change and topology change will be posted (method POST) to that URL webhook": "http://192.168.10.106/api/app/com.internet/Event , as JSON.

    How can i now use the http request cards to get some information from this json post request? 
    Show the JSON content here and tell what you want to do with it and we can help.
    I think the problem is that the http request app needs /event/value but the webhook application sends directly json to event!
    POST with JSON to /event is sup ported, just use the right trigger card.
  • Jschuetz said:
    Jschuetz said:
    Hey there i will link a webhook application with the http request flow cards.

    On the web hook site i can configure my host like: 
    {
    }

    But nothing more. Every state change and topology change will be posted (method POST) to that URL webhook": "http://192.168.10.106/api/app/com.internet/Event , as JSON.

    How can i now use the http request cards to get some information from this json post request? 
    Show the JSON content here and tell what you want to do with it and we can help.
    I think the problem is that the http request app needs /event/value but the webhook application sends directly json to event!
    POST with JSON to /event is sup ported, just use the right trigger card.
    I am using T30 but nothing happens. My IP address is on the whitelist! 
  • Jschuetz said:
    Jschuetz said:
    Jschuetz said:
    Hey there i will link a webhook application with the http request flow cards.

    On the web hook site i can configure my host like: 
    {
    }

    But nothing more. Every state change and topology change will be posted (method POST) to that URL webhook": "http://192.168.10.106/api/app/com.internet/Event , as JSON.

    How can i now use the http request cards to get some information from this json post request? 
    Show the JSON content here and tell what you want to do with it and we can help.
    I think the problem is that the http request app needs /event/value but the webhook application sends directly json to event!
    POST with JSON to /event is sup ported, just use the right trigger card.
    I am using T30 but nothing happens. My IP address is on the whitelist! 
    Do you use /whitelist/event ?
  • Jschuetz said:
    Jschuetz said:
    Jschuetz said:
    Hey there i will link a webhook application with the http request flow cards.

    On the web hook site i can configure my host like: 
    {
    }

    But nothing more. Every state change and topology change will be posted (method POST) to that URL webhook": "http://192.168.10.106/api/app/com.internet/Event , as JSON.

    How can i now use the http request cards to get some information from this json post request? 
    Show the JSON content here and tell what you want to do with it and we can help.
    I think the problem is that the http request app needs /event/value but the webhook application sends directly json to event!
    POST with JSON to /event is sup ported, just use the right trigger card.
    I am using T30 but nothing happens. My IP address is on the whitelist! 
    Do you use /whitelist/event ?
    Thank you!
  • Hi @ErikVanDongen
    Sorry, but your app is really universal and i'm trying now to connect to my Solarlog and read the PV Data.
    Maybe you can help me to save the data to a BL variable.
     POST Adress is http://192.168.0.25/getjp
    RAW POST is {\"801\":{\"170\":null}}.

    The Output is:
    {   "801":{      "170":{         "100":"13.02.17 21:21:15",         "101":0,         "102":0,         "103":0,         "104":0,         "105":26500,         "106":25600,         "107":200600,         "108":242200,         "109":49391200,         "110":0,         "111":0,         "112":0,         "113":0,         "114":0,         "115":0,         "116":11025      }   }}

     How can i save the Value for example from "116"? Here "11025"?

    Thanks
    Viktor
  • VonkenboerVonkenboer Member
    edited February 2017
    When using the whitelist option with api authorization enabled, non authorized communication mentioned on the whitelist appear not being accepted. 
    {"status":401,"result":"no_auth_method_found"}
    (communication from a Fibaro HC lua scene using HTTP-Request Flow Cards v1.6.2)

     Can anyone confirm this? 
Sign In or Register to comment.