[APP][Pro] JSON Handler and Manipulator

Arie_J_Godschalk
Thu, 21 Jul 2022 09:01:57 +0000
Apps

Live in Store now!

homey.app

JSON Handler | Homey

JSON handler and manipulator

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.

→

Loop cards

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

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

Here is another example:

[APP][Pro] FTP Client - Control FTP Servers through a directory-based UI in the Homey App or Web App Apps

Okay, next up: Flowcard: You can retrieve all files from a folder as JSON Array/Collection. Flowcard: Get a Image Token from path. This one is actually the same flowcard as Get Image Token from dropdown, i added a optional sub-path to it). What can you do with it (not write yet, that’s next @B3rt ) : You can Loop through all files in a folder and do something with the images, like send them to your phone, or (maybe later) save them on an external FTP somewhere. You can also loop thro…

Please report issues or feature requests at QlusterIT / nl.qluster-it.JsonHandler/ issues — Bitbucket.

Apps:

[Profile] Arie J. Godschalk Developers

Apps developed or maintained by me: Advanced Triggers , BeNext , Better Logic , Chronograph , Device Capabilities , Advanced Virtual Device , FTP Client , Google Services , Homesh Controller , Homesh Satellite , JSON Handler and Manipulator , LOQED , Music Url Converter , Simple Log , Universal Media Player and Virtual Devices . Goto profile of Arie J. Godschalk for more …

Donations or Sponsorship

[Profile] Arie J. Godschalk Developers

Donations or Sponsorship. You can help with the development, maintenance and support for the Apps, by donating or becoming a sponsor. This would be much appreciated! The more donations i receive, the more time i can make free for development and support. Donations can be done through: [PP] PayPal Requires a PayPal account. [GS] Github Sponsors Allowes for CreditCard. Sponsorships can be done through: [P] Patreon Requires a Patreon account. [GS] Github Sponsors …

115 posts - 24 participants