Creating tile with data from HTTP response

Hello,
Please help a newbie without much programing knowledge :slight_smile:

I’d like to show some data from PV - SolarEdge API.
I figured out this URL which has all the the data.

https://monitoringapi.solaredge.com/site/2948632/overview?api_key={MY_API_KEY}

How to show one or two numbers in a tile?

Regards,
Dusan

Hi @DusanH welcome to the community and thanks for posting. I’ve edited your post to redact your API Key.

It looks like the Solar Edge API supports requesting JSON format by appending .json to the path. So in your case, the URL would look like

https://monitoringapi.solaredge.com/site/2948632/overview.json?api_key={MY_API_KEY}

You can use that along with an HTTP Action within a rule to retrieve the data from the API:

In this case, it looks like the API returns a response like:

{
	"overview": {
		"lastUpdateTime": "2024-01-22 17:00:22",
		"lifeTimeData": {
			"energy": 19257584
		},
		"lastYearData": {
			"energy": 344912
		},
		"lastMonthData": {
			"energy": 344912
		},
		"lastDayData": {
			"energy": 23951
		},
		"currentPower": {
			"power": 0
		},
		"measuredBy": "INVERTER"
	}
}

So you could retrieve the lastDayData, for example, with the following variable (where you would select Context Variable → Response → HTTP and enter just the path: overview.lastDayData.energy)

$context.response.data.overview.lastDayData.energy

Thank you !!!
Made it work and i’ll write this solution with screenshots in one old SolarEdge topic in Smartthings these days :slight_smile:

1 Like