# Create virtual sensors to register device changes

**URL:** <https://community.homey.app/t/create-virtual-sensors-to-register-device-changes/100547>\
**Category:** Questions & Help\
**Created:** [January 9, 2024, 10:30am UTC](https://community.homey.app/t/create-virtual-sensors-to-register-device-changes/100547 "2024-01-09T10:30:33Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Flyto](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/flyto/32/85187_2.png) [@Flyto](https://community.homey.app/u/Flyto)\
**Post date:** [January 9, 2024, 10:30am UTC](https://community.homey.app/t/create-virtual-sensors-to-register-device-changes/100547/1 "2024-01-09T10:30:33Z")

</div>

Hello everyone, hope someone can help me find a solution to this! 🙂

TL;DR: Can I somehow create a sensor to trigger when a device gets activated/changed?

Tonight, Athom released the beta of Matter integration which is awesome because the Aqara Integration does not offer the device capabilities I need. So I moved my Aqara roller shade controllers back to my Aqara hub and integrated them via the Matter integration → works great! Only thing I am now missing is the “when closing” trigger. However, its really important as well to prevent blinds from closing when the window is opened, anyone an idea for a workaround? 😃  
Really appreciate any input that gets me in the right direction. Thanks a ton! 🙂

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [January 9, 2024, 10:37am UTC](https://community.homey.app/t/create-virtual-sensors-to-register-device-changes/100547/2 "2024-01-09T10:37:00Z")

</div>

> [@Flyto](#):
>
> prevent blinds from closing when the window is opened,

This is a more logic approach (to me):  
When  
-button pushed  
And  
-window Y is closed  
Then  
-close/open blinds Y

---

<div class="post-metadata">

**Author:** ![Flyto](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/flyto/32/85187_2.png) [@Flyto](https://community.homey.app/u/Flyto)\
**Post date:** [January 9, 2024, 10:48am UTC](https://community.homey.app/t/create-virtual-sensors-to-register-device-changes/100547/3 "2024-01-09T10:48:28Z")

</div>

that doesnt work because there are no buttons being pressed, there are a lot of different flows controlling the blinds not solely on Homey, before this worked very well because the Aqara App does have the “is closing” trigger, however, it does not have the ability to just open/close the blinds (had to be to a specific position) thus my move back to the Aqara hub.

It’s also that I do not want the blinds to just not close but if they are closing or are already closed they should go to 70% closed instead of 100% (because the window doesnt cover the upper 30%).

I figured it must be somehow possible to register device changes no?

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [January 9, 2024, 11:06am UTC](https://community.homey.app/t/create-virtual-sensors-to-register-device-changes/100547/4 "2024-01-09T11:06:18Z")

</div>

The button was just a trigger example…  
You can add the “And window Y is closed” to any flow.

> [@Flyto](#):
>
> It’s also that I do not want the blinds to just not close but if they are closing or are already closed they should go to 70% closed instead of 100% (because the window doesnt cover the upper 30%)

Ah, that’s also no problem  
When  
-something triggers this flow  
And  
-window Y is closed  
Then  
-set position of blinds Y to 30% (or 70% but that’s system dependent)

The positions here are:  
0% = closed  
100% = open  
But it can be the other way round with your blinds.  
Note: not all apps provide for the “position” cards, only open or close cards.

For the blinds getting closed by foreign systems:

> [@Flyto](#):
>
> the Aqara App does have the “is closing” trigger

Why don’t you use it, that should work perfect as “state change” trigger.

The Xiaomi app for the Aqara hub should have these usable trigger cards:

> ![Screenshot_20240109-121156_Chrome](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/c/dc7d469d352253235ebfca2d81afeefbef7be412.jpeg)

Aqara app:

> ![Screenshot_20240109-121454_Chrome](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/d/8da9cf0297d561f70a4dc8a2412b735b53530c8f.jpeg)

So, in my opinion, there’s several trigger cards to stop the curtains from closing when non-Homey devices operate your blinds.

---

<div class="post-metadata">

**Author:** ![Flyto](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/flyto/32/85187_2.png) [@Flyto](https://community.homey.app/u/Flyto)\
**Post date:** [January 9, 2024, 12:45pm UTC](https://community.homey.app/t/create-virtual-sensors-to-register-device-changes/100547/5 "2024-01-09T12:45:28Z")

</div>

> [@Peter\_Kawa](#):
>
> The button was just a trigger example…  
> You can add the “And window Y is closed” to any flow.

yeah I know that would work but its a lot of flows, also automations in HASS and HomeKit and I just want to have a failsafe to prevent it from happening because it has happened many times before and can lead to quite dangerous situations…

> [@](#):
>
> Why don’t you use it, that should work perfect as “state change” trigger.

exactly, its perfect thats why I want to find a replacement.  
As previously explained, the Aqara Homey app is not capable of opening/closing the blinds but only setting them to a certain position which makes the integration useless for button controls. That is why I moved back to the Aqara hub integrated via Matter.

> [@](#):
>
> Ah, that’s also no problem  
> When  
> -something triggers this flow  
> And  
> -window Y is closed  
> Then  
> -set position of blinds Y to 30% (or 70% but that’s system dependent)

well that part is easy to accomplish but I am trying to find a solution for the “when closing” part, that was also what the question is mainly about its not about when conditions for final stati which are easy to trigger but for changes of the device stati (e.g. commands given)…

> [@](#):
>
> The Xiaomi app for the Aqara hub should have these usable trigger cards:

thats news to me, sounds interesting, you’re saying it would be possible to integrate the aqara app to homey via the xiaomi app? how can I connect my aqara hub to xiaomi? But it seems in the device compatibility list, neither the Aqara hub nor my roller blind controller are listed

> [@](#):
>
> So, in my opinion, there’s several trigger cards to stop the curtains from closing when non-Homey devices operate your blinds.

yes exactly what I said before but I also explained why its not feasible to use the Aqara app 🙂

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [January 9, 2024, 3:33pm UTC](https://community.homey.app/t/create-virtual-sensors-to-register-device-changes/100547/6 "2024-01-09T15:33:19Z")

</div>

OK, I don’t seem to get how your complex system works. Now you mention Homekit all of a sudden. I can’t get a full picture of your system when you don’t explain how things work.

So I gently quit from this conversation.

Oh, about Aqara hub, I thought you had it connected to Homey:  
_some_ Aqara hubs can be added to Homey with the beforementioned Xiaomi app.

Good luck and maybe someone else understands your system.

---

<div class="post-metadata">

**Author:** ![Flyto](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/flyto/32/85187_2.png) [@Flyto](https://community.homey.app/u/Flyto)\
**Post date:** [January 9, 2024, 3:59pm UTC](https://community.homey.app/t/create-virtual-sensors-to-register-device-changes/100547/7 "2024-01-09T15:59:15Z")

</div>

I really appreciate you taking the time to respond to my question, so thank you for that foremost of all. Apologies if my question was not clear enough but I felt we were going kind of off-topic.

its not really about the system being complex but about having a failsafe. Of course it will check the sensors in the relevant flows but it still happened someway or another that it closed e.g. someone else in a different room presses the wrong button, one tells alexa to close _all_ roller blinds, there are countless situations where manually defined check-ups don’t work

thats why I want it to activate if the blind is being closed, because its the most reliable way, so I am looking on a way to replace the “is closing” trigger in a different way because it is not supported via Matter. Because that is the action I need as trigger.

---

<div class="post-metadata">

**Author:** ![JPe4619](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jpe4619/32/9017_2.png) [@JPe4619](https://community.homey.app/u/JPe4619)\
**Post date:** [January 9, 2024, 4:09pm UTC](https://community.homey.app/t/create-virtual-sensors-to-register-device-changes/100547/8 "2024-01-09T16:09:44Z")

</div>

> [@Flyto](#):
>
> sensor to trigger when a device gets activated/changed

Maybe you can use a current measure module to detect if the device starts running, a flow can then check if that is allowed and, if not, stop the device.

---

<div class="post-metadata">

**Author:** ![Flyto](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/flyto/32/85187_2.png) [@Flyto](https://community.homey.app/u/Flyto)\
**Post date:** [January 9, 2024, 5:09pm UTC](https://community.homey.app/t/create-virtual-sensors-to-register-device-changes/100547/9 "2024-01-09T17:09:23Z")

</div>

Hmm unfortunately they are battery powered Aqara E1 Roller Shades, and Matter does also not transmit energy consumption, don’t know if that’s planned or just because homey doesn’t read it out

I was just generally wondering if it’s possible to read out of matter devices if they have been activated, or if homey just receives the information „status changed“
