Translate wget command into http Logic flow card

Can someone assist with the following problem:

to retrieve data from my solarlog i can use a simple shell script:
wget -qO- --post-data=‘{“801”:{“170”:null}}’ http://192.168.0.13/getjp

then answer is
{“801”:{“170”:{“100”:“26.03.24 10:14:45”,“101”:2861,“102”:2928,“103”:233,“104”:428,“105”:4619,“106”:25425,“107”:357131,“108”:904577,“109”:5584104,“110”:0,“111”:0,“112”:0,“113”:0,“114”:0,“115”:0,“116”:6825}}}

how to use the logic http request card to achieve the same in homey and then to store the calues into variables.
thank you

Hello,

To replicate the wget command in Homey using the HTTP request flow card and store the values into variables, you can follow these steps:

Create a Logic Flow Card:

Choose the “HTTP request” flow card in Homey.
Set the method to “POST”.
Enter the URL http://192.168.0.13/getjp/Official Website.
In the body, enter the JSON data {“801”:{“170”:null}}.

Handle the Response:
Use the “Then…” part of the flow to handle the response from the HTTP request.
You can use “Set a variable” action cards to store the values you need into Homey variables.

Extract and Store Values:
For each value you want to store, you will need to create a separate action card.
Use the tag (token) that represents the response from the HTTP request.
Use Homey’s built-in Logic to extract the values from the JSON response and assign them to variables.
Here’s an example of how you might set up the action card to store the value of “101”:

Action Card: Set a variable
Variable name: Total_Yield
Value: {{JSONPath query to extract the value of “101” from the HTTP response}}

You would need to repeat this for each value you want to store, using the appropriate JSONPath query to extract each value.

I hope the information may helps you.

Best regards,
Yvonne Rhodes

Thank a lot.
the answer is unfortunately

image

Whereas from a shell

wget -qO- --post-data=‘{“801”:{“170”:null}}’ http://192.168.0.13/getjp

{“801”:{“170”:{“100”:“26.03.24 10:14:45”,“101”:2861,“102”:2928,“103”:233,“104”:428,“105”:4619,“106”:25425,“107”:357131,“108”:904577,“109”:5584104,“110”:0,“111”:0,“112”:0,“113”:0,“114”:0,“115”:0,“116”:6825}}}

Maybe you try a more simple post command first, to get to know the syntax and detect where the problem is. For example using “help” in the text or nothing at all. Maybe it has to just to do with quotes😉

the ’ where missing.
‘{“801”:{“170”:null}}’

now i get the answer and must learn to parse the json :slight_smile:

Solved

:+1: