I’m brand new to HA, having installed it the day before yesterday. I’d like to create an automation that will detect a sudden increase in the humidity in my bathroom and then turn on the mini-split in that room for 30 minutes. For an extra degree of difficulty, I’d like to have the 30-minute timer start again if there’s a second humidity spike (due to a second shower). And for completeness, I’d like to have the heat turned on in the winter and the AC in the summer.
Relevant hardware:
RPi 4 running Core 2025.2.5, Supervisor, 2025.02.1, Operating System 14.2, and Frontend20250221.0.
Sensibo SkyPlus
From my reading so far, I need to first expose the humidity data to HA, then create a derivative sensor of that data, and then set up an automation do use that result to trigger the various actions.
I rebooted the Pi and now see “mb_humidity” in settings → helpers. I then created a second helper, using the derivative helper class, to collect that data. Next, I created an automation to check if my derivative has gone about 10, and, if so, to turn on the heat, wait 30 minutes, and then turn it off. Yay me.
My questions:
What’s a reasonable period over which to do that derivative? 30 seconds? a minute?
How do I check, during that 30 minute pause, if there’s been a second triggering event and restart the clock?
How do I integrate the outside weather to control if the heat or the AC is turned on?
#1: Just FYI, the derivative sensor has an issue where it will not return to 0 if the source sensor state does not change over time. There is a PR in to fix some of the issue (time based re-evaluation of non changing source sensor state) and work being done to address some other cases.
I would use an automation to trigger on humidity over X amount (can also specify for X amount of time), using automations also solves #2.
#2: You can use automations that can use a weather service to access the outdoor weather data and work it into template data as a condition or in a building block:
{# Call for heat? - temp in C #}
{% set out_state = states('weather.home') %}
{% if out_state not in ['unavailable', 'unknown'] %}
{% set out_t_attr = state_attr('weather.home', 'temperature') %}
{% if out_t_attr is number %}
{% set out_t = out_t_attr | float %}
{% if out_t <= 15.0 %}
True
{% endif %}
{% else %}
False
{% endif %}
{% else %}
False
{% endif %}
Using automations, you can work all sorts of magic. It does take some time to learn how to use them efficiently and for complex stuff, though. There is also node red, but I have not used it myself and can’t speak on it.
For an automation using a delay, setting the automations mode to “restart” will allow the the sequence to run again (including the delay) when a second humidity spike occurs. Just be aware that prolonged delays are generally not recommended since they do not survive restart.
@baudneo Using a set point for the humidity, instead of the slope, doesn’t work for me as the background humidity in the bathroom changes as the seasons change…