Skip to content

Commit

Permalink
improve coffee machine led to use solar elevation instead of sunset
Browse files Browse the repository at this point in the history
  • Loading branch information
marcocunha committed Apr 28, 2024
1 parent 06855a3 commit 58f9a5b
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ trigger:
alias: "Door opened"
condition:
- or:
- condition: sun
after: sunset
before: sunrise
- condition: numeric_state
entity_id: sensor.sun_solar_elevation
below: 20
- condition: numeric_state
entity_id: sensor.wallpanel_light
below: 550
Expand Down
41 changes: 18 additions & 23 deletions homeassistant/config/scripts/coffee_machine_led.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,23 @@ turn_on_coffee_machine_led:
default: 5
example: "5"
sequence:
- if:
- condition: sun
after: sunset
before: sunrise
then:
- service: light.turn_on
data: {}
target:
entity_id: light.light_led_coffee_machine
- delay:
hours: 0
minutes: "{{ duration }}"
seconds: 0
milliseconds: 0
- service: light.turn_off
data: {}
target:
entity_id: light.light_led_coffee_machine
- delay:
hours: 0
minutes: 5
seconds: 0
milliseconds: 0
- service: light.turn_on
data: {}
target:
entity_id: light.light_led_coffee_machine
- delay:
hours: 0
minutes: "{{ duration }}"
seconds: 0
milliseconds: 0
- service: light.turn_off
data: {}
target:
entity_id: light.light_led_coffee_machine
- delay:
hours: 0
minutes: 5
seconds: 0
milliseconds: 0


41 changes: 18 additions & 23 deletions homeassistant/config/scripts/exterior_led.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,23 @@ turn_on_exterior_led:
default: 5
example: "5"
sequence:
- if:
- condition: sun
after: sunset
before: sunrise
then:
- service: light.turn_on
data: {}
target:
entity_id: light.barra_led_exterior_switch_0
- delay:
hours: 0
minutes: "{{ duration }}"
seconds: 0
milliseconds: 0
- service: light.turn_off
data: {}
target:
entity_id: light.barra_led_exterior_switch_0
- delay:
hours: 0
minutes: 5
seconds: 0
milliseconds: 0
- service: light.turn_on
data: {}
target:
entity_id: light.barra_led_exterior_switch_0
- delay:
hours: 0
minutes: "{{ duration }}"
seconds: 0
milliseconds: 0
- service: light.turn_off
data: {}
target:
entity_id: light.barra_led_exterior_switch_0
- delay:
hours: 0
minutes: 5
seconds: 0
milliseconds: 0


0 comments on commit 58f9a5b

Please sign in to comment.