[APP][Pro] JSON Handler and Manipulator

Live in Store now!

Lightweight app for creating, manipulating and retrieving JSON objects.

You can alter a existing JSON object, or one will be created.
No need to pre-define the structure.

You can, for example, use the output JSON token as HomeyScript argument, and use JSON.parse(args[0]) to read the object you created.

Creating and Manipulating JSON.




Output from the bottom left two cards:

{
    "main5": true, // or     "main10": true,
    "1arg": {
        "test1": true,
        "light": {
            "text": "Test1"
        },
        "Intend": 8,
        "Bool": true
    },
    "3args": {
        "test3": true,
        "light": {
            "text": "Test3"
        },
        "Intend": 8,
        "Bool": true
    },
    "5args": {
        "test5": true,
        "light": {
            "text": "Test5"
        },
        "Intend": 8,
        "Bool": true
    },
    "10args": {
        "test10": true,
        "light": {
            "text": "Test10"
        },
        "Intend": 8,
        "Bool": true
    }
}



Reading JSON.

Reading the above generated JSON.



image



If you have a feature request, leave a message.

More coming.

2 Likes

Reserved

Reserved 2

Reserved 3

Why not use the built in cards. Abusing arguments like this make things very ugly.

Because that means many cards.
This way flows can have way less cards when interacting with e.g. HomeyScript!

Also, when using Read JSON, you will get all the same TAG’s.
With JSON Handler Retrieve cards, you get different Tagnames; which makes it more readable i.m.h.o.

And, as you perhaps have noticed allready, people allready are using different methods instead of the default JSON editors, because it creates to many cards: HomeyScript: Any sane ways to use args? - Questions & Help - Homey Community Forum

I’m not sure how that is related to this? You would still need to do JSON.parse(args[0]) in your script. Since Homey does not really have a JSON type token.

Yes, ofc, indeed you need to parse the json in HS.

But with this app you don’t need to manually parse it (and remember the double quotes for strings) like this:

Also you dont need to customly define the JSON and than add all properties through multiple cards like this:

Now you just need:

Will give it a shot in the future. At this moment i am rewriting all my flows into the advanced flows. I also have many flows involving json. They were a hell of a job, so maybe this is THE app for me. In advance thx for creating this. I hope that my old method with this app is easier, had to make 24 calls collecting data about themperature, humidity, wind, etc etc for every hour. For three collections of data that will be 72 calls. And i have many many other data that i wanted to collect. Just a little example how it now worked

1 Like

Version 1.0.4 is live in store now: JSON Handler App voor Homey | Homey

Say you are using the Read JSON card with 3 arguments.
Can you use only 2 of the arguments?
Can you use both argument-text1 and argument-number1, or only one of them?

Any way you wanna go.
Almost all arguments are optional, so you could, if you wish, always use the 3x10 argument card, also if you just start with one text.

The json is also optional: if non is supplied, a json object is created.

Also, properties that are non existing on existing Json’s, are created when filled. So, no need to pre-define the Json structure.

Hi,

I hoping this app are what I need but I don’t know if it’s possible and I have a hard time to get started.

I’m using the Asus WRT app connected to my router and from that I get a trigger when some device connects to the router. From the trigger card there are four tags, name, nickname, IP and MAC.

What I like to do is to have a database that updates dynamic with connected devices. Is it possible with this app? Any tip to get me started?

Thanks

I think you’ll need a little MySQL server and this app [APP][PRO] MySQL-Client