# Help with a flow: When raining, notify which doors/windows are open

**URL:** <https://community.homey.app/t/help-with-a-flow-when-raining-notify-which-doors-windows-are-open/48331>\
**Category:** Questions & Help\
**Tags:** flow\
**Created:** [June 11, 2021, 6:57pm UTC](https://community.homey.app/t/help-with-a-flow-when-raining-notify-which-doors-windows-are-open/48331 "2021-06-11T18:57:47Z")\
**Posts on this page:** 14\
**Page:** 3

<div class="post-metadata">

**Author:** ![timvdhoorn](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/timvdhoorn/32/55746_2.png) [@timvdhoorn](https://community.homey.app/u/timvdhoorn)\
**Post date:** [June 8, 2022, 1:22pm UTC](https://community.homey.app/t/help-with-a-flow-when-raining-notify-which-doors-windows-are-open/48331/41 "2022-06-08T13:22:45Z")

</div>

The problem is with all the sensors. Please note that the sensors are added via the Deconz app.

---

<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:** [June 8, 2022, 1:49pm UTC](https://community.homey.app/t/help-with-a-flow-when-raining-notify-which-doors-windows-are-open/48331/42 "2022-06-08T13:49:09Z")

</div>

So the device is not recognized as Class Sensor.  
Have a look at the Device parameters in: [Homey Developer Tools](https://tools.developer.homey.app/tools/devices)  
My doorsensor looks like:  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/a/5ace06009fadad66376057c475b069f0ba856fe1.png)

---

<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:** [June 8, 2022, 3:08pm UTC](https://community.homey.app/t/help-with-a-flow-when-raining-notify-which-doors-windows-are-open/48331/43 "2022-06-08T15:08:36Z")

</div>

Deconz or not, he showed a contact sensor, which is okay.

> [@Help with a flow: When raining, notify which doors/windows are open](https://community.homey.app/t/help-with-a-flow-when-raining-notify-which-doors-windows-are-open/48331/20):
>
> Yes, the open sensor is included in the script. Its the Balkondeur-Ke sensor. [Screenshot 2022-06-07 at 13.22.29] and alarm is true

.  
@timvdhoorn  
Do the capabilities match if you look up the contact sensor at [developer](https://tools.developer.homey.app/tools/devices)?

 ![Screenshot_20220608-171332_Firefox](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/8/d8824edba628580030569cc9890f2b253bed0643.jpeg)

.  
And,  
Just in case, does the contact sensor has an `alarm = false` status when the door is closed? In other words, does it switch?

And,  
I’m still curious if the script works, or not, with a virtual contact sensor. You’ll need Virtual Devices app for this.

> [@Peter\_Kawa](#):
>
> What happens if you create a virtual door contact, set it to alarm=true, and add it to the script’s sensor section?

---

<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:** [June 8, 2022, 3:21pm UTC](https://community.homey.app/t/help-with-a-flow-when-raining-notify-which-doors-windows-are-open/48331/44 "2022-06-08T15:21:47Z")

</div>

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/d/1d2d0914e44211007b67963b9b6658b082935f86.png)

When this code does not result in displaying a device, then for me, there is no active device with the Class “sensor” or am I wrong? Thats why I’m advising to have a look at the device parameters in [Homey Developer Tools](https://tools.developer.homey.app/tools/devices)

---

<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:** [June 8, 2022, 3:40pm UTC](https://community.homey.app/t/help-with-a-flow-when-raining-notify-which-doors-windows-are-open/48331/45 "2022-06-08T15:40:11Z")

</div>

I don’t say you’re wrong 🙃 , but I tried to show you the sensor seems to present it self correctly as a contact sensor, Tim posted a screenshot. It’s in my previous post:

 ![Screenshot from 2022-06-08 17-38-14](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/1/e1050bbbe4209faf98392c674608ad9aa70c26ad.png)

---

<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:** [June 8, 2022, 3:53pm UTC](https://community.homey.app/t/help-with-a-flow-when-raining-notify-which-doors-windows-are-open/48331/46 "2022-06-08T15:53:52Z")

</div>

Sure, nothing wrong with that, but Contact alarm is just a Capability title, doesn’t say anything about the Class where the code is looking for  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/d/8d1bf696e0f8b883740e4820007d3f4cb6db5084.png)

Anyway, let wait for Tim’s findings 😀

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [June 8, 2022, 3:57pm UTC](https://community.homey.app/t/help-with-a-flow-when-raining-notify-which-doors-windows-are-open/48331/47 "2022-06-08T15:57:34Z")

</div>

The device type ‘sensor’ could be a problem. Perhaps it has another type, but the alarm\_contact capability.

A complete screenshot from the device (developer page) would be nice.

---

<div class="post-metadata">

**Author:** ![timvdhoorn](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/timvdhoorn/32/55746_2.png) [@timvdhoorn](https://community.homey.app/u/timvdhoorn)\
**Post date:** [June 8, 2022, 4:51pm UTC](https://community.homey.app/t/help-with-a-flow-when-raining-notify-which-doors-windows-are-open/48331/48 "2022-06-08T16:51:44Z")

</div>

This is mine

 ![Screenshot 2022-06-08 at 18.50.32@2x](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/c/6c63599b45810c91c029aa7f534941629af79fca.png)  
 ![Screenshot 2022-06-08 at 18.51.18@2x](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/f/fffc73bc69c838ee0fde80e9754d4604cd16f3ea.png)

---

<div class="post-metadata">

**Author:** ![timvdhoorn](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/timvdhoorn/32/55746_2.png) [@timvdhoorn](https://community.homey.app/u/timvdhoorn)\
**Post date:** [June 8, 2022, 4:53pm UTC](https://community.homey.app/t/help-with-a-flow-when-raining-notify-which-doors-windows-are-open/48331/49 "2022-06-08T16:53:50Z")

</div>

Okay, after changing the script from ‘sensor’ to ‘homealarm’ the sensor will show up when running the script 🙂

 ![Screenshot 2022-06-08 at 18.52.30@2x](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/3/837298a34c1a6d3845becbaba79208873a9553d6.png)

Now… How can I make the script look at class ‘sensor’ and class ‘homealarm’?  
EDIT: I think like this?

```auto
if(device.class == 'homealarm' || 'sensor')

```

---

<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:** [June 8, 2022, 5:01pm UTC](https://community.homey.app/t/help-with-a-flow-when-raining-notify-which-doors-windows-are-open/48331/50 "2022-06-08T17:01:11Z")

</div>

> [@timvdhoorn](#):
>
> `if(device.class == 'homealarm' || 'sensor')`

think it would be like  
`if (device.class == 'homealarm' || device.class == 'sensor')`

---

<div class="post-metadata">

**Author:** ![timvdhoorn](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/timvdhoorn/32/55746_2.png) [@timvdhoorn](https://community.homey.app/u/timvdhoorn)\
**Post date:** [June 8, 2022, 5:06pm UTC](https://community.homey.app/t/help-with-a-flow-when-raining-notify-which-doors-windows-are-open/48331/51 "2022-06-08T17:06:15Z")

</div>

Looks like both work.  
(I really need to learn JS… 😛 )

---

<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:** [June 8, 2022, 5:11pm UTC](https://community.homey.app/t/help-with-a-flow-when-raining-notify-which-doors-windows-are-open/48331/52 "2022-06-08T17:11:08Z")

</div>

Great that it works now, good for learning how to detect where things go wrong 👍

---

<div class="post-metadata">

**Author:** ![timvdhoorn](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/timvdhoorn/32/55746_2.png) [@timvdhoorn](https://community.homey.app/u/timvdhoorn)\
**Post date:** [June 8, 2022, 5:22pm UTC](https://community.homey.app/t/help-with-a-flow-when-raining-notify-which-doors-windows-are-open/48331/53 "2022-06-08T17:22:21Z")

</div>

Thank you all for the help!

---

<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:** [June 8, 2022, 11:02pm UTC](https://community.homey.app/t/help-with-a-flow-when-raining-notify-which-doors-windows-are-open/48331/54 "2022-06-08T23:02:11Z")

</div>

> [@Help with a flow: When raining, notify which doors/windows are open](https://community.homey.app/t/help-with-a-flow-when-raining-notify-which-doors-windows-are-open/48331/48):
>
> This is mine

Oh that ringed a bell!  
It’s indeed a wrong device type in the app:

> [@\[Abandoned\] deCONZ](https://community.homey.app/t/app-pro-deconz-abandoned/29390/871):
>
> I expect this to be the culprit Change “homealarm” into “sensor”

[Previous page](https://community.homey.app/t/help-with-a-flow-when-raining-notify-which-doors-windows-are-open/48331.md?page=2)
