Setting up simple GET request and storing value as numeric logic object

That is too bad. I’m working around the HTTP Requests app, as it doesn’t look like it will be updatet to SDKv3. The developer hasn’t provided any contact information, and there is no topic available.

I’m looking to do the same thing with Homey’s own logic in advanced flow. But I get stuck at the header and body of the HTTP request.

Perhaps just {}?

You used the wrong request card, you need the one with the tag icon behind it’s title (just below it in the list).

The headers and body inputs are optional and can be kept empty.

1 Like

Thanks for your help, the flow now continues. But the variable is not set. Am I missing something else?

{"embedded": null, "links": {"_self": {"deprecation": null, "href": "https://api.groupe-psa.com/connectedcar/v4/user/vehicles/1566c497a5655686153316861545651784d7a41344d6a456a497a6b3459544532597a59794f44686a4e32517a4d54686c4d6a52685a474d7759574e6c5a54646c4e5746685a4751794e32526d4e4759304f5745354e6d566b596a686d5a6a466d5a4445314e5455314d5445794e54513d/status", "hreflang": null, "name": null, "profile": null, "templated": null, "title": null, "type": null}, "vehicle": null}, "battery": {"current": 0.0, "voltage": 97.5}, "doors_state": null, "energy": [{"updated_at": "2022-11-01 07:44:53+00:00", "autonomy": 330.0, "battery": null, "charging": {"charging_mode": "No", "charging_rate": 0, "next_delayed_time": "PT7H45M", "plugged": true, "remaining_time": "PT0S", "status": "Stopped"}, "consumption": null, "level": 97.0, "residual": null, "type": "Electric"}], "environment": null, "ignition": null, "kinetic": {"acceleration": null, "moving": null, "pace": null, "speed": null}, "last_position": {"type": "Feature", "geometry": {"coordinates": [null, null, null], "type": "Point"}, "properties": {"heading": null, "signal_quality": null, "type": null, "updated_at": null}}, "preconditionning": {"air_conditioning": {"failure_cause": null, "programs": [{"enabled": false, "slot": 1, "recurrence": "Daily", "start": "PT12H", "occurence": {"day": ["Mon"]}}], "status": "Disabled", "updated_at": "2022-11-01 07:44:52+00:00"}}, "privacy": {"state": "None"}, "safety": null, "service": {"type": "Electric", "updated_at": "2022-10-20 20:30:13+00:00"}, "timed_odometer": {"updated_at": null, "mileage": 16424.2}}

Your using jQuery (I think) as path, Homey uses javascript, so should be energy[0].level
Little bit difficult to double check everything in your card on mobile.

Sadly, that also didn’t work. The variable doesn’t change, while the flow continues. I have no clue about jQuery and javascript when I have to type it myself. When I read it, I can understand it. Does anyone have another suggestion? Thanks :slightly_smiling_face:

How are you checking that the variable (not) changed?

JSONPath.

The card returns a new token with the updated JSON. The old token is not updated/mutated.

I checked my logic in Homey.
I don’t understand why your “to”-value is 1337. It should return 97.0 (the value is near the blue “nipple” in your IF-card).

When I add another logic-card, Homey says the result of the "parse-"card is the full JSON. Maybe the path is not correct?

Are you trying to read the value in energy[0].level or write to it?

It seems you are trying to read the value which means you are using the wrong card.

1 Like

Awesome, that did the trick!! The card I used seemed to store the JSON value directly in a logic variable, but now I got it.

Thank you all for your help. And the solution for others with the same question in the future:

1 Like

Does this also work without advanced flow, or is this a function of the advanced flow ?

I try to get information from the electric house boiler, but doesnot store the variable into logics.

Thanks