- Sensors: I would say any sensor that works "out of the box" will do for you, it just depends on whether you need wired or wireless solution. I prefer wireless as I have a bunch of xiaomi sensors, just keep in mind you'll have to replace batteries (once per few years I believe) and you also need a hub (e.g. zigbee) - but if you're going to implement more automations one day (temperature, movement etc.) it may worth it.
- Switch: I believe any wifi socket will do. You may also consider wifi/zigbee relays like sonoff - I love them :)
- Logic: it should be pretty straightforward, I would suggest using the Template Sensor to calculate "delta" value
(HumiditySensor1-HumiditySensor2)
:
smth like this
sensor:
- platform: template
sensors:
humidity_delta:
value_template: "{{ states('sensor.humidity_basement') | float - states('sensor.humidity_outside') | float }}"
Now that you have the humidity_delta
sensor (or whatever you call it) you can create some basic automations for you scenario, e.g
# Turning on fan when delta is above some value
- alias: Turn on Fan
initial_state: true
trigger:
platform: numeric_state
entity_id: sensor.humidity_delta
above: 10
action:
- service: switch.turn_on
entity_id: switch.fan
# Turning off fan when delta is below some value for some time
- alias: Turn of Fan
initial_state: true
trigger:
platform: numeric_state
entity_id: sensor.humidity_delta
below: 5
for:
minutes: 30
action:
- service: switch.turn_off
entity_id: switch.fan