#No I want it to close like around 2 30am

1 messages · Page 1 of 1 (latest)

patent schooner
#

Take different scenarios and work through the logic...

A/C turn on at 11:40 PM

At 01:01:00 automation triggers...
Is the time between 1 am and 5 am > Yes
&
Has the A/C been on for 1h 30m or more > No?
Yes & No = No so do nothing

At 1:10 am automation triggers since A/C has been on exactly 1h 30m
Is the time between 1am & 5am > Yes
&
Has the A/C been on for 1h 30m or more > Yes
Yes & Yes = Yes so turn it off

stone owl
#

hey man, it didn't worked.
I open the AC at 1:20ish am, and it was running till 7am

#

alias: Bedroom AC Shutdown
description: Will close the AC if the AC is on for 1.5 hours between 1am to 5am
trigger:

  • platform: state
    entity_id:
    • input_select.bedroom_ac_status
      for:
      hours: 1
      minutes: 30
      seconds: 0
      to: "On"
  • platform: time
    at: "01:01:00"
    condition:
  • condition: time
    before: "05:00:00"
    after: "01:00:00"
  • condition: state
    for:
    hours: 0
    minutes: 1
    seconds: 30
    entity_id: input_select.bedroom_ac_status
    state: "On"
    action:
  • service: script.ir_turn_off_bedroom_ac
    data: {}
    mode: single
patent schooner
#

What does input_select.bedroom_ac_status show in history from 1:15 am to 7:05 am?

Btw, format your code sections with three backquotes on it's own line before the code and again on its own line after the code. So much easier to read!

alias: Bedroom AC Shutdown
description: Will close the AC if the AC is on for 1.5 hours between 1am to 5am
trigger:
#

Is there a single, continuous "on" from 1:20ish to 07:00?

stone owl
#

In the input_select it says the AC was on between 4:30am to 6:53am

#

I will give it another try now to see if maybe the sensor itself not detecting the power of the plug