Advertisement
xyboox

Sensor greetings

Feb 7th, 2021
980
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.96 KB | None | 0 0
  1. - platform: template
  2.   sensors:
  3.     placeholder:
  4.       value_template: ' '
  5.     sidebar_greeting:
  6.       value_template: >
  7.        {% set time = now().hour %}
  8.         {% if time <= 1 %} Good night {{'\U0001F611'}}
  9.         {% elif time <= 3 %} Good night {{'\U0001F62A'}}
  10.         {% elif time <= 5 %} Good night {{'\U0001F634'}}
  11.         {% elif time <= 7 %} Good morning {{'\U0001F4A9'}}
  12.         {% elif time <= 9 %} Good morning {{'\u2615\uFE0F'}}
  13.         {% elif time <= 10 %} Good morning {{'\U0001F642'}}
  14.         {% elif time <= 12 %} Good afternoon {{'\U0001F60A'}}
  15.         {% elif time <= 15 %} Good afternoon {{'\U0001F60E'}}
  16.         {% elif time <= 17 %} Good afternoon {{'\U0001F44B\U0001F3FB'}}
  17.         {% elif time <= 19 %} Good evening {{'\U0001F44B\U0001F3FB'}}
  18.         {% elif time <= 22 %} Good evening {{'\U0001F60C'}}
  19.         {% elif time <= 23 %} Good evening {{'\U0001F974'}}
  20.         {% else %} Good evening {{'\U0001F974'}}
  21.         {% endif %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement