Advertisement
314ma

time_to_event

Dec 16th, 2020 (edited)
505
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.44 KB | None | 0 0
  1. sensor:
  2.   - platform: template
  3.     sensors:
  4.       time_to_event:
  5.         value_template: >
  6.          {%- if state_attr('calendar.familijne', 'start_time') == None -%}
  7.             Brak wydarzeń
  8.           {%- else -%}
  9.             {%- set t = ((state_attr('calendar.familijne', 'start_time') | as_timestamp - now() | as_timestamp)/3600) | int  -%}
  10.             {{ (t/24) | round(method='floor') }} dni, {{ t % 24}} godzin
  11.           {%- endif -%}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement