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

I'm stuck: trying to combine conditions 'time:weekday' and 'sun:before sunrise,' no luck

$
0
0

@mugczar wrote:

I want certain lights to come on Monday-Friday at 6:30 a.m., but only if the sun is below the horizon.

I’ve read through a large handful of posts*; originally I couldn’t get the automation to not fire on the weekend, but you folks helped me out, thanks**! Unfortunately, every different syntax I’ve tried for combining two conditions has resulted in the sun coming up before 6:30, and the lights coming on anyway.

Here’s what I have currently; I’m hopeful it’s a simple syntax error (I’m relatively new to scripting):

- id: '1571596809000'
  alias: Weekday TEST
  trigger:
  - at: 06:30:00
    platform: time
  - condition:
    conditions:
      - condition: sun
        before: sunrise
      - condition: time
        weekday:
         - mon
         - tue
         - wed
         - thu
         - fri
  action:
  - data:
      brightness: 26
      entity_id: light.office
    service: light.turn_on
  - data:
      brightness: 26
      entity_id: light.console_lamp
    service: light.turn_on
  - data:
      brightness: 102
      entity_id: light.cube_lamp
    service: light.turn_on

Can anyone spot what I’m doing wrong? Thanks in advance!


*Here are the topics I’ve been using as reference:
Trigger at time but only if before sunrise, Why don't this work? (before: sunrise)

**Here is my one-condition script that does fire only M-F:

- id: '1571596809000'
  alias: Weekday TEST
  trigger:
  - at: 06:30:00
    platform: time
  condition:
  - condition: time
    weekday:
    - mon
    - tue
    - wed
    - thu
    - fri
  action:
  - data:
      brightness: 26
      entity_id: light.office
    service: light.turn_on
  - data:
      brightness: 26
      entity_id: light.console_lamp
    service: light.turn_on
  - data:
      brightness: 102
      entity_id: light.cube_lamp
    service: light.turn_on

Posts: 6

Participants: 4

Read full topic


Viewing all articles
Browse latest Browse all 95414

Trending Articles



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