0

I have a Humidity problem under my House and would like to read the Humidity under my House and Outside my House. Based on the two values I like to switch on a FAN. All that should be controlled by Homeassistant running on a Rasberry Pie. I am new to all this so please be detailed if you please be so kind.

  1. What Sensors would be good for this kind of Application
  2. What switch would work
  3. How do I setup the If (HumiditySensor1-HumiditySensor2) > configuredValue Than SwitchOn(Fan) logic
Ride Sun
  • 2,145
  • 3
  • 18
  • 41

1 Answers1

0
  1. 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.
  2. Switch: I believe any wifi socket will do. You may also consider wifi/zigbee relays like sonoff - I love them :)
  3. 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
Mike
  • 46
  • 1
  • 4
  • Thanks for the answer. Is there a zigbee hub u would recommend. – Ride Sun Jan 10 '20 at 17:38
  • @RideSun I would recommend some **universal** gateway, e.g. [Conbee](https://phoscon.de/en/conbee2) so you don't have to buy any proprietary gateway from different manufacturers (since xiaomi gateway would work with xiaomi devices only etc.) so you could use almost any zigbee device from any manufacturer. Moreover, conbee should work out of the box in Home Assistant: see [deCONZ](https://www.home-assistant.io/integrations/deconz/) platform. They also have [RaspBee](https://www.amazon.com/dresden-elektronik-wireless-RaspBee-premium/dp/B00E6300DO) that is pluggable into Raspberry Pi. – Mike Jan 13 '20 at 14:34
  • @RideSun btw you can find video tutorial on zigbee & ConBee hub here: https://youtu.be/LeuHpBdwmag?t=634 - check it out! – Mike Jan 13 '20 at 14:41