Advertisement
Hoekeren75

Untitled

Apr 2nd, 2023
994
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.50 KB | None | 0 0
  1. ### SKRALDESPAND ###
  2. - platform: template
  3.   sensors:
  4.     skraldespand_dagrenovation:
  5.       friendly_name: 'Dagrenovation'
  6.       value_template: >-
  7.         {% set cal = states.calendar.skraldespand %}
  8.         {% set offset = -86400 %}
  9.         {{ cal.attributes.message == "Dagrenovation" and cal.start_time.timestamp() + offset <= now().timestamp() }}
  10.       icon_template: >-
  11.         {% if states('sensor.skraldespand_dagrenovation') == 'false' %}
  12.           mdi:delete
  13.         {% else %}
  14.           mdi:delete-empty
  15.         {% endif %}
  16.  
  17.     skraldespand_genanvendeligt:
  18.       friendly_name: 'Genanvendeligt'
  19.       value_template: >-
  20.         {% set cal = states.calendar.skraldespand %}
  21.         {% set offset = -86400 %}
  22.         {{ cal.attributes.message == "Genanvendeligt" and cal.start_time.timestamp() + offset <= now().timestamp() }}
  23.       icon_template: >-
  24.         {% if states('sensor.skraldespand_genanvendeligt') == 'false' %}
  25.           mdi:delete
  26.         {% else %}
  27.           mdi:delete-empty
  28.         {% endif %}
  29.  
  30.     skraldespand_haveaffald:
  31.       friendly_name: 'Haveaffald'
  32.       value_template: >-
  33.         {% set cal = states.calendar.skraldespand %}
  34.         {% set offset = -86400 %}
  35.         {{ cal.attributes.message == "Haveaffald" and cal.start_time.timestamp() + offset <= now().timestamp() }}
  36.       icon_template: >-
  37.         {% if states('sensor.skraldespand_dhaveaffald') == 'false' %}
  38.           mdi:delete
  39.         {% else %}
  40.           mdi:delete-empty
  41.         {% endif %}
  42.  
  43.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement