Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.04 KB | None | 0 0
  1. sensor:
  2.   - platform: template
  3.     sensors:
  4.       rifiuti:
  5.         entity_id: sensor.time
  6.         friendly_name: "Rifiuti"
  7.         icon_template: mdi:delete-restore
  8.         value_template: "
  9.        {% if (now().timestamp() | int - (8*60*60)) | timestamp_custom('%w') == '1' %} Organico
  10.        {% elif (now().timestamp() | int - (8*60*60)) | timestamp_custom('%w') == '2' %} Indifferenziato
  11.        {% elif (now().timestamp() | int - (8*60*60)) | timestamp_custom('%w') == '3' %} Niente
  12.        {% elif (now().timestamp() | int - (8*60*60)) | timestamp_custom('%w') == '5' %} Organico
  13.        {% elif (now().timestamp() | int - (8*60*60)) | timestamp_custom('%w') == '6' %} Niente
  14.        {% elif (now().timestamp() | int - (8*60*60)) | timestamp_custom('%w') == '0' %} Plastica
  15.        {% endif %}
  16.        
  17.        {% if (now().timestamp() | int - (8*60*60)) | timestamp_custom('%w') == '4' %}
  18.          {% if (now().isocalendar()[1] | int) % 2 == 0 %} Vetro
  19.          {% else %} Carta
  20.          {% endif %}
  21.        {% endif %}
  22.        "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement