[APP][Pro] JSON Handler and Manipulator

Indeed, and also the arguments are not dynamic, but fortunately, they can be optional nowadays.

I just created Loop cards, which will itterate through an Json Array or Collection:

image

In test now!

Maybe you could explain this a bit more? :wink:

Yeah, but i find it a bit hard to explain in a non-developer way.
I just updated a few flowcard-descriptions which are in test right now.

Essentially, i created a loop card, or for each

for (var (item,key,index) in Collection) {
}

It works pretty easy, you need two cards:

  • A When/Trigger Card, which will be triggered for each item in the collection, with these tokens:
    • Item as Text
    • Item as Number
    • Item as Yes/No
    • Key
    • Index
    • Text 1 (argument)
  • And a Then/Action Card, which you supply with an (json) collection (array or obj) and an optional argument.
    The When card will be execute for each item in the collection, with the supplied tokens.

Example

image

The bottom card will execute the above (Trigger/When) card three times.
Result:
image

Here is another example:

image

Developer-way works fine for me at least. Am a SW developer myself, but only C, C++, Python and just starting with Java. :slight_smile:

I think I understand it, will do a test flow and try it out.

1 Like

Hi Arie!
In the Read-JSON card, isn’t all path’s optional?
In my flow I only check the path “Yes/No 1” but get an error for “Text 1” path.
In the first Read-card I get error “Invalid type for token ‘text1’ expected ‘string’ but got ‘undefined’”.

[tef:FLOWS:"H4sIAAAAAAACA7VWbW/bNhD+KwE/mwEpvojUtwJdtxZrMyAb+sEJDL6cbC2y5Mly0yzNf9/RshYHcQptaOAPFskj77l7nuPxnnwhxT3JJBeQG0dB54xKFgz1nGU0ZyrzkUfFrE52DSnImy7uqqZ9W203tbu77F0PWzIjPS5t+65qluThYT9E8/r8r3q37aGjVX/+Yds2v7gm1tCNZ324vPh0Ns7hLtzQVFBvI9zgzM153S5H08tqvanh7NeLn/fnO1LM70mFCzyKXAWpKYuaU8ljTj3IkmpTcpb7UnrOEd/ojiLcHsdAir7bwYyE5MFELTlngjplI5VZVNQrbSlI8DIzSjNvkt1XUrAZuSOF0GyM2XXpvC0CIhn3OopSUZUFRaWUObVKlPgVwFmdWSEi2ubCc+XKQCNnDiGLSI0vI9XaqhANB50xcp2iVCpH/IIqzhGW5IGaqAyNpdMh48x65w+wVHYAlv7bXb/Z9T91XdslWELZXGr0Z0phqcxDRFjIMbeBW+DKO0zRNW7DeFbtGu4Kt9kUL7M32yfehb5qm8ViC/1i0cPXni+a3dpDxxe+bWtwDT/oYrAck2SEcYHnnkaTBSqdL6nJGdDMZsBNkNxahrau5LkO2lAXQwIdHbU8ahQmRg6i1KqUCbRLCfgT0aGj+XyAv3aNW0JXoH6q8G2Kuq+v0eWmazfQ9XeP+Avy+yCXo5n5fIinKKbQXRTjVnSRlDtJIwOnnL3MaVkyFQAyaoPIqIyMJ04d1TbHYJlXXLL/z+nyP3I6SagzgpRZ7iWj1igE7Synjkug2gvnMHCTg38tTvfR4Hnf4znxM0meB35GgrITBHld+lxw3AiZxCLXqF/vPQ2Cc2ucVxZ+CEFsZIj9Gw47yZEu81Ip0JSXyiMgh4ACqi8XJlobSoG/58kftT6F4aJI214spTfdGtvD56pfvW3b7nPVxPb2YgPNCfMMzT+6ZNF2fzR1G24gnjATaPauA/gbunddFZeQDn7hSIm2v7VdWH3HRqHN+/Wm7XrX9B+3yxMm2AfJJ7hFcPWJ1fxYSZOu+UFJZtBRnvT0TBDPWuIghfcNym0xjJ+wvSdw3zofO97Z0KcSrElF+LSpvCIuV6LWz8qqw+8OXBy6+5S7f4Bo9QDRyFeG6HdVPaCbVEiHGyI/3BDSvDK8LYS2iY8p1BIsYH+n0YmcovvUKaygPvholJWBs/2T7ourd/gWIvdXL9bnFSlKV29hdvWsJo+WTtbh0fqT2juaP663o+lDjR3NpLoahw+YjNDW6aYld1DX7S1OHHVMntRwW8V+RYpmV9czsoJquerHUcpq0/aQHp2TOumBzkM9qB9dD/N5cF2c+qKA1GMOz4lJb7tDNZtX0uKIflqPOEY/qUkeci/GSzJ7JfhTOv8x/IeH64d/AAUx6yFBDQAA":/tef]

