Hi,
I have a Netatmo rain sensor that I would like to use to get rain meter values for an app script to figure out if it is or has been raining. I am new to Groovy and app making so my experience is limited. But it seems the capability property in the input statement in the preference section determins the LOV of devices that is displayed when trying to select a device in the app. Looking in the Hubitat developer documenation there does not seem to be a rain meter or any capability related to a rain meter? (The closes thing is a water sensor which does not do the trick as it replies with 'wet' which does not have corresponding attirbute in the rain sensor).
I cannot find a capability that will show me the correct device in the LOV. Is there a generic one that will show all devices? Other suggestions?
All suggestions is as always, always welcome. Thanks in advance.
Cheers,
What driver is this device using, and what capabilities does it implement? (If it's a custom driver, you can see this. If it's a built-in driver, you can make reasonable guesses or do some inspections on the object once you get a reference to it.) That's what you need to use here, ideally the one that filters the list to the smallest number of devices the user might reasonably want to select. You need to use a defined capability.
Or: you can also use device.DriverName
instead of capability.capabilityName
format as the selector (where "DriverName" is the driver name with spaces removed) if you only want to select devices using a specific driver. Normally, that's not the best idea, but if your app is written for this exact driver, it could be a good idea.
To directly answer the question, capability.*
will match all capabilities, but that is probably the worst idea among all.
1 Like
Hi Robert,
Thanks for your reply and thank you for taking the time to explain the various options. This was really helpful.
There doesn't seem to be a supported rain meter in the defined capabilities list. And as I am creating an app I only thoght of looking in the custom Netatmo app where I could find no capabilities (but I did find the device.DriverName reference which I at the time did not know was usable). So for some reason I did not think about the obvious thing to check the custom Netatmo driver for the netatmo rain meter where, as you rightly say, the capabilities are visibly listed and accessible in the code ![:slight_smile: :slight_smile:](https://community.hubitat.com/images/emoji/apple/slight_smile.png?v=12)
Thank you for explaining and for your time!
Cheers,
I ended up using HE standard 'Water Sensor' capability for the Tuya Rain Sensor.
1 Like