Generic hygrostat
The generic hygrostat helper turns a humidifier or a dehumidifier on and off, by a humidity sensor and a target humidity. Any switch can be the device: a smart plug on a humidifier in the bedroom, a relay on the dehumidifier in the basement.
Two tolerances keep it from switching all the time. The dry tolerance is how far the humidity may drop below the target, the wet tolerance how far it may rise above it, before the hygrostat switches. Those are set in the helper's options, and only there. An automation cannot change them: not more slack at night, when every click of the plug wakes somebody up.
Spook adds an action for that: set tolerances.
Actions
Spook adds one action to the generic hygrostat integration. You find it wherever you add an action, marked with a 👻.
Set tolerances
Changes the dry tolerance, the wet tolerance or both of one or more generic hygrostats, like the options of the helper do. What you leave out stays as it is, the sensor and the switch too.
The change goes through the helper's own options, so Home Assistant checks it the same way it checks what you fill in there. Then Home Assistant reloads the hygrostat, as it does after you save its options. The action returns once the hygrostat is reloaded, so the next step of your automation already works with the new tolerances. A hygrostat that already has the tolerances you give is left alone, without a reload.
For a humidifier, the dry tolerance is how far the humidity drops below the target before it turns on, and the wet tolerance how far it rises above the target before it turns off. For a dehumidifier, it is the other way around.
Every entity is checked before the first hygrostat changes. An entity that is not a generic hygrostat, or one set up in YAML, is refused with an error, and nothing changes. The hygrostats change one at a time, in the order you give them.
Run by hand, the action takes an administrator, like the options of a helper do. Your automations can always run it. So can your scripts, unless a user who is not an administrator starts one.
How to use it
- Open the automation or script that should change the tolerances, and select Add action.
- Search for set tolerances, and select Generic hygrostat: Set tolerances 👻.
- Choose the generic hygrostats.
- Turn on the tolerances you want to change, and fill in the new values.
- Select Save.
| Action properties | |
|---|---|
| Action | Generic hygrostat: Set tolerances 👻 |
| Action name | generic_hygrostat.set_tolerances |
| Action targets | No targets |
| Action response | No |
| Spook's influence | Newly added action |
| Tools | Try this action |
| Action data parameters | |||
|---|---|---|---|
| Attribute | Type | Required | Default / Example |
entity_id | string or list | Yes | humidifier.bedroom |
dry_tolerance | float | No | 3 |
wet_tolerance | float | No | 3 |
Give at least one of dry_tolerance and wet_tolerance. Both are percentages, from 0 to 100. Neither can be taken away; set it to 0 for none.
Give the humidifier more slack on the dry side:
action: generic_hygrostat.set_tolerances
data:
entity_id: humidifier.bedroom
dry_tolerance: 5
Change both:
action: generic_hygrostat.set_tolerances
data:
entity_id: humidifier.bedroom
dry_tolerance: 2
wet_tolerance: 4
The humidifier in the bedroom keeps the humidity close to the target during the day, within 2%. At night, every time its plug clicks on, somebody wakes up. From 23:00 until 07:00 it gets 5% on either side, so it switches a lot less:
alias: Bedroom humidifier quieter at night
triggers:
- trigger: time
at: "23:00:00"
id: night
- trigger: time
at: "07:00:00"
id: day
actions:
- action: generic_hygrostat.set_tolerances
data:
entity_id: humidifier.bedroom
dry_tolerance: "{{ 5 if trigger.id == 'night' else 2 }}"
wet_tolerance: "{{ 5 if trigger.id == 'night' else 2 }}"
- Every change reloads the hygrostat. While it reloads, its state is
unavailablefor a moment. Do not drive the tolerances from something that changes every few seconds. - Right after the reload, the hygrostat compares the humidity with the target without its tolerances, as Home Assistant does whenever a generic hygrostat starts. So it can switch the device on or off once, even with the humidity within the new tolerances. From the next reading of the sensor, the tolerances count.
- Generic hygrostats set up in YAML are refused. Their tolerances are in your configuration: change them there.
Missing something here?
An action, an entity or a repair this integration should have? Say so. Stuck, or found a bug? There is help.
Generic thermostat
Spook adds an action to the generic thermostat helper that changes the temperature of one of its presets, so an automation can move a preset without a trip to the helper's options.
Statistics
Spook adds an action to the statistics helper that changes which samples it keeps, so an automation can shorten or lengthen its window without a trip to the helper's options.
