Skip to content

Instantly share code, notes, and snippets.

@manix84
Last active May 10, 2023 22:32
Show Gist options
  • Save manix84/c1b39dfb62d5052664c8fee0d29b3bd3 to your computer and use it in GitHub Desktop.
Save manix84/c1b39dfb62d5052664c8fee0d29b3bd3 to your computer and use it in GitHub Desktop.
blueprint:
name: Blinds automation
description: |
Open blinds at sunrise or specified time, which-ever comes later.
Close blinds at sunset or specified time, which-ever comes earlier.
domain: automation
source_url: https://gist.github.com/manix84/c1b39dfb62d5052664c8fee0d29b3bd3
author: Manix84
input:
blinds_entity_ids:
name: Blinds
description: The blinds you wish to control
selector:
entity:
multiple: true
device_class: blind
open_time:
name: Open time
description: The earliest time the blinds will open
default: "07:30:00"
selector:
time: {}
close_time:
name: Close time
description: The latest time the blinds will close
default: "19:30:00"
selector:
time: {}
trigger:
- platform: sun
event: sunrise
id: sunrise
- platform: sun
event: sunset
id: sunset
- platform: time
at: !input open_time
id: open_time
- platform: time
at: !input close_time
id: close_time
condition: []
action:
- choose:
- conditions:
- condition: or
conditions:
- condition: trigger
id: sunrise
- condition: trigger
id: open_time
alias: At sunrise or open time
- condition: time
after: !input open_time
sequence:
- service: cover.stop_cover
target:
entity_id: !input blinds_entity_ids
data: {}
alias: Open blinds
- conditions:
- condition: or
conditions:
- condition: trigger
id: sunset
- condition: trigger
id: close_time
alias: At sunset or close time
- condition: time
before: !input close_time
sequence:
- service: cover.close_cover
target:
entity_id: !input blinds_entity_ids
data: {}
alias: Close blinds
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment