Washer Energy History

Hello,

I’m looking for a way to collect the energy history of my samsung st washer.

in the smartthings app, I have access to a tab called “energy monitor” (pictured below).

However, I was unable to find out, how to get access to this data programmatically. The response of the default /status api call only delivers a power consumption report of the following format:

"start": {
    "title": "Iso8601Date",
},
"end": {
    "title": "Iso8601Date",
},
"energy": {
    "type": "number"
},
"power": {
    "type": "number"
},
"deltaEnergy": {
    "type": "number"
},
"powerEnergy": {
    "type": "number"
},
"energySaved": {
    "type": "number"
},
"persistedEnergy": {
    "type": "number"
},
"persistedSavedEnergy": {
    "type": "number"
}

The device does not seem to have access to the powermeter capability. My best guess is, that either, the data shown in the energy monitor tab is assembled from the power-consumption-report locally (if this is the case, how does one have to interpret this data?), or it is done via some kind of subscription. However, I was unable to find specific information about this.

Thanks for any responses.

1 Like

so the lowest charted interval is a day (yep it sucks). If you watch one washer operation and note the starting time and ending time, you can get the “average power” which is pretty dull but better than what you have now.

If the day “energy” says it consumed 1KWH, and it ran for 30 minutes (0.5 hour), then the “average power”= 1000/0.5 = 2000watts.

I dislike smart appliances for this kind of reason and others. You only get what get, unless you want to develop the wheel again, and maybe you can’t or don’t want to. Manufacturer wants to lock you in and hopefully rent your data back to you. Quite a racket.

You can workaround by picking a “smart metering plug” with better supported stream data, OR use an inline dumb meter like “Kill-a-watt” around $25

1 Like

so the lowest charted interval is a day (yep it sucks)

I would be satisfied with having the daily data the official smartthings app shows, but I can’t figure out how to get it via the smartthings api.

@orangebucket, do you have any idea what is the structure to get the report values?

1 Like

Welcome to the SmartThings Community, @anker!

If you got that result by making a query to https://api.smartthings.com/v1/devices/deviceID/status, then, that data is not available in the API.
This is something common for OCF devices, as they work on a plugin level and not an API level. Here are more details about how it works:

I can open a report about this for further investigation, to do this, I would need you to help me with the following info:

  • Device brand and model
  • Device label in your app (so I’m able to find it)
  • Authorization to access your data:
  1. Go to the SmartThings Web (my.smartthings.com)
  2. Log in to your Samsung Account
  3. Select Menu (⋮) and choose Settings
  4. Toggle on Account Data Access
  5. Select the time period and confirm - In this step, please select “Until turned off”, once I get the corresponding info, I’ll let you know.
    In case we need to enable it again, I’ll contact you directly.
1 Like

Hello, thanks for the response.

I don’t see why an investigation would be helpful in this case, as this information is definitely not in the device-status. Still, the device model is SAMSUNG WW81T854ABT/S2.

  • The APIs do not work via OCF, but the profile is the manifest of what values are available to be accessed from there.

Does this mean one has to create a profile for a given device via the api with the correct components in order to access data usually shared only via CoAP? Is there (generally) a possibility of accessing the data via the api or not?

I don’t think access to my personal data is necessary in order to answer these questions, as they are, to my understanding, unrelated to me or the washer model, but instead are about access to values usually only shared via CoAP. If this is incorrect, please let me know.

Thanks again.

No, only the manufacturer, who creates the device handler defines the capabilities of its metadata (device profile). Sorry for the confusion.

For other device types, yes. For example, Edge devices (Hub-Connected), ST Schema, Direct-Connected.
However, only the device manufacturer (that certifies their devices with SmartThings) defines which type of handler is used.
If, they give you the option to use an API to see the device info (measurements), you could create a workaround to see that info in the ST API.

That access is to get the device’s info registered in ST (device ID, Hub ID, presentation, capabilities available), with the device Ids, the team could find event logs and gather more info.

But we understand if you don’t want to proceed with a further investigation.

Can you elaborate on what you mean by this?

Sure! For example, there are some manufacturers that allow you to get info, or send commands to the device using its IP address, which means they have those endpoints configured to return the corresponding info.
If you can get data like that, you could create a “virtual device” that would interact with the device.

  • LAN driver (Only if the requests to the device are local and not through a Cloud because so far, drivers don’t support access to the public Internet to make requests)
    This option requires a SmartThings Hub compatible.
  • ST Schema. This is the easiest in case the requests that you can make to the device are something like “https://cloud.com/…”
    You need to host this integration on your own (your local system or a cloud like AWS) because it’s not saved in the Hub.

Part of the development is to create a device profile with the capabilities you need, and you can update their status in the ST API.
This way, when you make a request to https://api.smartthings.com/v1/devices/deviceId/status, you would get the value of each capability.

But, this depends on the functions provided by the manufacturer (Samsung).

1 Like

