bob1de / hass-apps

Some useful apps and snippets to empower Home Assistant and AppDaemon even more.
Apache License 2.0
85 stars 23 forks source link

[schedy] Reschedule room temperature after window is closed with delay #30

Closed insajd closed 5 years ago

insajd commented 5 years ago

Hello, I have this config for my rooms, and the fact that it reacts immediately when window is open - is awesome! But, I want it to start heating the room again with delay, only after 5-10 minutes that window has been closed, not immediately. How can I do that?

  rooms:
    bedroom:
      schedule:
      - x: ("OFF") if is_on('input_boolean.schedy_off_with_windows') else Skip()
bob1de commented 5 years ago

Hi,

That's not that easy to acomplish.

You could do the following:

Don't watch the window sensor via watched_entities and instead create an automation in HA that fires a schedy_reevaluate event when the window is opened and another when it's closed for N minutes. However, the disadvantage is that when the schedule is re-evaluated after the window was closed but before the event was fired, the temperature is reverted to the scheduled value anyway. Schedules are re-evaluated from time to time, e.g. when another watched entity changes its state or at the start/end times of the rules in the schedule. You can't and don't want to prevent that in general.

I'm closing this, because it's not a bug.

Best regards Robert

bob1de commented 5 years ago

I see, you're using an input_boolean somehow. Can't you just change the automations in HA that toggle this input_boolean to wait N minutes after closing the window before turning it off?

bob1de commented 5 years ago

And, it would be better to use the OVERLAY marker as shown in the docs for open window detection for the reasons mentioned there.

insajd commented 5 years ago

I don't want to create more automations in HA, but will check OVERLAY. That was marked as advanced and I skipped it :)

insajd commented 5 years ago

By the way, what is proper approach to discuss questions, is it on home-assistant forum for schedy?

bob1de commented 5 years ago

Even with the OVERLAY marker, you won't get around custom automations to achieve what you want.

There's this thread in the community forums: https://community.home-assistant.io/t/heaty-will-die-schedy-be-born/71276

But it's quite lengthy.