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

Automation - the sunset/sunrise event needs some fixiing

$
0
0

Hi,
I’ve this automation that is working (partially) and it puts an outdoor LED light to ON whenever the garage side door (reed switch) is opened.

- id: '1656863867735'
  alias: 'Automation: Outside Light Timer - Sideyard'
  description: This automation turns ON the outside light when door is OPENED & turns
    OFF the light when door is CLOSED after few seconds
  trigger:
  - platform: state
    entity_id:
    - binary_sensor.window_b10
    from: 'off'
    to: 'on'
    for:
      hours: 0
      minutes: 0
      seconds: 0
  condition:
  - condition: and
    conditions:
    - condition: state
      entity_id: input_boolean.outside_lights_automation
      state: 'on'
    - condition: sun
      after: sunset
  action:
  - type: turn_on
    device_id: 2ccdc1687b78569a1d259801e333a128
    entity_id: switch.basic02_relay
    domain: switch
  - service: timer.start
    data:
      duration: '10'
    target:
      entity_id: timer.timeroutsidelight_sideyard
  - wait_template: '{{ is_state(''binary_sensor.window_b10'', ''off'') and  is_state(''timer.timeroutsidelight_sideyard'',
      ''idle'') }}'
    continue_on_timeout: true
  - delay:
      hours: 0
      minutes: 0
      seconds: 10
      milliseconds: 0
  - type: turn_off
    device_id: 2ccdc1687b78569a1d259801e333a128
    entity_id: switch.basic02_relay
    domain: switch
  mode: restart

Yesterday I came back late (~ 1 AM) and the light did not come ON. I am guessing that it is likely that the date changed over at midnight and the test “after sunset” likely failed.

Is this correct and would adding “before sunrise” condition fix it? Asking here because I do not want to stay out late just for testing automation :grinning:

Thanks.

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 105777

Trending Articles



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