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

Time Before and After condition, I´m going crazy

$
0
0

Is pretty simple. I want to activate a Scene when the motion sensor goes on between certain time, and another Scene if it goes on between other time. Also turn off the lights when the motion sensor goes off.

But I´m pretty sure I´m using time condition before and after in a wrong matter because the just don work when they should.

Here is the code:

alias: Motion Detector luz Closet
description: ''
trigger:
  - platform: state
    entity_id: binary_sensor.sonoff_a44000d616
    to: 'on'
    id: 'on'
  - platform: state
    entity_id: binary_sensor.sonoff_a44000d616
    to: 'off'
    id: 'off'
condition: []
action:
  - choose:
      - conditions:
          - condition: time
            after: '08:15:00'
            before: '23:00:00'
          - condition: trigger
            id: 'on'
        sequence:
          - service: scene.turn_on
            target:
              entity_id: scene.luces_closet
            metadata: {}
      - conditions:
          - condition: time
            after: '23:00:01'
            before: '08:14:59'
          - condition: trigger
            id: 'on'
        sequence:
          - service: scene.turn_on
            target:
              entity_id: scene.luces_closet_sueve
            metadata: {}
      - conditions:
          - condition: trigger
            id: 'off'
        sequence:
          - service: light.turn_off
            data: {}
            target:
              entity_id:
                - light.sonoff_10012bd2e7
                - light.sonoff_10012c04bd
    default:
      - service: light.turn_off
        data: {}
        target:
          entity_id:
            - light.sonoff_10012bd2e7
            - light.sonoff_10012c04bd
mode: single

Thanks a million guys!!
:crazy_face:

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 102826

Trending Articles



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