Node-Red Turn on light when humidity increases by an percentage from it's current state

Hi All,

Surprised I haven’t found much talk about this, but I put in a secondary option for leaving my lights in my bathrooms on triggered by motion. To stay on if triggered by humidity, so when someone is in the shower, it should rely on humidity to keep the lights on versus motion.

It’s an easy setup, except I’m in Minnesota, and our humidity is going up 10% each day, and I don’t always want to run the AC; sometimes, I like it hot!

I’d rather have it sample the humidity currently and trigger the humidity light automation if it increases from its current amount at a quicker pace. For example, someone is taking a shower, no matter what the original humidity may have been. Do you have any tips?

This is a similar topic

I create an average humidity sensor for all sensors in my house except the bathrooms. The trigger is then compared to the average, rather than an absolute value. Though I use a template binary sensor for this you could just use template triggers.

template:
  - binary_sensor:
      - name: "Bathroom Fan Required"
        unique_id: c084adc7-4105-4a32-8f71-dfc7745e88e6
        icon: "mdi:fan-alert"
        state: >
          {% if states('sensor.bathroom_humidity')|float(0) > states('sensor.average_upstairs_humidity')|float(0) + 25 %}
            on
          {% elif states('sensor.bathroom_humidity')|float(0) <= states('sensor.average_upstairs_humidity')|float(0) + 20 %}
            off
          {% else %}
            {{ this.state }}
          {% endif %}
        availability: "{{ has_value('sensor.bathroom_humidity') and has_value('sensor.average_upstairs_humidity') }}"