# Get query to my ecoflow River Pro

**URL:** <https://community.homey.app/t/get-query-to-my-ecoflow-river-pro/72075>\
**Category:** Questions & Help\
**Tags:** homey-pro\
**Created:** [November 12, 2022, 10:06am UTC](https://community.homey.app/t/get-query-to-my-ecoflow-river-pro/72075 "2022-11-12T10:06:12Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Calbo](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/calbo/32/50388_2.png) [@Calbo](https://community.homey.app/u/Calbo)\
**Post date:** [November 12, 2022, 10:06am UTC](https://community.homey.app/t/get-query-to-my-ecoflow-river-pro/72075/1 "2022-11-12T10:06:12Z")

</div>

Hello

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

curl -X GET \ [https://api.ecoflow.com/iot-service/open/api/device/queryDeviceQuota?sn=ABC](https://api.ecoflow.com/iot-service/open/api/device/queryDeviceQuota?sn=ABC) \ -H ‘Content-Type: application/json’ \ -H 'appKey: 123456’ \ -H 'secretKey: 123456’

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [November 12, 2022, 12:32pm UTC](https://community.homey.app/t/get-query-to-my-ecoflow-river-pro/72075/2 "2022-11-12T12:32:13Z")

</div>

Hey, there are quite some examples for fetch through HomeyScript.  
You might want that, since its just a request that you need executed.

(Sorry for the short answer, but i’m on my phone)

---

<div class="post-metadata">

**Author:** ![Calbo](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/calbo/32/50388_2.png) [@Calbo](https://community.homey.app/u/Calbo)\
**Post date:** [November 12, 2022, 2:17pm UTC](https://community.homey.app/t/get-query-to-my-ecoflow-river-pro/72075/3 "2022-11-12T14:17:15Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [November 13, 2022, 7:57am UTC](https://community.homey.app/t/get-query-to-my-ecoflow-river-pro/72075/4 "2022-11-13T07:57:43Z")

</div>

Yeah, ill take a look tomorrow.

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [November 14, 2022, 10:01pm UTC](https://community.homey.app/t/get-query-to-my-ecoflow-river-pro/72075/5 "2022-11-14T22:01:53Z")

</div>

You need to fill in the serial, key and secret.  
But then it should work, i get a correct deny.

```auto
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);

```

---

<div class="post-metadata">

**Author:** ![Calbo](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/calbo/32/50388_2.png) [@Calbo](https://community.homey.app/u/Calbo)\
**Post date:** [November 15, 2022, 6:20am UTC](https://community.homey.app/t/get-query-to-my-ecoflow-river-pro/72075/6 "2022-11-15T06:20:23Z")

</div>

Hello, thank you so much. I will try it, keep you in touch. Best

---

<div class="post-metadata">

**Author:** ![Calbo](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/calbo/32/50388_2.png) [@Calbo](https://community.homey.app/u/Calbo)\
**Post date:** [November 19, 2022, 9:23am UTC](https://community.homey.app/t/get-query-to-my-ecoflow-river-pro/72075/7 "2022-11-19T09:23:03Z")

</div>

Hello,

I have this output : { code: ‘6047’, message: ‘device does not exist’ }

I will check with the manufacturer

Best, A

---

<div class="post-metadata">

**Author:** ![Christian\_Noack](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/christian_noack/32/104615_2.png) [@Christian\_Noack](https://community.homey.app/u/Christian_Noack)\
**Post date:** [March 26, 2024, 4:17pm UTC](https://community.homey.app/t/get-query-to-my-ecoflow-river-pro/72075/8 "2024-03-26T16:17:05Z")

</div>

Hi Calbo,

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.

Best regards  
Christian

---

<div class="post-metadata">

**Author:** ![DirkG](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkg/32/118897_2.png) [@DirkG](https://community.homey.app/u/DirkG)\
**Post date:** [March 27, 2024, 12:40pm UTC](https://community.homey.app/t/get-query-to-my-ecoflow-river-pro/72075/9 "2024-03-27T12:40:49Z")

</div>

> First of all, welcome to the Homey Community!
> 
> To make sure you are aware of the forum rules, please read the _ **Welcome to the forum!** _ post [here](https://community.homey.app/t/welcome-to-the-forum/31).

Apps can be requested at [Athom](https://request-a-brand.homey.app/boards/request-a-brand) or at [users](https://community.homey.app/t/requests-homey-pro-community-app-requests/2713), like mentioned in the _ **Welcome to the forum!** _ post.
