[APP][Pro] JSON Handler and Manipulator

Hi,

What I’m trying to do is to make a framework to send commands using JSON and Advance trigger to control my Eufy cameras. The JSON are not sent to the cameras, I using them only in my flows.

I have no experiences with JSON and I’m struggling to understand how I should do to make an array of objects using the Build JSON card. Any tips how I could accomplish that?

Se an example below how I think the JSON could look like if i want to sent several “commands”
at ones in an array and how I try to build the JSON.

image

{
	"type": "AdvancedTrigger",
	"trigger": "EUFYKÖKET",
	"source": "eufy_köket_away",
	"commands": [
		{
			"type": "SECURITYMODE",
			"name": "AWAY",
			"force": true
		},
		{
			"type": "SETTINGS",
			"name": "MOTIONTRACKING",
			"value": true
		},
		{
			"type": "SETTINGS",
			"name": "NIGHTVISION",
			"value": true
		}
	]
}

You can place the whole array in the json value of the card.
So, the complete [...]

Hi

I have a problem, i get a lot of \ in my json

I create a jason


and get the output

And then i put that json in another json

and get a bunch of
how do i get rid of those?

the backslashes isnt in the json-variable in the card


only in the result

/Rikard

does maybe @Arie_J_Godschalk have any ide how to get rid off the \ in the json?

@janrikard
I am unsure what you are trying todo.
You already get a JSON, but then tou create a new empty json (with the flowcard), set a property (from which the name comes from a tag) with the first json, as text?

Are you trying to modify or read the properties?
In both cases (both different flowcards), place the json tag in the Existing Json field.

Hi

Im trying to construct a json like this

{
    "Fri": {
        "date": "2025-01-24",
        "predicted_production": 24,
        "produced_production": 24
    },
    "Sat": {
        "date": "2025-01-25",
        "predicted_production": 25,
        "produced_production": 25
    },
    "Sun": {
        "date": "2025-01-26",
        "predicted_production": 26,
        "produced_production": 0
    },
    "Mon": {
        "date": "2025-01-27",
        "predicted_production": 5,
        "produced_production": 0
    }
}

And i never successed doing that in one step first i construct the with one flowcard

{
        "date": "2025-01-24",
        "predicted_production": 24,
        "produced_production": 24
    }

and then trys to add that to a new json with a second flowcard

 "Fri": {
$json
}

hope this make it more clear

/Rikard

Okay, what you wanna do is:


Here i create a JSON.

Then use this card:

And use it like this:

Doesnt understand what i do wrong

first flowcard

second flowcard

Ive oalso tested without variables in the first flowcard, still gets the
/Rikard

Thats not the right flowcard.
There are flowcards to build json’s with text, numbers and yes/no’s.
And there is another flowcard to build a json with properties filled with a json as value. Thats the one you need. Please check my last post for the specific flowcard that your need.

1 Like

Thank you very much.
With the right flowcard it works perfectly

/Rikard

1 Like

Newby to Homey Pro and JSON

I’m looking to read a json url and found the JSON handler app but am I correct in thinking this doesn’t read a url, just parses it?

I was going to use the http get app but that’s not supporting homey pro.

I’m trying not to use the advanced flows for now so what is the best way please (with app or not) to read a json url, parse it and then I can display values.

thank you :smiling_face:

Hi Adam,

This is possible with onboard logic cards


(the Homeyscript card is completely optional)

Complete flow and background:
https://community.homey.app/t/app-pro-sysinternals-shows-homey-s-system-internals/78650/226

Here’s a bunch of interesting JSON parsing Q&A:
https://community.homey.app/search?context=topic&context_id=145181&q=parse%20json&skip_context=true

Thank you.

is this only available with the advanced flows? Not ventured there yet as most of what i need I prefer in the mobile/tablet app.

Thanks, Adam

No problem, Adam.

Yes, only with advanced flow.
Because the standard flow has no options to pass the result of a “Then” card per tag to the next card; plus there’s no “Parse JSON …” card available because of that.

.
I work with Advanced flow on my tablet most of the time, using local account + web app, or my.homey.app.
It only needs an additional BT or USB mouse, to be able to use key functionality, like line drawing and dragging (a selection of) cards around.