Advertisement
energywave

Sensore compleanno

Jul 22nd, 2022
860
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.98 KB | None | 0 0
  1. template:
  2.   - trigger:
  3.       - platform: time_pattern
  4.         hours: 0
  5.         minutes: 0
  6.       - platform: homeassistant
  7.         event: start
  8.     sensor:
  9.       - name: "Compleanno"
  10.         state: >
  11.          {% if now().day == 16 and now().month == 12 %}
  12.             Ilaria
  13.           {% elif now().day == 20 and now().month == 6 %}
  14.             Erica
  15.           {% elif now().day == 22 and now().month == 2 %}
  16.             Antonella
  17.           {% elif now().day == 8 and now().month == 5 %}
  18.             Henrik
  19.           {% else %}
  20.             none
  21.           {% endif %}
  22.       - name: "Compleanno anno"
  23.         state: >
  24.          {% if now().day == 16 and now().month == 12 %}
  25.             2015
  26.           {% elif now().day == 20 and now().month == 6 %}
  27.             2010
  28.           {% elif now().day == 22 and now().month == 2 %}
  29.             1980
  30.           {% elif now().day == 8 and now().month == 5 %}
  31.             1978
  32.           {% else %}
  33.             0
  34.           {% endif %}
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement