Rest command: how to catch output and parse it

Hello,

I see nowhere in the doc how to catch the output of a rest command.
I know how to call an external api, but where is stored the response (json formatted) and how to parse it?
Thank you

The REST Command integration creates a Home Assistant Service. HA services don’t have return values nor otherwise generate output, they are one-way outgoing calls only. Depending on your needs, you may want to consider one of the other REST integrations: sensor, binary sensor, or switch, all of which would allow you to capture (and potentially parse) the output.

1 Like

Thank you to confirm what I guessed. I already tried the rest sensor integration, see here my post: Restfull sensor post which is not suited because the response is above 254 characters. This raises the more generic question: how to call an external http API and process the json response whatever the length is.

I just replied to your other thread since it had your example code in it. If you have any issues for follow up questions, I’ll be happy to try to help over there.

1 Like