How do I save multiple json objects from an array to multiple tags

Built an advanced flow that connects to my cemm energymeter. Receive the response as a JSON array (as below for reference). I then save the ‘electric_power’ object as ‘Antwoord A’ tag for further use in flows.
I am having diffucilties in creating more tags from the reponse below. I know how to select other objects/values. But how do I create additional ‘Antwoord B’ ‘Antwoord C’ tags from this object?

Thanks in advance for your replies…
Screenshot 2022-09-04 17.06.43

{“data”:{“t1”:[1662303906000,10600.66],“t2”:[1662303906000,8491.69],“t3”:[1662303906000,5836.53],“t4”:[1662303906000,12787.01],“electric_power”:[1662303906000,-90],“rate”:[1662303906000,1],“gas”:[1662303906000,7575.35]},“totals”:{“electric_energy”:[1662303912000,4764.13],“electric_energy_high”:[1662303912000,-4295.32],“t1”:[1662303912000,10600.66],“t2”:[1662303912000,8491.69],“t3”:[1662303912000,5836.53],“t4”:[1662303912000,12787.01],“gas”:[1662303912000,7575.35]}}

This might help (hit the link or the v):

This is done with HTTP Requests app and Better Logic app, but
It might work now with that Adv.Flow Logics card “Read … as JSON and select path …”

Please see the app Json handler, it handles a lott of properties on one card.

Yes, this is what I was looking for. Thank You. Only remaining issue is the correct json path. On the attached screenshot i entered .data.t1[1] as path. I get no errors, but the number-1 tag’s value remains at 0… Am I overlooking something?

I’ll look into it, it should work with indexed arrays.
I have created an issue for this: QlusterIT / nl.qluster-it.JsonHandler / issues / #1 - Indexed arrays not working correct — Bitbucket
Won’t be today i think, but let me see.

Thanks for looking in to this. I really appreciate it.

Okay, its fiexed and allready Live (love that small fixes go through fast).
Update to the latest version and indexed array getter works again.

Apologies for the delay in answering. Works like a charm now. Thank you for your prompt action. Is there a donate button? (couldn’t find it)

There is a Donation button on this page JSON Handler App voor Homey | Homey

You can achieve what you want with the default cards. Not sure what you are lacking if I see your screenshot.

Thanks m8!
Much appreciated!

I have this result how do I get value of the array[17] - 0.69

[{“key”:“SN1”,“value”:“119706”,“unit”:null,“name”:“SN”},
{“key”:“DV1”,“value”:“4.2”,“unit”:“V”,“name”:“DC Voltage PV1”},{“key”:“DV2”,“value”:“133.2”,“unit”:“V”,“name”:“DC Voltage PV2”},{“key”:“DC1”,“value”:“0.0”,“unit”:“A”,“name”:“DC Current PV1”},{“key”:“DC2”,“value”:“0.0”,“unit”:“A”,“name”:“DC Current PV2”},{“key”:“AV1”,“value”:“220.0”,“unit”:“V”,“name”:“AC Voltage R/U/A”},{“key”:“AV2”,“value”:“0.0”,“unit”:“V”,“name”:“AC Voltage S/V/B”},{“key”:“AV3”,“value”:“0.0”,“unit”:“V”,“name”:“AC Voltage T/W/C”},{“key”:“AC1”,“value”:“0.0”,“unit”:“A”,“name”:“AC Current R/U/A”},{“key”:“AC2”,“value”:“0.0”,“unit”:“A”,“name”:“AC Current S/V/B”},{“key”:“AC3”,“value”:“0.0”,“unit”:“A”,“name”:“AC Current T/W/C”},{“key”:“A_Fo1”,“value”:“49.97”,“unit”:“Hz”,“name”:“AC Output Frequency R”},{“key”:“AP1”,“value”:“0”,“unit”:“W”,“name”:“AC Power R/U/A”},
{“key”:“AP2”,“value”:“0”,“unit”:“W”,“name”:“AC Power S/V/B”},
{“key”:“AP3”,“value”:“0”,“unit”:“W”,“name”:“AC Power T/W/C”},{“key”:“APo_t1”,“value”:“0”,“unit”:“W”,“name”:“Total AC Output Power (Active)”},{“key”:“Et_ge0”,“value”:“31435.2”,“unit”:“kWh”,“name”:“Cumulative Production (Active)”},{“key”:“Etdy_ge1”,“value”:“0.69”,“unit”:“kWh”,“name”:“Daily Production (Active)”},{“key”:“INV_T0”,“value”:“39.4”,“unit”:“℃”,“name”:“Temperature- Inverter”},{“key”:“t_w_hou1”,“value”:“0”,“unit”:“h”,“name”:“Total Running Hour”},{“key”:“INV_ST1”,“value”:“6”,“unit”:null,“name”:“Inverter status”}]

image

Hi there,
I am trying to fill tags (or variables) from a JSON object that is rather long, and I am not sure how to do it. I tried to use the way suggested above, but I do get an error message.

This is the JSON object:

"lat":53.5503,"lon":10.0007,"timezone":"Europe/Berlin","timezone_offset":3600,"current":{"dt":1706567667,"sunrise":1706512281,"sunset":1706543666,"temp":5.02,"feels_like":3.92,"pressure":1027,"humidity":84,"dew_point":2.55,"uvi":0,"clouds":0,"visibility":10000,"wind_speed":1.54,"wind_deg":110,"weather":[{"id":800,"main":"Clear","description":"Klarer Himmel","icon":"01n"}]},"daily":[{"dt":1706526000,"sunrise":1706512281,"sunset":1706543666,"moonrise":1706558760,"moonset":1706517960,"moon_phase":0.61,"summary":"There will be partly cloudy today","temp":{"day":7.81,"min":2.58,"max":8.33,"night":5.06,"eve":5.63,"morn":3.34},"feels_like":{"day":5.88,"night":3.36,"eve":3.93,"morn":0.91},"pressure":1026,"humidity":68,"dew_point":2.16,"wind_speed":3.07,"wind_deg":220,"wind_gust":11.28,"weather":[{"id":804,"main":"Clouds","description":"Bedeckt","icon":"04d"}],"clouds":96,"pop":0,"uvi":0.55},{"dt":1706612400,"sunrise":1706598587,"sunset":1706630183,"moonrise":1706649420,"moonset":1706604780,"moon_phase":0.64,"summary":"There will be clear sky until morning, then partly cloudy","temp":{"day":8.84,"min":4.83,"max":9.68,"night":5.87,"eve":9.29,"morn":5.15},"feels_like":{"day":6.79,"night":1.78,"eve":6.53,"morn":3.19},"pressure":1025,"humidity":77,"dew_point":4.98,"wind_speed":7.25,"wind_deg":253,"wind_gust":13.32,"weather":[{"id":804,"main":"Clouds","description":"Bedeckt","icon":"04d"}],"clouds":100,"pop":0,"uvi":0.45},{"dt":1706698800,"sunrise":1706684891,"sunset":1706716700,"moonrise":1706740140,"moonset":1706691660,"moon_phase":0.67,"summary":"Expect a day of partly cloudy with clear spells","temp":{"day":5.75,"min":2.64,"max":6.63,"night":5.53,"eve":4.87,"morn":3.58},"feels_like":{"day":2.32,"night":1.03,"eve":0.94,"morn":0.05},"pressure":1031,"humidity":73,"dew_point":1.37,"wind_speed":7.49,"wind_deg":229,"wind_gust":18.38,"weather":[{"id":803,"main":"Clouds","description":"Überwiegend bewölkt","icon":"04d"}],"clouds":53,"pop":0,"uvi":0.63},{"dt":1706785200,"sunrise":1706771193,"sunset":1706803218,"moonrise":0,"moonset":1706778540,"moon_phase":0.7,"summary":"Expect a day of partly cloudy with rain","temp":{"day":6.52,"min":3.43,"max":6.95,"night":4.8,"eve":4.62,"morn":6.44},"feels_like":{"day":2.7,"night":0.94,"eve":0.45,"morn":2.98},"pressure":1024,"humidity":77,"dew_point":2.65,"wind_speed":7.5,"wind_deg":243,"wind_gust":17.74,"weather":[{"id":501,"main":"Rain","description":"Mäßiger Regen","icon":"10d"}],"clouds":19,"pop":1,"rain":2.15,"uvi":0.61},{"dt":1706871600,"sunrise":1706857493,"sunset":1706889736,"moonrise":1706831040,"moonset":1706865480,"moon_phase":0.73,"summary":"Expect a day of partly cloudy with rain","temp":{"day":6.3,"min":3.77,"max":8.59,"night":8.59,"eve":8.48,"morn":3.77},"feels_like":{"day":2.24,"night":4.94,"eve":5,"morn":-0.05},"pressure":1020,"humidity":84,"dew_point":3.75,"wind_speed":7.64,"wind_deg":266,"wind_gust":16.06,"weather":[{"id":500,"main":"Rain","description":"Leichter Regen","icon":"10d"}],"clouds":100,"pop":1,"rain":0.34,"uvi":0.18},{"dt":1706958000,"sunrise":1706943791,"sunset":1706976255,"moonrise":1706922120,"moonset":1706952660,"moon_phase":0.75,"summary":"Expect a day of partly cloudy with rain","temp":{"day":8.75,"min":6.07,"max":9.23,"night":6.07,"eve":6.35,"morn":9.14},"feels_like":{"day":5.84,"night":3.22,"eve":3.58,"morn":5.68},"pressure":1018,"humidity":87,"dew_point":6.59,"wind_speed":7.95,"wind_deg":270,"wind_gust":16.31,"weather":[{"id":500,"main":"Rain","description":"Leichter Regen","icon":"10d"}],"clouds":100,"pop":0.2,"rain":0.3,"uvi":0.82},{"dt":1707044400,"sunrise":1707030086,"sunset":1707062773,"moonrise":1707013440,"moonset":1707040200,"moon_phase":0.8,"summary":"You can expect partly cloudy in the morning, with rain in the afternoon","temp":{"day":7.32,"min":4.1,"max":8.08,"night":8.08,"eve":7.51,"morn":4.1},"feels_like":{"day":3.83,"night":3.6,"eve":3.43,"morn":0.46},"pressure":1018,"humidity":76,"dew_point":3.42,"wind_speed":10.28,"wind_deg":245,"wind_gust":23.65,"weather":[{"id":500,"main":"Rain","description":"Leichter Regen","icon":"10d"}],"clouds":100,"pop":1,"rain":1.21,"uvi":1},{"dt":1707130800,"sunrise":1707116380,"sunset":1707149293,"moonrise":1707104820,"moonset":1707128340,"moon_phase":0.83,"summary":"You can expect rain with snow in the morning, with partly cloudy with clear spells in the afternoon","temp":{"day":3.32,"min":3.22,"max":9.94,"night":3.22,"eve":3.83,"morn":7.62},"feels_like":{"day":-2.64,"night":-2.21,"eve":-1.97,"morn":3.66},"pressure":1006,"humidity":66,"dew_point":-2.46,"wind_speed":10.14,"wind_deg":295,"wind_gust":24.13,"weather":[{"id":616,"main":"Snow","description":"Regen und Schnee","icon":"13d"}],"clouds":100,"pop":1,"rain":5.45,"snow":0.11,"uvi":1}]}

This is my test flow:

And this is the error message:

I also looked into using the JSON Handler app, but failed from the very beginning…

Any assistance would be greatly appreciated.

Regrads

Why did that fail?

I think you should use $. At the start of the path.

I put an $ before the path, different error message:

it failed - to put it simple - because I am too dumb… the docs are not really sufficient for men to figure out the “syntax” of the app… Unfortunately, I have no better way to describe my difficulties… A working example flow with the respective JSON data would probably suffice, but the screen shots at the beginning are no help to me… :((

1 Like

I am asuming you are missing the opening {, so i have added that (else its not a valid JSON).

Then, in the Path/Pfad, enter:
daily[0].summary
or
$.daily[0].summary

if you want the first summary.
The use of the $. in this case is not needed btw.

1 Like