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
    New version 0.2.0 released

    it now displays responses of devices or sensors if "Device n action n JParam" is configured (JSON response needed)

    Your device must reponse with a valid JSON. Just configure your action as usual and add a JSON parameter name you want to display in the settings field Device x action x JParam.


    Sample:
    If you weather stations response looks like :

    {"status": 200, "process_time": 338.17195892333984, "live": {"wind_speed": 1.7, "rainfall": 0.0, "temperature":27.4, "low_battery": {"WindData": [1]}, "wind_direction": "NNW", "uv": "--", "wind_angle": 337, "forecast": 3, "pressure": 942, "local_time": "2016-08-04 13:03:42.241219", "sealevel_pressure": 1013.6800000000001, "humidity": 50.0, "wind_gust": 1.9}}

    And you want to display the temperature configure:
  • Http authentication

    Could you please add the usual url integrated authentication : http://login:password@mysite.com/api ?

    Great widget.
  • Former Member
    Former Member over 8 years ago
    integrated auth - tested

    Could you please add the usual url integrated authentication : http://login:password@[/url]mysite.com/api ?

    Great widget.


    Hi djib78,

    I tried it and it id work.
    Because you are asking I'm afraid it did not work for you. What was the problem?

    Sten
  • Hi djib78,

    I tried it and it id work.
    Because you are asking I'm afraid it did not work for you. What was the problem?

    Sten


    Failed:401, as if the authentication didn't perform correctly. In your test was the authentication mandatory or did you add a fake one just to make sure the syntax was accepted?

    Regards
  • Former Member
    Former Member over 8 years ago
    integrated auth

    Failed:401, as if the authentication didn't perform correctly. In your test was the authentication mandatory or did you add a fake one just to make sure the syntax was accepted?

    Regards



    Oh, ok, yes, your guessing was correct, the auth was not mandatory in my test!

    I'll try to figure out what the Garmin SDK really sends out. As it is a pretty high level function one can use to do HTTP requests fron Connect IQ, it is not that easy to say what really happend.

    I'll let you know as soon as I have news!
  • Former Member
    Former Member over 8 years ago
    ...basic auth will be available...

    Failed:401, as if the authentication didn't perform correctly. In your test was the authentication mandatory or did you add a fake one just to make sure the syntax was accepted?

    Regards


    Ok, found a solution!

    I have to parse the url in the widget code "manually" and add an appropriate HTTP header - which is possible in Connect IQ.
    I'll let you know as soon as I published a new version including this feature!

    ...btw, thx for your positive review!
  • Former Member
    Former Member over 8 years ago
    @SvenKrampe: pretty cool video. Thank you very much! Are you using fibaro roller shutters?


    Dann mal zum ersten Teil:):
    => Somfy RTS roller shutters
    => controled via Homewizard
  • Former Member
    Former Member over 8 years ago
    basic auth successfully tested!

    Could you please add the usual url integrated authentication : http://login:password@mysite.com/api ?

    Great widget.


    in just tested url integrated basic auth (fenix3=>apache webserver) and it did work in my case!
    So I will not add any code for this feature.

    Please, as Garmin devices do not update apps without a reboot - every time you update an app or widget using your smartphone app, make sure you reboot your watch and run app-tests afterwards!
  • Former Member
    Former Member over 8 years ago
    Philips Hue

    Hi,

    Can you give me any info on getting this to work with Philips Hue? I can control my system via the API web page using the PUT commands and can also do it in Terminal (on a mac) but can't seem to get it correct on the Garmin?

    Thanks in advance
  • Former Member
    Former Member over 8 years ago
    Philips HUE and IoTClient

    Hi,

    Can you give me any info on getting this to work with Philips Hue? I can control my system via the API web page using the PUT commands and can also do it in Terminal (on a mac) but can't seem to get it correct on the Garmin?

    Thanks in advance


    Hi,

    i had a quick look at the Hue API. This looks like a proper Rest API using PUT requests with XML bodys to control devices.
    As IoTClient works with simple HTTP GET commands only, this wont work directly.

    If you have a chance to host any kind of small scripts somewhere you could write a simple wrapper/bridge (using PHP or Python) which wraps a Hue API call and makes it accessable via an HTTP GET request. This should not be too tricky.

    Or, you may have a look at the available Node.js libs for Hue. Maybe one of these can do that trick.

    good luck!