Sure, I need those values to display in Home Assistant to see my overall heating costs. Is winter here and I’m using the air conditioner to heat my house.
Did some more investigations, and there is a chance that the values I can see in the app are from OCF.
Using OCF Device Spy I was able to find some endpoints like:
/file/transfer/vs/0
which gives me something like:
"x.com.samsung.items": [
{
"x.com.samsung.name": "/mnt/usage.db",
"x.com.samsung.blob": "cIKrYVSVBgCGFQAAEP ....lQCgDQIAAA"
}
]
}
I assume the blob is something in base64 encoding, but after making it in a string or a binary file, I don’t get something to work with, at least is not SQLite database. Any idea?
There is also /file/list/vs/0 which gives me:
{
"x.com.samsung.items": [
{
"x.com.samsung.id": "0",
"x.com.samsung.name": "/opt/data/energy.db"
},
{
"x.com.samsung.id": "1",
"x.com.samsung.name": "/opt/data/hass.db"
}
]
}
This looks promising but don’t understand how to get my hands on that file and then how I should open it.
At last, when I use my phone to open the graphs page, after that I try to take a look at
https://api.smartthings.com/v1/devices/_my_device_id/status
and I can see the following snippet inside:
execute: {
data: {
value: {
payload: {
rt: [
"oic.r.energy.consumption"
],
if: [
"oic.if.baseline",
"oic.if.a"
],
power: 0
}
},
data: {
href: "/energy/consumption/0"
},
timestamp: "2022-12-13T06:46:48.923Z"
}
}
Next I tried to convert this in a curl POST request like:
curl -L -X POST “https://api.smartthings.com/v1/devices/_my_device_id/commands” -H “Authorization: Bearer ” -H “Content-Type: application/json” --data @sam.json
{
"commands": [
{
"component": "main",
"capability": "execute",
"command": "execute",
"arguments":[
"energy/consumption/0"
]
}
]
}
but it gives me an answer like:
{"results":[{"id":"cb194829-896a-4bf5-b466-f9f2215c1187","status":"COMPLETED"}]}
So here I am stuck now…