Widget: IoTClient

Former Member
Former Member
Please post comments, problems, questions, and feature requests on the IoTClient ConnectIQ Widget in this thread.

https://apps.garmin.com/en-US/apps/da3db127-3938-4dac-bcf1-e30324fd0d20



  • Former Member
    Former Member over 8 years ago
    Yes, it is accepted by the Vera webserver, it just includes the added "?" into the set of the variable. The trouble comes when the Vera tries to process the variable and is presented with "0?" or "1?" versus the "0" or "1" it is expecting.

    Sorry, the discussion board automatically truncates the links so the full link was not shown. here you go:

    192.168.1.50:3480/data_request

    Thanks!
  • Former Member
    Former Member over 8 years ago
    Using OpenHAB, so far I have not managed to find a way to command some items. Depending on the version, there are three alternatives:

    1. http://[host]/classicui/CMD?[item_name]=ON
    simple URL request, in this case looking in logs the correct item receives the command, but the value is "ON?". I tested this request from a browser and it works ok, so in someway using the widget alters the value

    2. http://[host]/rest/items/[item_name]/state
    a PUT request with "ON" as text/plain data type in body

    3. http://[host]/rest/items/[item_name]
    a POST request with "ON" as text/plain data type in body

    For 2. and 3. I didn't find any option to send a text/plain parameter. Any ideas?
  • Former Member
    Former Member over 8 years ago
    Unable to save changes. IoT Widget has a character limit for settings?

    Greetings,
    Thanks for the nice concept! However, I have been trying to configure it to work with my setup. I see others have commented with similar issues and that you had success resolving their issues. Mine still does not work. I am trying to use a very simple configuration like:

    https://myserver/control.php?device=x*state=y

    When I try to save, I get the error in the subject line. Please advise. I see the formatting system changed "ampersand" symbol to "asterisk" in my URL.
  • If you are trying to figure out why the '?' Is being appended, it is likely because the URL you pass to makeWebRequest() contains parameters. You need to pack the parameters into the params passed to that method.

    Given what I see of your properties, it looks like you will need to parse the parameters out of the user URL, put them into a dict, and pass that dict to makeWebRequest().

    Travis
  • Former Member
    Former Member over 8 years ago
    I understand that this widget is specifically design for REST requests, but some IoT endpoints are taking
    in request text/plain data in body, instead of json, so these would not work.
    On the other hand some older IoT systems implements servlets called with GET or POST requests with parameters
    . This is the case I used.

    The workaround for me:
    Widget settings: http://[host]/classicui/CMD?[item_name]=ON&
    Web request: http://[host]/classicui/CMD?[item_name]=ON&?
    What server sees: two parameters, second would be '?'='', which is ignored

    Results: I can switch the item, server returns http status 200, empty content, text/plain and the widget
    shows a big 'IQ' with yellow exclamation mark, something is crashing.

    Logs:
    ERROR: Unexpected Type Error
    DETAILS: Failed invoking symbol
    WARNING: failed inside handle_json_callback
  • server returns http status 200, empty content...

    The ConnectIQ framework expects the response to be a valid JSON object. I'm pretty sure I've looked at the RFC defining JSON to verify that an empty response is not valid, and it is not. This doesn't necessarily mean that the app should crash though.

    It might be worth filing a bug in the Bug Reports forum. If you can't do it, I should be able to get to it tonight.

    Travis
  • Former Member
    Former Member over 8 years ago
    Can't make it work! :(

    Hi,

    I tried to follow this:

    (I did make an authorized user)

    But I got a error when I tried to set it on my iPhone:

    I also tried using the Garmin express on my macbook, but then I got an error saying that I have typed too much :/

    Sooo... What do I have to do?

    Thank you in advance
  • Former Member
    Former Member over 8 years ago
    Hi,

    I tried to follow this:

    (I did make an authorized user)

    But I got a error when I tried to set it on my iPhone:

    I also tried using the Garmin express on my macbook, but then I got an error saying that I have typed too much :/

    Sooo... What do I have to do?

    Thank you in advance


    Any special characters in your request?
  • Basic Authentication, HTTPS or another Problem?

    Hello,

    great application, very good idea.

    I tested https://[username]:[password]@cloud.cedalo.com/api/garmin?json_put={"topic":"watch","type":"ctl","name":"bt1","priority":1,"payload":[["Watch","123",0]]}

    in the Smartphones Browser successfully.

    When I try to execute from the IoT application, it tells me "sending" and then "OK". But the receiving App at cedalo.com does not react. So it seems there must be something wrong with the URL.

    Any ideas? I could send username and password if there are no ideas from just looking at the url.

    Thanks for any help!

    PS: I also tested https://[username]:[password]@cloud.cedalo.com/api/garmin?json_put={"topic":"watch","type":"ctl","name":"bt1"} but did not work either.

    Just an suggestion: it would be great if you could include placeholders in the JSON String that would be replaced by the actual GPS coordinates (if GPS is on) of the watch when URL is executed. And possibly some more placeholders for other sensor data (or current time) that the watch allows to access over the SDK.
  • Former Member
    Former Member over 8 years ago
    Add more space

    I have one improvement request: can you extend the space available on the screen to list the server response?
    I have the action name field empty to increase the space available but the widget still reserves that line (keeps it blank).
    I need this to show my current full song title playing on my home system (MPD music server on linux)