HTTP Binding: Extract item state out of long String + Transformation?

Hello

right now i am implementing my smart charging solution (PV to EV).
The Wallbox can be controlled via HTTP API and it is working. I am new to this so it’s not that easy for me.
I managed to start/stop and set the operating mode for now.
Unfortunately i did only achieve write only so far. That’s a problem and i am figuring out how to read right now.

The URL read returns all kind of information (see screenshot). There is no single URL for a specific information unfortunately.

How can i “strip” out a value - for instance state “A”?

Using two items for state and control would be difficult but i have no idea how to solve this.
I would need to Regex?! the State (for the state item) AND transform A to whatever i use (on/off).
I don’t thing both is possible so I would need proxy items and rules to cast ON/OFF based on the state (A B C) or is there an easier way?

Thank you!

It looks like the output is JSON. Install the JSONPATH Transformation Service. Then in your Thing Channel, use the incoming transformation field.

If you share the JSON as text inside code fences (rather than a screenshot) we can help with formatting.

The Switch Thing Channel also has an onValue and offValue parameter, which you can map to the appropriate string. So you should be able to do everything you want within the Channel.

1 Like

I just read into jsonpath as i saw your reply pop up :wink: Thanks a lot!
This is exactly, what i need.

:slight_smile:

Works like charm at first try :slight_smile: Thanks again!