Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 106535

Time trigger/condition not acting as expected

$
0
0

Hi,
I have a basic automation to turn on/off a plug for a coffee machine at some times given by input_datetime ( on == 6 am and off == 4 pm). The two times serve as a time trigger and there is a choose action with conditions checking if we are within the on or off time window.

Turning on works fine. However, turning off does not – instead the turn on choose branch gets chosen.

The triggers are working ok

trigger:
  - platform: state
    entity_id: group.inhabitants
  - platform: time
    at: input_datetime.plug_coffee_on
  - platform: time
    at: input_datetime.plug_coffee_off

But when the coffee_off time triggers, the turn on conditions are satisifed:

action:
  - choose:
      - alias: Turn it on
        conditions:
          - condition: and
            conditions:
              - condition: time
                after: input_datetime.plug_coffee_on
                before: input_datetime.plug_coffee_off
              - condition: state
                entity_id: group.inhabitants
                state: 'on'

instead of the turn off conditions

         - condition: or
            conditions:
              - condition: not
                conditions:
                  - condition: time
                    after: input_datetime.plug_coffee_on
                    before: input_datetime.plug_coffee_off
              - condition: state
                entity_id: group.inhabitants
                state: 'off'

What am I messing up? Is it that the trigger shoots at 16:00:00 and this is still satisfying the time condition because it’s not 16:00:01?

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 106535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>