mirror of
https://github.com/CCOSTAN/Home-AssistantConfig.git
synced 2025-02-21 00:25:12 +00:00
Changed the logic from OR to AND. Should work now.
This commit is contained in:
parent
db44d44a6e
commit
24d7d1600a
@ -2,7 +2,7 @@
|
||||
### Detect when lights are turned on and adjust them accordingly based on time.
|
||||
### Code by @JesseWebDotCom
|
||||
##############################################################################
|
||||
- alias: detect lights and adjust the brightness when turned on based on time.
|
||||
- alias: detect lights and adjust the brightness when turned on based on time
|
||||
trigger:
|
||||
- platform: event
|
||||
event_type: state_changed
|
||||
@ -37,11 +37,11 @@
|
||||
entity_id: "{{ trigger.event.data.entity_id }}"
|
||||
brightness: >
|
||||
{% set hour=states("sensor.time").split(':')[0] | int %}
|
||||
{%- if hour >= 5 or hour < 8 -%}
|
||||
{%- if hour >= 5 and hour < 8 -%}
|
||||
50
|
||||
{%- elif hour >= 8 or hour <20 -%}
|
||||
{%- elif hour >= 8 and hour <20 -%}
|
||||
255
|
||||
{%- elif hour >= 20 or hour <24 -%}
|
||||
{%- elif hour >= 20 and hour <24 -%}
|
||||
40
|
||||
{%- else -%}
|
||||
15
|
||||
|
Loading…
x
Reference in New Issue
Block a user