Skip to content

Instantly share code, notes, and snippets.

@TheRealSimon42
Created July 2, 2023 14:19
Show Gist options
  • Save TheRealSimon42/1545fbbcef4223ac8aa503188f11490f to your computer and use it in GitHub Desktop.
Save TheRealSimon42/1545fbbcef4223ac8aa503188f11490f to your computer and use it in GitHub Desktop.
Code-Snippet für Template-Sensor zur Berechnung eines Timestamps aus input Helper
template:
- sensor:
- name: WakeUp Light Timestamp
device_class: timestamp
state: >
{% if is_state("binary_sensor.workday_sensor", "on") %}
{{ today_at(states('input_datetime.aufwachzeit_arbeitstag')) }}
{% elif is_state("binary_sensor.workday_sensor", "off") %}
{{ today_at(states('input_datetime.aufwachzeit_freizeit')) }}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment