# \[App\]\[Pro\] Local API

**URL:** <https://community.homey.app/t/app-pro-local-api/70840>\
**Category:** Apps\
**Tags:** app, flow, homey-pro\
**Created:** [October 19, 2022, 3:50pm UTC](https://community.homey.app/t/app-pro-local-api/70840 "2022-10-19T15:50:01Z")\
**Posts on this page:** 20\
**Page:** 4

<div class="post-metadata">

**Author:** ![Jonathan\_Draper](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jonathan_draper/32/33978_2.png) [@Jonathan\_Draper](https://community.homey.app/u/Jonathan_Draper)\
**Post date:** [April 1, 2023, 9:06am UTC](https://community.homey.app/t/app-pro-local-api/70840/61 "2023-04-01T09:06:46Z")

</div>

I’d say the memory issue looks to be fixed. Exact same call being made once per 60s throughout this graph; no prizes for guessing when I installed the test version (also disabled my flow that rebooted the app every 2 hours when I installed the test version).

Next I will go back to more frequent refreshes and see how it copes.

 ![Screenshot 2023-04-01 at 10.04.52](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/c/ecf02c6530ed6b678bf87ad7cb923420b3299ede.png)

---

<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:** [April 1, 2023, 9:12am UTC](https://community.homey.app/t/app-pro-local-api/70840/62 "2023-04-01T09:12:21Z")

</div>

It’s very likely that passing around `req` and `res` caused memory leaks, and now that this has changed by only passing the required data it also solved the memory leak.

---

<div class="post-metadata">

**Author:** ![ilpaolino](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ilpaolino/32/49565_2.png) [@ilpaolino](https://community.homey.app/u/ilpaolino)\
**Post date:** [April 14, 2023, 11:52am UTC](https://community.homey.app/t/app-pro-local-api/70840/63 "2023-04-14T11:52:17Z")

</div>

Hi everyone,  
about 15 days have passed from the last release:  
have you ever encountered anomalies or memory leaks?  
@Jonathan_Draper@Teddy@basvanderploeg

Let me know!

thank you

Paolo

---

<div class="post-metadata">

**Author:** ![Jonathan\_Draper](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jonathan_draper/32/33978_2.png) [@Jonathan\_Draper](https://community.homey.app/u/Jonathan_Draper)\
**Post date:** [April 14, 2023, 3:54pm UTC](https://community.homey.app/t/app-pro-local-api/70840/64 "2023-04-14T15:54:11Z")

</div>

All looking great from my perspective. A reboot of Homey since I updated to the latest version of this app seemed to help and since then it’s never gone above 10MB of memory usage despite often pretty polling on my API. Thank you again!

 ![Screenshot 2023-04-14 at 16.52.23](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/b/5b994424df3040f237e423bbcbfc4b246d14fcbe.png)

---

<div class="post-metadata">

**Author:** ![Teddy](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/teddy/32/13818_2.png) [@Teddy](https://community.homey.app/u/Teddy)\
**Post date:** [April 14, 2023, 6:02pm UTC](https://community.homey.app/t/app-pro-local-api/70840/65 "2023-04-14T18:02:54Z")

</div>

No, so far everything works great 🙂

---

<div class="post-metadata">

**Author:** ![Jonathan\_Draper](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jonathan_draper/32/33978_2.png) [@Jonathan\_Draper](https://community.homey.app/u/Jonathan_Draper)\
**Post date:** [June 18, 2023, 10:32am UTC](https://community.homey.app/t/app-pro-local-api/70840/67 "2023-06-18T10:32:30Z")

</div>

Hi again @ilpaolino

I have another challenge for you! Hoping this one is easier to fix than the memory issue.

I’ve just migrated to the Homey Pro 2023 and one weird thing that seems to have changed is that now when I include a boolean tag in the arguments of a ‘respond with’ card, instead of getting ‘true’ or ‘false’ in the response, I instead get a string of special characters. As far as I can tell these relate to the unicode characters for a check mark and a fancy cross symbol. I assume this change by Athom was meant to improve things when the value is rendered as text somewhere. However, for an API response this is not ideal and it breaks my integration.

E.g. when I use the “respond with” card with the argument: {“house\_secure”: \<house\_secure\>, “jon\_home”: \<jon\_home\>} - where the \<tag\_name\> represent boolean tags in the flow card - I get this in the response:

```auto
{
  "status": "success",
  "url": "/dashboard/homepage",
  "method": "GET",
  "data": {
    "house_secure": "â¨¯",
    "jon_home": "âœ“"
  }
}

```

Do you think it would be possible to replace these values in the response body with the strings ‘true’ and ‘false’ so that the response goes back to how it was before?

In this example, the house\_secure tag was false and the jon\_home tag was true.

Thanks again!  
Jon

---

<div class="post-metadata">

**Author:** ![Jonathan\_Draper](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jonathan_draper/32/33978_2.png) [@Jonathan\_Draper](https://community.homey.app/u/Jonathan_Draper)\
**Post date:** [June 20, 2023, 4:38pm UTC](https://community.homey.app/t/app-pro-local-api/70840/68 "2023-06-20T16:38:28Z")

</div>

Further to the above - I have got a work-around for now, which is a HomeyScript card which runs the following code on my JSON before it’s sent out as a response via the Local API respond with card:

`return args[0].replaceAll('✓','true').replaceAll('⨯','false');`

I managed to track down the specific unicode check mark and cross characters (as above) that now appear to be the underlying representation in Homey for Yes/No tags.

---

<div class="post-metadata">

**Author:** ![Giacomo\_Andreani](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/giacomo_andreani/32/80910_2.png) [@Giacomo\_Andreani](https://community.homey.app/u/Giacomo_Andreani)\
**Post date:** [July 8, 2023, 6:12am UTC](https://community.homey.app/t/app-pro-local-api/70840/70 "2023-07-08T06:12:19Z")

</div>

Hello, i am trying to use Local Api with my Home Pro early 2023, but i am not able to trigger the command [http://myhomey-ip:3000/test](http://myhomey-ip:3000/test).  
I received on the browser replay: {“status”:“not-found”}.  
What is wrong?

It is not clear if in the flow “Respond with 200” is ok like i did in attach picture

 ![homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/a/ea164efa0fd67737de674d961549dc9344e34d03.jpeg)  
.  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![ilpaolino](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ilpaolino/32/49565_2.png) [@ilpaolino](https://community.homey.app/u/ilpaolino)\
**Post date:** [July 8, 2023, 6:28am UTC](https://community.homey.app/t/app-pro-local-api/70840/71 "2023-07-08T06:28:01Z")

</div>

![Schermata 2023-07-08 alle 08.26.06](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/c/acfbafac8bf3123e27a00b1f0a122691366d0de2.png)

Because you’re using another app…  
You must use the LocalAPI flow card

---

<div class="post-metadata">

**Author:** ![Giacomo\_Andreani](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/giacomo_andreani/32/80910_2.png) [@Giacomo\_Andreani](https://community.homey.app/u/Giacomo_Andreani)\
**Post date:** [July 8, 2023, 9:35am UTC](https://community.homey.app/t/app-pro-local-api/70840/72 "2023-07-08T09:35:32Z")

</div>

You are right. 😉  
It works perfect!  
thanks  
Giacomo

---

<div class="post-metadata">

**Author:** ![diapolon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/diapolon/32/82612_2.png) [@diapolon](https://community.homey.app/u/diapolon)\
**Post date:** [July 12, 2023, 11:28am UTC](https://community.homey.app/t/app-pro-local-api/70840/73 "2023-07-12T11:28:48Z")

</div>

@ilpaolino can you add a flow response that take json directly from homeyscript return?  
Currently i have to go through tag system but it seem limited on characters

---

<div class="post-metadata">

**Author:** ![Peter\_Stern](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_stern/32/72096_2.png) [@Peter\_Stern](https://community.homey.app/u/Peter_Stern)\
**Post date:** [July 13, 2023, 6:48pm UTC](https://community.homey.app/t/app-pro-local-api/70840/74 "2023-07-13T18:48:03Z")

</div>

Hi  
I have a principal error with http://_Homey-IP_:80/test  
Get 404 Error code: Cannot GET /test

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/0/60d0eb85067b68a04cc671f07abdeb4f32c48b81.png)  
Please can you help me?  
V1.1.5  
HP2023  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/f/6f2ceedc7009030303167ad7465806c5f96a44cb.png)

---

<div class="post-metadata">

**Author:** ![Peter\_Stern](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_stern/32/72096_2.png) [@Peter\_Stern](https://community.homey.app/u/Peter_Stern)\
**Post date:** [July 13, 2023, 7:05pm UTC](https://community.homey.app/t/app-pro-local-api/70840/75 "2023-07-13T19:05:20Z")

</div>

OK, now I am using Port 8080 instead of 80 and it works

---

<div class="post-metadata">

**Author:** ![ilpaolino](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ilpaolino/32/49565_2.png) [@ilpaolino](https://community.homey.app/u/ilpaolino)\
**Post date:** [July 17, 2023, 11:49am UTC](https://community.homey.app/t/app-pro-local-api/70840/76 "2023-07-17T11:49:59Z")

</div>

Hi, I’m investigating to understand how I can integrate your requests.  
I would like to be able to generate one or more tags with the contents of body and querystring.  
I don’t know, however, if it is possible to pass a value directly from homey scripts, however if I integrated tag handling I could pass a read and write value directly to the tag and vice versa.

---

<div class="post-metadata">

**Author:** ![diapolon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/diapolon/32/82612_2.png) [@diapolon](https://community.homey.app/u/diapolon)\
**Post date:** [September 6, 2023, 8:17pm UTC](https://community.homey.app/t/app-pro-local-api/70840/77 "2023-09-06T20:17:58Z")

</div>

Hi!  
Any news for supporting querystring params?  
😊

---

<div class="post-metadata">

**Author:** ![janrikard](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/janrikard/32/34785_2.png) [@janrikard](https://community.homey.app/u/janrikard)\
**Post date:** [November 16, 2023, 12:55pm UTC](https://community.homey.app/t/app-pro-local-api/70840/78 "2023-11-16T12:55:47Z")

</div>

Just found this, almost exactly what i was looking for.

Would it be possible to do a json-resonse with just the data?

I have a lametric time and and it has a feature to show information from a http get if it is in a json that is formated in a special way.  
I can work around if the special jason isnt possible, but then I have to do most of my programming in the lametric and i rather do it in my homey.

/Rikard

---

<div class="post-metadata">

**Author:** ![janrikard](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/janrikard/32/34785_2.png) [@janrikard](https://community.homey.app/u/janrikard)\
**Post date:** [November 26, 2023, 7:27am UTC](https://community.homey.app/t/app-pro-local-api/70840/79 "2023-11-26T07:27:43Z")

</div>

Hi @ilpaolino

feature request

would it be possible to get another json output?

like `{"frames": [{"text": "3 mil","icon": "49189"}]}`

instead of `{"status":"success","url":"/test","method":"GET","data":{"frames": [{"text": "3 mil","icon": "49189"}]}`

Either by a new flowcard or an argument to choose output i the current flowcard

Im no programmer but ive been looking att your code and the part

```auto
res.write(JSON.stringify({
            status: 'success', url: req.url, method: req.method, data: argVal,
          }

```

should probably be like

```auto
res.write(JSON.stringify({
            argVal,
          }

```

or

```auto
res.write(JSON.stringify({
             frames: argVal,
          }

```

for the user to be able to create

```auto
{"frames": [{"text": "3 mil","icon": "49189"}]}

```

could it be possible?

/Rikard

---

<div class="post-metadata">

**Author:** ![ilpaolino](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ilpaolino/32/49565_2.png) [@ilpaolino](https://community.homey.app/u/ilpaolino)\
**Post date:** [December 1, 2023, 8:00am UTC](https://community.homey.app/t/app-pro-local-api/70840/80 "2023-12-01T08:00:55Z")

</div>

Hi Rikard,  
it isn’t possible at the moment, because that feature can break all the other installation that use the current Json structure.

---

<div class="post-metadata">

**Author:** ![janrikard](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/janrikard/32/34785_2.png) [@janrikard](https://community.homey.app/u/janrikard)\
**Post date:** [December 1, 2023, 8:57am UTC](https://community.homey.app/t/app-pro-local-api/70840/81 "2023-12-01T08:57:23Z")

</div>

Hi

But is it possible to make a new flowcard with this feature?

---

<div class="post-metadata">

**Author:** ![Ocyberbum](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ocyberbum/32/47809_2.png) [@Ocyberbum](https://community.homey.app/u/Ocyberbum)\
**Post date:** [October 11, 2024, 5:06am UTC](https://community.homey.app/t/app-pro-local-api/70840/82 "2024-10-11T05:06:33Z")

</div>

> [@B3rt](#):
>
> 192.168.1.x

Hello

I just wanted to thank you for this post… i had the same problem trying to setup Blueiris to trigger a flow and changing my port from 3000 to 8080 Worked!

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/8/b81a82faff073223270459f5daa434fb3cea6688.png)

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/7/6739d07a036b647813621c4cb2af463a31a45dcd.png)

[Previous page](https://community.homey.app/t/app-pro-local-api/70840.md?page=3)

[Next page](https://community.homey.app/t/app-pro-local-api/70840.md?page=5)
