Roof automation

Hello All,
My kitchen has a part of the roof that I can automatically open or close depending on the weather. (I use an RF to control the motor and Xiaomi sensor to control if the roof is open or closed)
My challenge is: if I have sun after the rain the roof will be wet and wet my kitchen. Is it possible to check the previous state of the weather and open the roof if just passes 3 hours after the rain? How can I do that?

Hi Ricardo,

  1. Maybe you could use a water leak sensor to check for presence of water before opening the roof. If the sensor state is off (there is no water) then open.
  2. How do you know for sure there was rain? Are you sensing for rain locally or relying on a weather integration? In any case you could use an input_boolean & switch it on when there was rain & switch it off again by a timer.

This might be of interest to you:

Hi Nick, It is a good idea, the problem is that my roof is made of glass and I don’t know where exactly the roof will concentrate water. Making it impossible to know where I have to install the sensor.
I use the darksky sensor to check the weather, maybe your suggestion (create an input_boolen) can work. I will try it. Thanks a lot.

It is a good project, I will check if it is possible to adapt it to my reality.

Triggering an automation 3 hours after a state change is straightforward and covered in the docs. I’d do it by setting up an “it is raining” binary sensor based on however you’re sensing the rain, and then:

  platform: state
  entity_id: binary_sensor.it_is_raining
  from: 'on'
  to: 'off'
    hours: 3
condition: …
action: …

What I wouldn’t do is open my roof based solely on the reliability of my local weather forecast :umbrella:

I have never built it myself, but maybe you could look in to the way cars do it.
If I remember correctly it’s a light beam sent in to the glass and it will reflect inside the glass to a receiver.
If there is water that will make the light escape at that point and less light will be received at the other end.

As I said I have never built it and never really looked in to how it works. But you maybe you can get some parts from a crashed car?

Create an automation that triggers on from rain.
Save now i(or now +3 hours) n a datetime helper and use this as a trigger