# JSON help... Please help save my sanity

**URL:** <https://community.homey.app/t/json-help-please-help-save-my-sanity/155819>\
**Category:** Questions & Help\
**Tags:** flow\
**Created:** [June 5, 2026, 2:56pm UTC](https://community.homey.app/t/json-help-please-help-save-my-sanity/155819 "2026-06-05T14:56:51Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Drako74](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/drako74/32/150506_2.png) [@Drako74](https://community.homey.app/u/Drako74)\
**Post date:** [June 5, 2026, 2:56pm UTC](https://community.homey.app/t/json-help-please-help-save-my-sanity/155819/1 "2026-06-05T14:56:51Z")

</div>

I had cobbled together a small Python script to return some stats from my NTP server, that an iOS app I have called RaspController which displays them in a widget.

So I had the bright idea it wouldn’t be too difficult to import those stats in to Homey and display them in an AVD device card (Device Capabilities app).

 ![Screenshot 2026-06-05 at 15.17.06](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/c/cc5536b8675c01d58ad92f33864d33092ee7a7ff.jpeg)

I created a copy of the Python script on my Raspberry Pi and modified it’s output from XML format to JSON format, thinking the in-built Logic cards for JSON would be the best option (although I’ve never touched JSON or Java Script before). The output line in the script is:

print(‘{“ntp\_data”:{“results”:[%(sats)s,%(clients)s,%(adjoffset)d,%(esterr)d]}}’ %{‘sats’: nosats, ‘clients’: noclients, ‘adjoffset’: result\_adjoffset, ‘esterr’: result\_esterr})

and this returns:

{“ntp\_data”:{“results”:[9,77,-83,206]}}

![2026-06-05_14-53-40](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/e/1e55b9c1fc45ede2468007e3adc40f32ecc49af3.png)

After some time banging my head against the desk, with the Then Logic card Parse as JSON bombing out, no matter how I tried to adjust the script output format or the select path. I eventually tried copying and pasting the script output in to a Then Logic card Create as Text-tag. And that works fine.

My test Flow:

 ![2026-06-05_14-51-05](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/2/5280dd3cea5c309e96368dd43cbbf49b90ce3b67.png)

It’s output to the Timeline:

 ![2026-06-05_14-51-42](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/0/c0126cfc3047219dd13de503daa459b1afaf9015.png)

My question, what the dickens am I missing here, why won’t it parse the JSON output by the script, but if I copy and paste that exact same JSON it parses fine? 🤯  
(sorry if I’m missing something stupid… I’m a total newbie to JSON)

Also, anyone know a simple way to import/parse XML formatted values?

---

<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 5, 2026, 3:09pm UTC](https://community.homey.app/t/json-help-please-help-save-my-sanity/155819/2 "2026-06-05T15:09:24Z")

</div>

I suspect the issue is your json is typed using smart quote marks instead of straight ones. On a Mac in particular when you type quotes it helpfully uses smart (curly) quotes which break json. Google how to type straight quotes and replace them in your JSON and I suspect that will fix it

---

<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:** [June 5, 2026, 3:10pm UTC](https://community.homey.app/t/json-help-please-help-save-my-sanity/155819/3 "2026-06-05T15:10:12Z")

</div>

The screenshot of the script output is showing regular quotes.

---

<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:** [June 5, 2026, 3:25pm UTC](https://community.homey.app/t/json-help-please-help-save-my-sanity/155819/4 "2026-06-05T15:25:21Z")

</div>

Looks like this might be a bug in the Raspberry Pi app, where it’s [JSON-stringifying the JSON output of your command](https://github.com/gruijter/com.gruijter.rpi/blob/99c790cdc24e1b5dc9d37d710f7144bc332ce489/drivers/rpi/device.js#L391) (@Gruijter).

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [June 5, 2026, 3:51pm UTC](https://community.homey.app/t/json-help-please-help-save-my-sanity/155819/5 "2026-06-05T15:51:05Z")

</div>

To avoid discussions about fancy quotes and straight quotes, you preferrably format code as \< preformatted text \>  
Just tap the + sign at the top right, and paste the code.  
Or when already pasted, just add three backtics on top and below the code block, like

 ![Screenshot_20260605_175026_Ecosia](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/9/89dfc7459234577507b1c7a9d723df9df2786519.jpeg)

---

<div class="post-metadata">

**Author:** ![Gruijter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gruijter/32/1973_2.png) [@Gruijter](https://community.homey.app/u/Gruijter)\
**Post date:** [June 5, 2026, 4:03pm UTC](https://community.homey.app/t/json-help-please-help-save-my-sanity/155819/6 "2026-06-05T16:03:16Z")

</div>

> [@robertklep](#):
>
> bug in the Raspberry Pi app

Na. Dont think so. The rpi app is not intended to run large script responses/json from a flow. Homey itself caps the length of any string in a flow card anyway. I think the cap is 250 characters or so..

---

<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:** [June 5, 2026, 5:02pm UTC](https://community.homey.app/t/json-help-please-help-save-my-sanity/155819/7 "2026-06-05T17:02:25Z")

</div>

The response fits just fine:

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

The error is caused by Logic trying to parse the string as a JSON object, when it’s just a string. In other words, the response token contains this:

```auto
"{\"ntp_data\":{\"results\":[8,77,435,329]}}"

```

And not this:

```auto
{"ntp_data":{"results":[8,77,435,329]}}

```

The only reason I can find why this would happen is because of the `JSON.stringify()` call that I linked to.

---

<div class="post-metadata">

**Author:** ![Drako74](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/drako74/32/150506_2.png) [@Drako74](https://community.homey.app/u/Drako74)\
**Post date:** [June 5, 2026, 5:11pm UTC](https://community.homey.app/t/json-help-please-help-save-my-sanity/155819/8 "2026-06-05T17:11:28Z")

</div>

That was my only thought, that for some reason, some how, the Raspberry Pi app was adding the outer " " around the JSON which the Homey JSON Parse card was spitting out. But I have no idea how I can solve that? Is it just a bug with the Raspberry Pi app?

I’m not trying to exceed any Homey caps on length I don’t think. I’m only trying to return that shot JSON of no more than 50 characters. I could shorten the path in CLI call, but that doesn’t seem to be having an issue executing, as it is returning the response, just with an extra pair of " " quotation marks around the JSON the Python script returns. @Gruijter why does the Raspberry Pi app add these " "?

---

<div class="post-metadata">

**Author:** ![Drako74](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/drako74/32/150506_2.png) [@Drako74](https://community.homey.app/u/Drako74)\
**Post date:** [June 5, 2026, 5:12pm UTC](https://community.homey.app/t/json-help-please-help-save-my-sanity/155819/9 "2026-06-05T17:12:36Z")

</div>

> [@robertklep](#):
>
> The only reason I can find why this would happen is because of the `JSON.stringify()` call that I linked to

Do you know of any way I can un-stringify the response, so that the JSON parser will accept it?

---

<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:** [June 5, 2026, 5:19pm UTC](https://community.homey.app/t/json-help-please-help-save-my-sanity/155819/10 "2026-06-05T17:19:49Z")

</div>

You can use a HomeyScript for that:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/5/e52d0097359d9bd688d76e4865a81b647ae57945.png)

(in the last card you have to choose between two Result tags and it’s completely unclear which one belongs to which previous card, so make sure you pick the right one)

---

<div class="post-metadata">

**Author:** ![Drako74](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/drako74/32/150506_2.png) [@Drako74](https://community.homey.app/u/Drako74)\
**Post date:** [June 5, 2026, 5:29pm UTC](https://community.homey.app/t/json-help-please-help-save-my-sanity/155819/11 "2026-06-05T17:29:25Z")

</div>

@robertklep I’m unclear on the Homey Script part, as I haven’t used that yet. Is it just that card after installing the app, or is that card calling something else, like another script?

(Apologies if I being a dummy, I’m still fairly new to Homey… but even so wishing I had waited a little longer until SHS was released, as my Homey Pro 2026 is already creaking with low RAM and high CPU… I have it sat on top of 120mm fan to keep temps down ha ha)

Your assistance and knowledge are greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Drako74](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/drako74/32/150506_2.png) [@Drako74](https://community.homey.app/u/Drako74)\
**Post date:** [June 5, 2026, 5:44pm UTC](https://community.homey.app/t/json-help-please-help-save-my-sanity/155819/12 "2026-06-05T17:44:14Z")

</div>

@Gruijter on a complete tangent, can I ask you why this When trigger card doesn’t seem to work with any on my Raspberry Pi 5’s?

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

I can SSH as many sessions as I like, but not get a single trigger from this card. And if I go to the RPi’s device card and look at the stats, all logged in sessions are accounted for in the number under the User icon. And if I log in again, that number increases within a few seconds. It’s frustrating me no end, as mostly the app is awesome.

---

<div class="post-metadata">

**Author:** ![Drako74](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/drako74/32/150506_2.png) [@Drako74](https://community.homey.app/u/Drako74)\
**Post date:** [June 5, 2026, 6:49pm UTC](https://community.homey.app/t/json-help-please-help-save-my-sanity/155819/13 "2026-06-05T18:49:37Z")

</div>

@robertklep hugely appreciate your assistance and knowledge with this. A bunch of tinkering later I have it working exactly as I had hoped… it’s bleeding marvellous 👍 thank you dude.

The finished article:

 ![Screenshot 2026-06-05 at 19.42.04](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/c/1c5258bc7e3ab40ae17f2da986059788cc990089.jpeg)

 ![2026-06-05_19-41-38](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/0/b0d8ca34e15765694f2d4455368c7ff276ece37f.png)

Now to tackle those pesky Login triggers that don’t seem to work at all… @Gruijter please help

---

<div class="post-metadata">

**Author:** ![Gruijter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gruijter/32/1973_2.png) [@Gruijter](https://community.homey.app/u/Gruijter)\
**Post date:** [June 5, 2026, 7:03pm UTC](https://community.homey.app/t/json-help-please-help-save-my-sanity/155819/14 "2026-06-05T19:03:54Z")

</div>

> [@Drako74](#):
>
> tackle those pesky Login triggers

Havent looked at the rpi app for a while. Probably mismatch in os version. When time and energy I will check it out.

So many apps, so little time

---

<div class="post-metadata">

**Author:** ![Drako74](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/drako74/32/150506_2.png) [@Drako74](https://community.homey.app/u/Drako74)\
**Post date:** [June 5, 2026, 7:20pm UTC](https://community.homey.app/t/json-help-please-help-save-my-sanity/155819/15 "2026-06-05T19:20:48Z")

</div>

Thank you @Gruijter, it would be massively appreciated.

EDIT: there have been a few updates to Pi OS recently. I’m currently running the most up to date version of Bookworm (Debian 12), which I do intend to update on all my Pi’s to Trixie (Debian 13). I have a few Pi’s to update, but I’ll get there.

I don’t know if that helps at all.

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [June 5, 2026, 10:48pm UTC](https://community.homey.app/t/json-help-please-help-save-my-sanity/155819/16 "2026-06-05T22:48:18Z")

</div>

> [@robertklep](#):
>
> completely unclear which one belongs to which previous card

When you “hover” the [Result] tag, the tag icon in the 'source" card starts to wave 👋 , and that card starts to “glow” veeeeery subtle blue-ish (on top of that, it can take a while for this effect to show on a slower machine like a tablet).  
And it’s just bad ~~luck~~ design if that ‘source’ card is outside of your (zoomed) view; you’re on your own then.

Luckily Athom made sure it’s very hard to notice 🫣

I always temporary remove the input line of the predecessing card, then you’d have only one [Result] to select. Shouldn’t be necessary.

---

<div class="post-metadata">

**Author:** ![Drako74](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/drako74/32/150506_2.png) [@Drako74](https://community.homey.app/u/Drako74)\
**Post date:** [June 5, 2026, 11:14pm UTC](https://community.homey.app/t/json-help-please-help-save-my-sanity/155819/17 "2026-06-05T23:14:34Z")

</div>

Also, if when in the Advanced Flow editor you start the flow, when you hover over the tag in a card the tool tip pops up showing the data contents.

I didn’t have a problem with this, if you notice in my screenshot above, the first flow tag is named Response, the following 2 although both being called Result are different colours due to the first (green) being text, and the second (blue) being a number.

There are numerous subtle signs, almost like Athom wanted to keep us all guessing… like breadcrumbs on a trail 🤣

---

<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:** [June 6, 2026, 4:44am UTC](https://community.homey.app/t/json-help-please-help-save-my-sanity/155819/18 "2026-06-06T04:44:12Z")

</div>

> [@Peter\_Kawa](#):
>
> Luckily Athom made sure it’s very hard to notice 🫣

OMG that’s _very_ subtle. At least so much so that I never noticed this… 🫣
