Skip to content

Instantly share code, notes, and snippets.

@boozeman
Created October 13, 2024 14:16
Show Gist options
  • Save boozeman/9742294941eb7983208e558b64a096a9 to your computer and use it in GitHub Desktop.
Save boozeman/9742294941eb7983208e558b64a096a9 to your computer and use it in GitHub Desktop.
Chilien talvivalojen ohjaus hämärän mukaan
alias: Chilien talvivalojen ajastusautomaatio
description: "Asettaa time-tyyppisen helperin arvot klo 00:10 syttymään 2h ennen auringonlaskua ja sammumaan auringonlaskun hetkellä"
triggers:
- trigger: time
at: "00:10:00"
conditions: []
actions:
- action: input_datetime.set_datetime
target:
entity_id: input_datetime.chilien_talvivalot_paalle
data:
time: >
{{ (as_timestamp(states('sensor.sun_next_setting')) - 2*3600) |
timestamp_custom('%H:%M:%S') }}
- action: input_datetime.set_datetime
target:
entity_id: input_datetime.chilien_talvivalot_pois
data:
time: >
{{ (as_timestamp(states('sensor.sun_next_setting'))) |
timestamp_custom('%H:%M:%S') }}
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment