# How to set / read curtain cover positions!? (using an Aquara lumi.curtain.agl001)

**URL:** <https://discourse.nodered.org/t/how-to-set-read-curtain-cover-positions-using-an-aquara-lumi-curtain-agl001/73638>\
**Category:** General\
**Created:** [13 January 2023 13:53 UTC](https://discourse.nodered.org/t/how-to-set-read-curtain-cover-positions-using-an-aquara-lumi-curtain-agl001/73638 "2023-01-13T13:53:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![louis](https://avatars.discourse-cdn.com/v4/letter/l/ecb155/32.png) [@louis](https://discourse.nodered.org/u/louis)\
**Post date:** [13 January 2023 13:53 UTC](https://discourse.nodered.org/t/how-to-set-read-curtain-cover-positions-using-an-aquara-lumi-curtain-agl001/73638/1 "2023-01-13T13:53:55Z")

</div>

I am using Node-RED for automatons inside Home Assistant (both on latest version).

I try to control a curtain-pair using two ‘Aqara lumi.curtain.agl001’ (zigbee) motors.  
My problem is that I do not manage to set or get the curtain cover positions

There is a service called “set\_cover\_position”, however I can not make that to work. Below some pictures of my actual test-setup.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/1/01fe9b1e429880bade771fe9d06507dc7b38beec.png)

Above you see that I did define three devices:

```
a button intended to set the cover position to “0” (closed)
a button intended to set the cover position to “100” (open)
and a slider to set the cover position to something between 0 - 100
That does not work. Problem is that a / the position should arrive from the button / slider event, and I have now I idea how to do that

```

For reference _the only thing_ I could get working (but that is **NOT** the intention), is a service node with a fixed position defined inside like this

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/0/5003b4f56a420f98ef8fe7773c6226f1dde839ad.png)

For even easier testing I also used an "inject node" directly connected to the "CurtainSetCoverPos node". As said regretfully I did not manage to get it working

So my questions are:

1. how to pass a position value from some input (button / slider / etc) to the “set\_cover\_position service” !?
2. and … if possible … how to read the actual position form the curtain motor !?

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [13 January 2023 14:13 UTC](https://discourse.nodered.org/t/how-to-set-read-curtain-cover-positions-using-an-aquara-lumi-curtain-agl001/73638/2 "2023-01-13T14:13:31Z")

</div>

Welcome to the forums @louis,

As your using Home Assistant Specific nodes, you may be better of asking the HA community.  
Most here do not use Home Assistant, and are Node RED users only.

---

<div class="post-metadata">

**Author:** ![louis](https://avatars.discourse-cdn.com/v4/letter/l/ecb155/32.png) [@louis](https://discourse.nodered.org/u/louis)\
**Post date:** [13 January 2023 16:36 UTC](https://discourse.nodered.org/t/how-to-set-read-curtain-cover-positions-using-an-aquara-lumi-curtain-agl001/73638/3 "2023-01-13T16:36:22Z")

</div>

I do not understand that. Does not take away that you are probably right 😬

In my perception, you have the following layers:

- communication (zigbee, Z-wave, wifi)
- command layer ZHA etc
- inter working layer Matter ....
- automation layer e.g. Node Red
- environment e.g. Home Assistent, Tuya etc etc
- on top layers google home (voice control etc)

So in that "layered" model Node-RED can not function without layers beneath it. So I wonder how the overall stack used in the "Node-RED" model looks like

PS, I asked the same (original) question in the HA forum (but I expected more success here)

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [13 January 2023 17:04 UTC](https://discourse.nodered.org/t/how-to-set-read-curtain-cover-positions-using-an-aquara-lumi-curtain-agl001/73638/4 "2023-01-13T17:04:43Z")

</div>

> For reference _the only thing_ I could get working (but that is **NOT** the intention), is a service node with a fixed position defined inside like this

That `Data` field, what can you select there, I assume you should be able to pass a msg(.payload) as data input ? What does the documentation of the node describe ? I believe the home assistant nodes have quite extensive documentation available.

---

<div class="post-metadata">

**Author:** ![louis](https://avatars.discourse-cdn.com/v4/letter/l/ecb155/32.png) [@louis](https://discourse.nodered.org/u/louis)\
**Post date:** [13 January 2023 19:58 UTC](https://discourse.nodered.org/t/how-to-set-read-curtain-cover-positions-using-an-aquara-lumi-curtain-agl001/73638/5 "2023-01-13T19:58:35Z")

</div>

Perhaps I fixed it, but I am not sure. The curtain control is surely not yet working as it should. Apart from this issue which I may be solved, a better zha-driver would surely be appreciated.

But for now I tried the following

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/f/4fde0c86f13daf22418f4e4d3d7a034ad0f47014.png)

What is may be working (no errors)

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [13 January 2023 20:04 UTC](https://discourse.nodered.org/t/how-to-set-read-curtain-cover-positions-using-an-aquara-lumi-curtain-agl001/73638/6 "2023-01-13T20:04:16Z")

</div>

Try setting the `Data` field to `J:` (JSONata)

![Screenshot 2023-01-13 at 20.03.32](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/0/609472eb38ebbe74899d755ad38192747c067785.png)

Then set the value to `{"position": payload }`

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [14 March 2023 20:05 UTC](https://discourse.nodered.org/t/how-to-set-read-curtain-cover-positions-using-an-aquara-lumi-curtain-agl001/73638/7 "2023-03-14T20:05:05Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