@anker, do not expect miracles. SmartThings is a Samsung company only since 2014, and Samsung has a tendency of implementing things in many different ways and then cancelling them and leaving them without any documentation and support.

You will probably see OCF or Artik naming in things…

It could be worse. My washing machine has been connected a zillion times to SmartThings. It works when it gets connected. Access to the device works in the app, power consumption shows up, sends notification when the washing finished.
But after a day or so the device shows up as disconnected and cannot be accessed anymore. The status updates on the tile in the app, and it send notifications when the load finished, but the power consumption and any other details are not accessible, because the device is “disconnected”.

2 Likes

@anker, just out of curiosity, does your washer works with SmartThings Energy?

Otherwise, probably cheaper and takes less effort just to buy a measuring plug to get what you want out of the device.

Consider that, someone in SmartThings has to spend time to try to figure out how they coded the app and the device handler for that product, which is actually manufactured by the SAME company, and probably has the “Works with SmartThings” logo on it.

And it is not a 5 years old product like when they first imagined the current API…

1 Like

Thank you for the explanation. According to the manual, one can get the source of the software that runs on the machine. I have started an inquiry with samsung regarding this, could be interesting regardless of results. I can’t imagine they will just send me the sourcecode for a washer though ^^.

I have noticed this aswell. I got the feeling that the api was more reliable than the app, but since at first I was under the illusion, that the app was talking to the same api, I thought getting the energy data has to be possible somehow. If I knew how difficult it was, I would have just moved on immediately.

Yes, I’m using those already for different things, it would just have been neat to use the already existing data. :smiley:

I’ve owned a few samsung devices over the years and I’ve always had the opinion that they make better hardware than they do software. Still, getting a notification when the machine is finished, is probably the most important feature and a pretty cool qol upgrade that not many manufacturers offer, while remotely adding rinse cycles and starting the machine is basically just a gimmick that I can’t imagine anyone regularly uses.

Anyways, thanks everyone for your time!

1 Like

For that on my older model, you have to set in advance to remote, otherwise it will not do anything.

Neither you could make to start the washing if your PV has excess output…

And not just Samsung devices, although you’d think they would be more compatible with ST. LG has limited data accessibility as well. So, when I bought a new dishwasher (Bosch), I just used the smart plug approach, cheaper, real-time data with the ability to turn it off, which is much better than my other “smart” appliances…

2 Likes

Actually my dishwasher, also Bosch, I wouldn’t put on a smart plug, because it has a flood prevention system and it shouldn’t be powered off.
If the machine detects a leak, it shuts of automatically the water, but for that it must be plugged in.

I primarily added it to see the energy use, so don’t plan to turn it off much. As I understand it, the flood prevention is only active when running, but even if that’s not the case, I have a separate flood sensor for the dishwasher and under the sink, as that seems to be the most leak prone area.

I have a Samsung Cebu Air Conditioner, in the app I see the daily energy consumption, displayed as bars, I can see for every day, month, etc.

But when I query
https://api.smartthings.com/v1/devices/XXX-XXXX-XXXX-XXXX/status
I don’t get those numbers.

I get only something like:

powerConsumptionReport: {
powerConsumption: {
value: {
energy: 676044,
deltaEnergy: 10,
power: 587,
powerEnergy: 7.256573328971863,
persistedEnergy: 676044,
energySaved: 0,
start: "2022-12-12T15:06:38Z",
end: "2022-12-12T15:07:22Z"
},
timestamp: "2022-12-12T15:07:22.431Z"
}
},

what is deltaEnergy and energySaved anyway?

How to get the energy consumption bars I see in the mobile app?

thanks!

Hi!
Those “bars”, are part of the custom UI in the mobile app. The API call to devices/status/ will only show the current value of the capability.

If you want to get the device history and graph it on your own, you can get the history of the device and process the data:

https://api.smartthings.com/history/devices?locationId=xxx-xxx-xx...&deviceId=xxx-xxx-xxx...

I’ll check with the team if we can get more details about those attributes.

Gave it a try and it returns a big json array of something similar to:

{
deviceId: "XXX-XXXXXXX-XXXXX-XXXXX",
deviceName: "Room air conditioner",
locationId: "XXX-XXXXXXX-XXXXX-XXXXX",
locationName: "My home",
time: "2022-12-10T08:17:20.000+00:00",
text: "Power of Room air conditioner is Off",
component: "main",
componentLabel: "main",
capability: "switch",
attribute: "switch",
value: "off",
unit: "",
data: { },
translatedAttributeName: "Power",
translatedAttributeValue: "Off",
epoch: 1670660240652,
hash: 824938428
}

But there are no values like in the graph on my device that tells me how much the AC consumption was during the day.

No, this endpoint will provide all the values registered for the device and it will specify the timestamp. The graph in the app must be aggregating those values to get the consumption by day, month, etc.
We can say the API provides the unprocessed data.
Could you describe why you need to see the aggregated values directly in the API?