# Problem reading temperature from ngenic via HTTP GET

**URL:** <https://community.homey.app/t/problem-reading-temperature-from-ngenic-via-http-get/69255>\
**Category:** Questions & Help\
**Tags:** flow, homey-pro\
**Created:** [September 21, 2022, 8:21pm UTC](https://community.homey.app/t/problem-reading-temperature-from-ngenic-via-http-get/69255 "2022-09-21T20:21:19Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roger\_Levenrot](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/roger_levenrot/32/56492_2.png) [@Roger\_Levenrot](https://community.homey.app/u/Roger_Levenrot)\
**Post date:** [September 21, 2022, 8:21pm UTC](https://community.homey.app/t/problem-reading-temperature-from-ngenic-via-http-get/69255/1 "2022-09-21T20:21:19Z")

</div>

I get stuck trying to read the temperature sensors connected to ngenic.  
I’ve found the token and room and sensor uuid and get a CURL GET to work on my MAC in terminal.

But I don’t get it how to translate that to a HTTP GET in Homey…  
Any suggestions??

curl command  
curl -X GET  
-H “Authorization: Bearer abcd1234PRIVATETOKENabcd1234”  
“[https://app.ngenic.se/api/v3/tunes/{f3e2e629-8eb9-ec11-997e-e42aac6e0f30}/measurements/{0687242c-75cc-ec11-997e-e42aac6e0f30}/latest?type=temperature\_C](https://app.ngenic.se/api/v3/tunes/%7Bf3e2e629-8eb9-ec11-997e-e42aac6e0f30%7D/measurements/%7B0687242c-75cc-ec11-997e-e42aac6e0f30%7D/latest?type=temperature_C)”

response:  
{“hasValue”:true,“time”:“2022-09-20T16:25:28 Europe/Stockholm”,“value”:21.5625}%

were “value” is the current temperature.

---

<div class="post-metadata">

**Author:** ![Marcel\_Ubels](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marcel_ubels/32/18860_2.png) [@Marcel\_Ubels](https://community.homey.app/u/Marcel_Ubels)\
**Post date:** [September 22, 2022, 8:40am UTC](https://community.homey.app/t/problem-reading-temperature-from-ngenic-via-http-get/69255/2 "2022-09-22T08:40:46Z")

</div>

> [@Roger\_Levenrot](#):
>
> {“hasValue”:true,“time”:“2022-09-20T16:25:28 Europe/Stockholm”,“value”:21.5625}

The problem is it isn’t a proper json file. The quotation marks should be " and not “. A slight problem but that’s the reason it doesn’t work. The json file should be like this:

 ![2022-09-22](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/c/3c146e46cb7a37451ed595eae812044dac618692.png)

if you have the option to download a proper json file it will work otherwise you have to adjust the file.

Maybe you have a method to adjust this file on your computer, otherwise it is maybe possible to adjust the file wirh homeyscript

---

<div class="post-metadata">

**Author:** ![Roger\_Levenrot](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/roger_levenrot/32/56492_2.png) [@Roger\_Levenrot](https://community.homey.app/u/Roger_Levenrot)\
**Post date:** [September 22, 2022, 8:55am UTC](https://community.homey.app/t/problem-reading-temperature-from-ngenic-via-http-get/69255/3 "2022-09-22T08:55:32Z")

</div>

I believe there is still a problem with the GET function…  
Since I don’t get a reply in Homey only error… There is something with the syntax of the GET command I think…

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [September 22, 2022, 9:00am UTC](https://community.homey.app/t/problem-reading-temperature-from-ngenic-via-http-get/69255/4 "2022-09-22T09:00:12Z")

</div>

> [@Marcel\_Ubels](#):
>
> The json file should be like this:
> 
> {“hasValue”: true,“time”: “2022-09-20T16:25:28 Europe/Stockholm”,“value”: 21.5625}

Yours is broken too, thanks to this great forum software 😛

---

<div class="post-metadata">

**Author:** ![Marcel\_Ubels](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marcel_ubels/32/18860_2.png) [@Marcel\_Ubels](https://community.homey.app/u/Marcel_Ubels)\
**Post date:** [September 22, 2022, 10:34am UTC](https://community.homey.app/t/problem-reading-temperature-from-ngenic-via-http-get/69255/5 "2022-09-22T10:34:27Z")

</div>

Hahaha, i saw it and added s printscreen so you can see what the problem is🤓

---

<div class="post-metadata">

**Author:** ![Roger\_Levenrot](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/roger_levenrot/32/56492_2.png) [@Roger\_Levenrot](https://community.homey.app/u/Roger_Levenrot)\
**Post date:** [September 22, 2022, 10:53am UTC](https://community.homey.app/t/problem-reading-temperature-from-ngenic-via-http-get/69255/6 "2022-09-22T10:53:01Z")

</div>

You’re not answering my question here…  
@robertklep - Is this something you can help med with?

---

<div class="post-metadata">

**Author:** ![Caseda](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/caseda/32/138695_2.png) [@Caseda](https://community.homey.app/u/Caseda)\
**Post date:** [September 22, 2022, 10:58am UTC](https://community.homey.app/t/problem-reading-temperature-from-ngenic-via-http-get/69255/7 "2022-09-22T10:58:02Z")

</div>

That’s what the `</>` button is for 😉

```auto
{
    "hasValue":true,
    "time":"2022-09-20T16:25:28 Europe/Stockholm",
    "value":21.5625
}

```

@Roger_Levenrot  
But not showing what you already have as “get” flow cards is kinda difficult to say what is wrong.

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [September 22, 2022, 11:01am UTC](https://community.homey.app/t/problem-reading-temperature-from-ngenic-via-http-get/69255/8 "2022-09-22T11:01:34Z")

</div>

You have to use the [“HTTP request flow cards” app](https://homey.app/a/com.internet/), which allows you to extract values from a JSON response (just don’t ask me how to use it 😅).

---

<div class="post-metadata">

**Author:** ![Marcel\_Ubels](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marcel_ubels/32/18860_2.png) [@Marcel\_Ubels](https://community.homey.app/u/Marcel_Ubels)\
**Post date:** [September 22, 2022, 11:23am UTC](https://community.homey.app/t/problem-reading-temperature-from-ngenic-via-http-get/69255/9 "2022-09-22T11:23:01Z")

</div>

[Maybe this can help a little bit](https://community.homey.app/t/openweather-api/30910)

---

<div class="post-metadata">

**Author:** ![Roger\_Levenrot](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/roger_levenrot/32/56492_2.png) [@Roger\_Levenrot](https://community.homey.app/u/Roger_Levenrot)\
**Post date:** [September 22, 2022, 12:47pm UTC](https://community.homey.app/t/problem-reading-temperature-from-ngenic-via-http-get/69255/10 "2022-09-22T12:47:25Z")

</div>

```auto
{ "method":"get","protocol":"https:","hostname":"app.ngenic.se","port":443,"path":"/api/v3/tunes/{f3e2e629-8eb9-ec11-997e-e42aac6e0f30}/measurements/{0687242c-75cc-ec11-997e-e42aac6e0f30}","headers":{"authorization":"Bearer XYXYMYTOKENXYXY","content-type":"application/json"}}{"value":
varTemp}

```

![Homey Pro 2022-09-22 14-47-09](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/9/7/979b2007649ec0ca4406f87304037d8239ca76dc.png)

![Homey Pro 2022-09-22 14-49-03](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/0/00487c0b5e786369dedb16ddee99610ea6f2de4d.png)

Working curl command…  
Highlighted value in green is the value I am trying to retrieve!

 ![Monosnap 2022-09-22 14-57-07](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/2/02d1bc94052f2519812498d980918f57ad3b5c8f.png)

---

<div class="post-metadata">

**Author:** ![Caseda](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/caseda/32/138695_2.png) [@Caseda](https://community.homey.app/u/Caseda)\
**Post date:** [September 22, 2022, 2:04pm UTC](https://community.homey.app/t/problem-reading-temperature-from-ngenic-via-http-get/69255/11 "2022-09-22T14:04:37Z")

</div>

Haven’t used the http app in a while, the build in logic send http card had seperate inputs for URL, body and headers, when I’m at home I can give you an example.

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [September 22, 2022, 2:36pm UTC](https://community.homey.app/t/problem-reading-temperature-from-ngenic-via-http-get/69255/12 "2022-09-22T14:36:33Z")

</div>

You can’t extract content from the responses with the built-in Logic card.

---

<div class="post-metadata">

**Author:** ![Caseda](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/caseda/32/138695_2.png) [@Caseda](https://community.homey.app/u/Caseda)\
**Post date:** [September 22, 2022, 2:53pm UTC](https://community.homey.app/t/problem-reading-temperature-from-ngenic-via-http-get/69255/13 "2022-09-22T14:53:41Z")

</div>

As long as the response is JSON, yes you can, with Homey advance flows it is really easy.

---

<div class="post-metadata">

**Author:** ![Caseda](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/caseda/32/138695_2.png) [@Caseda](https://community.homey.app/u/Caseda)\
**Post date:** [September 22, 2022, 3:28pm UTC](https://community.homey.app/t/problem-reading-temperature-from-ngenic-via-http-get/69255/14 "2022-09-22T15:28:42Z")

</div>

this should do it:

 ![numver value JSON](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/3/d3837aa051b188d155cfae9f0e34967a38fb7e28.jpeg)

URL:

```auto
https://app.ngenic.se:443/api/v3/tunes/{f3e2e629-8eb9-ec11-997e-e42aac6e0f30}/measurements/{0687242c-75cc-ec11-997e-e42aac6e0f30}/latest?type=temperature_C

```

Header:

```auto
{ "authorization":"Bearer XYXYMYTOKENXYXY", "content-type":"application/json" }

```

Edit:  
if you want to be safe (if their service is offline for example, kinda forgot to add it into the example flow), you can add another “AND” card between the request and reading the JSON, and see if the “status code” (number) is `200`  
 ![status 200](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/a/3a951d400357544c9ea99350d7568bf72aa91c14.jpeg)

---

<div class="post-metadata">

**Author:** ![Roger\_Levenrot](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/roger_levenrot/32/56492_2.png) [@Roger\_Levenrot](https://community.homey.app/u/Roger_Levenrot)\
**Post date:** [September 23, 2022, 6:25am UTC](https://community.homey.app/t/problem-reading-temperature-from-ngenic-via-http-get/69255/15 "2022-09-23T06:25:12Z")

</div>

Hi!  
Thanks for helping!  
Something wrong with the Header…  
 ![Homey Pro 2022-09-23 08-24-15](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/b/ab0f09821b3c7fbde5bc408efa608750c2da85bd.png)

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [September 23, 2022, 7:05am UTC](https://community.homey.app/t/problem-reading-temperature-from-ngenic-via-http-get/69255/16 "2022-09-23T07:05:44Z")

</div>

Please try “Authorization” and “Content-Type” with capital letter. Perhaops the Logic is checking case sentive.

Source: [HTTP headers - HTTP | MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers?retiredLocale=en)

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [September 23, 2022, 8:34am UTC](https://community.homey.app/t/problem-reading-temperature-from-ngenic-via-http-get/69255/17 "2022-09-23T08:34:40Z")

</div>

The issue is that the example is showing the headers in JSON format, while they should be in plain text (with line breaks in between the different headers).

---

<div class="post-metadata">

**Author:** ![Roger\_Levenrot](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/roger_levenrot/32/56492_2.png) [@Roger\_Levenrot](https://community.homey.app/u/Roger_Levenrot)\
**Post date:** [September 23, 2022, 8:56am UTC](https://community.homey.app/t/problem-reading-temperature-from-ngenic-via-http-get/69255/18 "2022-09-23T08:56:44Z")

</div>

Thank you very much!  
Great help!!

Complete solution

HTTP GET request to:  
[https://app.ngenic.se:443/api/v3/tunes/{tuneUuid}/measurements/{nodeUuid}/latest?type=temperature\_C](https://app.ngenic.se:443/api/v3/tunes/%7BtuneUuid%7D/measurements/%7BnodeUuid%7D/latest?type=temperature_C)

Headers:  
Authorization: Bearer xyxyMYTOKENxyxy

Visit [https://developer.ngenic.se](https://developer.ngenic.se) on how to retrieve your personal token and “tuneUuid” and “nodeUuid”

---

<div class="post-metadata">

**Author:** ![mow87](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mow87/32/34093_2.png) [@mow87](https://community.homey.app/u/mow87)\
**Post date:** [March 20, 2023, 2:21pm UTC](https://community.homey.app/t/problem-reading-temperature-from-ngenic-via-http-get/69255/19 "2023-03-20T14:21:34Z")

</div>

Hi i managed to get my Authorization: Bearer, tuneUuid and uuid.  
But i dont get how to add it to logic or to HTTP request flow cards.

Can anyone share some exampels from homey?

Thanks!

---

<div class="post-metadata">

**Author:** ![Roger\_Levenrot](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/roger_levenrot/32/56492_2.png) [@Roger\_Levenrot](https://community.homey.app/u/Roger_Levenrot)\
**Post date:** [March 21, 2023, 7:53am UTC](https://community.homey.app/t/problem-reading-temperature-from-ngenic-via-http-get/69255/20 "2023-03-21T07:53:38Z")

</div>

This works for me!

 ![Homey Pro 2023-03-21 08-50-11](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/7/e7e1ac7470029586112c7d70e83767e08f02a712.png)

[Next page](https://community.homey.app/t/problem-reading-temperature-from-ngenic-via-http-get/69255.md?page=2)
