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

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

So the device is not recognized as Class Sensor.
Have a look at the Device parameters in: Homey Developer Tools
My doorsensor looks like:
image

1 Like

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

.
@timvdhoorn
Do the capabilities match if you look up the contact sensor at developer?

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

image

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

I don’t say you’re wrong :upside_down_face: , 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:

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

Anyway, let wait for Tim’s findings :grinning:

1 Like

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.

1 Like

This is mine


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

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

if(device.class == 'homealarm' || 'sensor')
1 Like

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

1 Like

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

1 Like

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

1 Like

Thank you all for the help!

2 Likes

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