In my homey pro I want to to do a flow to get the level of the battery in my ecoflow: if battery level is lower than 20% send me a message. How can I do ? Ecoflow gave me this request below and I don’t know how to use it in my homey pro. Someone could help me ? Than you very much. Best
Thank you very much for your help. I install HomeyScript, I took the exemple “example-fetch.js” and replace the fetch of the example by curl -X GET \ https://api.ecoflow.com/iot-service/open/api/device/queryDeviceQuota?sn=MYSERIAL \ -H ‘Content-Type: application/json’ \ -H 'appKey: MYAPPKEY’ \ -H 'secretKey: MYSECRETKEY’ and it’s not working. I m not a coder so I don’t understand much about it. Do you have an idea how to write the code as it’s work ? Thank you very much.
You need to fill in the serial, key and secret.
But then it should work, i get a correct deny.
const res = await fetch('https://api.ecoflow.com/iot-service/open/api/device/queryDeviceQuota?sn=MYSERIAL', {
headers: {
'Content-Type': 'application/json',
'appKey': 'MYAPPKEY',
'secretKey': 'MYSECRETKEY'
},
});
if (!res.ok) {
throw new Error(res.statusText);
}
// Get the body JSON
const body = await res.json();
console.log(body);
i just wanted to know what Ecoflow wrote and whether you were able to put together a useful query here?
Ecoflow now offers an API interface in the developer forum where you can generate the app-key and secret-key yourself. Together with the registered devices it should work, but I don’t have any programming experience or only read experience. I would therefore be interested to know whether there is already a code or instructions for displaying the devices/values using the API.