Just a thought, as I’m dinking with a smart app looking at humidity sensors in the shower as well.
The potential issue with waiting x amount of time and trying to get a previous sample is just that, you are at the mercy of the reporting interval of the device…
Maybe consider using another humidity sensor in the house as your base line?, in my case I’m using the one in my thermostat as it’s not subject to localized changes.
Then I set a delta above the baseline humidity so once the shower humidity exceeds that threshold we fire the “do something” stuff…
This method doesn’t rely on calculating a rate of rise over time. if (currentShowerHumidity > (currentBaselineHumidity + triggerOffset)) makeItGobaby(), that type of thing.