Creating a rule with trigger for cloudiness

It is the open weather device that is in hubitat. It would be much simpler to have the option to tigger on the cloudiness attribute
image

1 Like

but the work around is fine for now. Thanks all.

1 Like

Ok, still not able to do it. Trying to set the variable to the cloudiness value of the weather attribute but that attribute is not listed.

Looks like a deficiency in the Weather device driver. Oh well.

so looking into it further is looks like the attribute for cloudiness is a string.
{"id":"28","name":"Open Weather","label":"Weather","type":"OpenWeatherMap","attributes":[{"name":"windDirection","currentValue":10,"dataType":"NUMBER"},{"name":"country","currentValue":"US","dataType":"STRING"},{"name":"temperature","currentValue":23,"dataType":"NUMBER"},{"name":"weather","currentValue":"few clouds","dataType":"STRING"},{"name":"cloudiness","currentValue":"20","dataType":"STRING"},{"name":"humidity","currentValue":57,"dataType":"NUMBER"},{"name":"weatherIcons","currentValue":"02d","dataType":"STRING"},{"name":"windSpeed","currentValue":8.99,"dataType":"NUMBER"},{"name":"city","currentValue":"Schenectady","dataType":"STRING"},{"name":"pressure","currentValue":1016,"dataType":"NUMBER"}],"capabilities":["RelativeHumidityMeasurement",{"attributes":[{"name":"humidity","dataType":null}]},"Refresh","TemperatureMeasurement",{"attributes":[{"name":"temperature","dataType":null}]},"Sensor"],"commands":["refresh"]}

yet they represent as a number. So how to use <> comparisons on it? How can it get fixed to be a numeric value?

Looking at the raw openweathermap api call that this driver calls to that cloudiness value is numeric.

{"coord":{"lon":-73.9206,"lat":42.8179},"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"}],"base":"stations","main":{"temp":266.9,"feels_like":264.59,"temp_min":265.23,"temp_max":268.08,"pressure":1016,"humidity":59},"visibility":10000,"wind":{"speed":1.34,"deg":343,"gust":4.92},"clouds":{"all":40},"dt":1642542542,"sys":{"type":2,"id":2003286,"country":"US","sunrise":1642508514,"sunset":1642542595},"timezone":-18000,"id":0,"name":"Schenectady","cod":200}

I use the openweatherAPI on my system and Cloud was one of the attributes.

1 Like

Did you turn on the option for that attribute. On the driver page there are options to turn on or turn off only the attributes you are interested in. Assuming you are using the same driver as me.

I do not have access to the driver page. I only have access to the device page. This is a built in device. There is no option to turn on any attributes they are there based on the API call it makes to weathermap

That is the page I am referring to.

Certainly looks like an option. I just don't have the time any longer to fuss with this unfortunately. If the attribute in the built in driver was a numeric value like it should be I would have had this done hours ago.

No option in my device to do that. I am using the built in device not an imported one.

Could you post a screen shot of your device page, because I don't see a built in weather driver.

You can not access the driver code but the device is the Open Weather Map type.

Ok I went through the list 2 or 3 times and never saw it. See below I created a device using the built in weatherdevice, hopefully the rule makes sense to you.

1 Like

Ok just set that up. Now waiting for that value to change, Could take hours or days around here. Would rather just have actual value as it is updated, I really appreciate your help terminal3. I wrote to support to see if they will correct that data type in the device driver.

Ok it updated. I will implement as a work around and pray support correct data type in the driver.

Thank you terminal3!

Ok created one rule with local variables to implement this. Hope this works!

Or you could install and switch to the driver I listed above and it will work the way you want

Actually this is fine. It works. Thank you. In fact I learned a lot. I have been combining multiple rules into single rules using changed triggers and conditional actions. Thank you very much!!!

As an update to this post concerning the ability to control lights based on cloudiness. Although this work around does work (sort of), but only if the attribute changes. So like today it has been 100% cloudiness all morning and therefore my lights are not updating. I still have a need for the "built in" driver to deliver the correct data type for cloudiness. I should not have to install a foreign driver to accomplish this.