Hey @Anders_Gregow ,

Please also add the value of your ArduinoDisplayStates?

Yes, that should be yeah.

Okay, something is seriously wrong with one of the latest updates from Homey or the Web App.
Non-enterered arguments do not get cleared anymore, just become an empty string.
I have been getting errors because if this in multiple apps without updating any of them.

Awell, i did solve it on my end in the JSON Handler. Update to 1.2.4 (Test) and it should work.

It is in the comment card: {“ArmingWithDoorWindowOpen”:false,“MaindoorUnlocked”:false,“FreezerFridgeDoorOpen”:false,“PorchDoorOpen”:false,“ImportantMsg”:false,“NewMail”:false,“Test”:false}

Nice!
Did you do a workaround for a Homey bug or has Athom changed some API?

Works great, thanks for the fix.

Don’t know what the bug is or why, i just ignore paths with empty strings.

1 Like

@Arie_J_Godschalk @Peter_Kawa

Are you planning to buy the new Homey Pro 2023? And if yes, how are you planning to handle incoming JSON objects? The reason I ask is because I now use the HTTP Request Flowcards app, but that hasn’t been updated for some time and isn’t compatible with the new Homey.

Hope to hear from you.

Dennis

Hey dennis,

Yeah, i already preordered the early 2023.
I dont use the request app, so i am not sure what are all the options.
But, sure, if the other app is not planned to be migrated, i can add some request handle cards.

Please create a feature ticket at bitbucket with some good description, images and/or examples.

Hi @Arie_J_Godschalk

Bitbucket? Never heard of that before. Probably because your are programmer and I’m a user and learning.

I created an account at Bitbucket and got to your page. But how do I create a feature request specifically for your Json app?

Haha, sorry about that m8.
I’ll update my topics to include the respective “Report a problem” link from the app store.

All my apps have a “Report an issue/problem” link at the app store
JSON Handler App voor Homey | Homey linked to the issue site on bitbucket for the specific app.

And there ( QlusterIT / nl.qluster-it.JsonHandler / issues — Bitbucket) you can click on Create Issue (right-top side).
You don’t actually need to create a BitBucket account for it.
All my apps support tickets are publicly open and Anonymous users can create issues.

Aah ok @Arie_J_Godschalk

Thanks. Will find it now!

Hi @Arie_J_Godschalk

I created a feature request on Bitbucket.

1 Like

Hi @Arie_J_Godschalk,

I am trying to do something very simple, but I can’t get this to work. Maybe you can point me in the right direction?

I have this Advanced Flow:

But as you can see, I get an error “Unexpect token u in JSON at position 0”.

I am using this source:
https://json.tvgids.nl/v4/programs/?day=0

Which seems like a valid JSON file, because both https://jsonpath.com/ and https://jsonpathfinder.com/ are giving me correct results.

The flow should give me the name of the first TV program on the first channel.

Where’s my mistake?