Request for Help - Run A/C If Humidity is Too High

Hi - I have what I think is a fairly simple request but am not sure how to best implement it as I’m a newbie to SmartApp coding. I have a humidity sensor and when that sensor gets above a threshold I want the A/C to begin running until it gets down to a (slightly lower) threshold.

For instance I want the A/C to begin cooling when humidity hits 60% and continue running until it gets down to 50%. I’m guessing that one way it could be accomplished is to drop the A/C cooling set temp down 5 degrees and then raise it back up 5 degrees once the humidity level is ok. Could anyone assist with providing some sample code for this instance? I’d greatly appreciate any help.

Just use Rule Machine. It can test the humidity and take actions based on what you setup. Very straight forward.

Thank you Bruce - this looks fantastic. I’m guessing I’d need 2 rules - one to drop the A/C temp to cool if humidity is high and one to revert the A/C temp to normal once humidity is at a good range?

Can be done in one rule using “Actions for true” and “Actions for false.”