Closed Thomptronics closed 1 month ago
Thanks for the information. Didn't noticed it yet. Gonna add it.
@Thomptronics - I had a look at the docs and the response from the api as well. Question: what do you mean by "productName" - do you mean the name that you can set per device within the app - like "My Delta2" or do you mean the product-type like delta2, powerstream etc?
In the docs only the "deviceName" is mentioned and only this is returned by the API. So the current API output is as follows:
{
"code": "0",
"message": "Success",
"data": [
{ "sn": "HW51XXXXX", "online": 1, "deviceName": "PowerStream" },
{ "sn": "HW52XXXXX", "online": 1, "deviceName": "ESP1" },
{
"sn": "HW52XXXXX",
"online": 1,
"deviceName": "My desk"
},
{ "sn": "HW52XXXX", "online": 1, "deviceName": "TV" }
]
}
This is also returned by the getDevicesPlain()-method.
If you have additional information, just let me know.
@Thomptronics - I had a look at the docs and the response from the api as well. Question: what do you mean by "productName" - do you mean the name that you can set per device within the app - like "My Delta2" or do you mean the product-type like delta2, powerstream etc?
In the docs only the "deviceName" is mentioned and only this is returned by the API. So the current API output is as follows:
{ "code": "0", "message": "Success", "data": [ { "sn": "HW51XXXXX", "online": 1, "deviceName": "PowerStream" }, { "sn": "HW52XXXXX", "online": 1, "deviceName": "ESP1" }, { "sn": "HW52XXXXX", "online": 1, "deviceName": "My desk" }, { "sn": "HW52XXXX", "online": 1, "deviceName": "TV" } ] }
This is also returned by the getDevicesPlain()-method.
If you have additional information, just let me know.
@rustyy I just reloaded my Home Asisstant integration and am able to confirm, that the JSON response now contains productName
elements.
Thanks to that I can remove some code needed to determine the product by the SN. 😄
"data": [
{
"sn": "DAEB***********",
"deviceName": "DELTA Max",
"online": 0,
"productName": "DELTA Max"
},
{
"sn": "HW51************",
"deviceName": "PowerStream",
"online": 1,
"productName": "PowerStream"
},
{
"sn": "HW52************",
"deviceName": "Smart Plug 2",
"online": 0,
"productName": "Smart Plug"
},
{
"sn": "HW52************",
"deviceName": "Smart Plug Fridge",
"online": 0,
"productName": "Smart Plug"
},
{
"sn": "HZ31************",
"deviceName": "SAST Left",
"online": 1,
"productName": "Single Axis Solar Tracker"
},
{
"sn": "HZ31************",
"deviceName": "SAST Right",
"online": 1,
"productName": "Single Axis Solar Tracker"
}
]
@Thomptronics - I had a look at the docs and the response from the api as well. Question: what do you mean by "productName" - do you mean the name that you can set per device within the app - like "My Delta2" or do you mean the product-type like delta2, powerstream etc?
In the docs only the "deviceName" is mentioned and only this is returned by the API. So the current API output is as follows:
{ "code": "0", "message": "Success", "data": [ { "sn": "HW51XXXXX", "online": 1, "deviceName": "PowerStream" }, { "sn": "HW52XXXXX", "online": 1, "deviceName": "ESP1" }, { "sn": "HW52XXXXX", "online": 1, "deviceName": "My desk" }, { "sn": "HW52XXXX", "online": 1, "deviceName": "TV" } ] }
This is also returned by the getDevicesPlain()-method.
If you have additional information, just let me know.
@rustyy See Nid01's response above for the additional info. And, thanks again for looking into this. If you aren't getting the same results, I wonder if it's a difference between api-e (Europe) and api-a (America).
interesting 🧐 ... which host are you using @Thomptronics , @Nid01 ? I had a similar assumption about a difference between EU and US
interesting 🧐 ... which host are you using @Thomptronics , @Nid01 ?
@rustyy I'm connecting to api-e.
@rustyy I'm using https://api-a.ecoflow.com
Okay now I get it as well 😅
So there is a new version for the schema-package released. If you update, getDevicesPlain() returns the "productName"
Awesome. Thanks so much. Will this update to github automatically update NPM, or is that a separate operation for you?
The package has already been updated on NPM , so you need to ensure to have @ecoflow-api/schemas in version 0.0.9. You can check by running "npm outdated".
Got it. Works beautifully. Cheers.
FYI, if you need someone to help test any Delta Pro or SHP1 additions, I'd be happy to help.
@Thomptronics , this would be great!
On the one hand could provide some data-examples that gets returned by the getDevicePropertiesPlain so I could create some schemas for this, as the official docs at some points are misleading and its not clear how the actual structure looks like, especially for the SHP.
Here is an example on how I did at least for the devices I own or where the docs are clear: packages/rest-client/src/fixtures/delta2Properties.ts - a json would be totally fine. If you do so, strip off/change all sensitive values. The most important things are the structure itself.
On the other hand, you could then test all the commands, once I've implemented the DP and SHP device classes.
Feel free to open up additional feature requests for those devices :) ... you may provide some data there or send me an email
Files sent via email. Glad to help.
Feature requests created for SHP and DP:
The EcoFlow API now returns product names when you query a device list. It would be great if getDevicesPlain() included this new productName field in its response.