-
-
Save EverythingSmartHome/814bc87e83dcff1c06fffa3095b95b3f to your computer and use it in GitHub Desktop.
| #Showing the state of a temperature in a template card: | |
| {{ states('sensor.your_temperature_sensor') }} | |
| #Change the colour of the light depending on status: | |
| {% if is_state('light.your_light', 'on') %} | |
| orange | |
| {% endif %} | |
| #Welcome template: | |
| {% set time = now().hour %} | |
| {% if (time >= 18) %} | |
| Good Evening, {{user}}! | |
| {% elif (time >= 12) %} | |
| Good Afternoon, {{user}}! | |
| {% elif (time >= 5) %} | |
| Good Morning, {{user}}! | |
| {% else %} | |
| Hello, {{user}}! | |
| {% endif %} | |
I have this code below which is working fine, but I want to make the icon in orange every time that any of these 4 lights below turns on.
light.banheiro_suite_interruptor_iluminacao_interruptor_1
light.banheiro_suite_interruptor_iluminacao_interruptor_2
light.banheiro_suite_interruptor_iluminacao_interruptor_3
light.banheiro_suite_interruptor_iluminacao_interruptor_4
{% if is_state('light.banheiro_suite_interruptor_iluminacao_interruptor_1','on')
%} orange
{% endif %}
Does anybody know how to ADD the "OR" clause on this sintax?
I have this code below which is working fine, but I want to make the icon in orange every time that any of these 4 lights below turns on. light.banheiro_suite_interruptor_iluminacao_interruptor_1 light.banheiro_suite_interruptor_iluminacao_interruptor_2 light.banheiro_suite_interruptor_iluminacao_interruptor_3 light.banheiro_suite_interruptor_iluminacao_interruptor_4
{% if is_state('light.banheiro_suite_interruptor_iluminacao_interruptor_1','on') %} orange {% endif %}
Does anybody know how to ADD the "OR" clause on this sintax?
{% if is_state('light.banheiro_suite_interruptor_iluminacao_interruptor_1','on')
or is_state('light.light_2','on')
or is_state('light.light_3','on')
or is_state('light.light_4','on')
%} orange
{% endif %}Many thanks @danewhitfield for your assistance! You rock! :-)
I think you can just simplify this to be:
Today is {{ now().strftime('%A %B %d, %Y %I:%M %p') }}
You can decide what format you want that date and time to be in depending on what is most ideal for you.
Hello everybody!
I added this in the secondary information field since I am always forgetting the date ๐
{% set time = now().weekday() %} {% if (time == 0) %} Today is Monday, {{ now().strftime("%d.%m.%Y")}} {% elif (time == 1) %} Today is Tuesday, {{ now().strftime("%d.%m.%Y")}} {% elif (time == 2) %} Today is Wednesday, {{ now().strftime("%d.%m.%Y")}} {% elif (time == 3) %} Today is Thursday, {{ now().strftime("%d.%m.%Y")}} {% elif (time == 4) %} Today is Friday, {{ now().strftime("%d.%m.%Y")}} {% elif (time == 5) %} Today is Saturday, {{ now().strftime("%d.%m.%Y")}} {% elif (time == 6) %} Today is Sunday, {{ now().strftime("%d.%m.%Y")}} {% else %} Today is the lucky day... {% endif %}
How would I go about adding the date after each day of my subtitle addition to the Welcome Screen template. I am not sure how to get that added in.
I added this in the secondary information field since I am always forgetting the date ๐
{% set time = now().weekday() %} {% if (time == 0) %} Today is Monday, {{ now().date()}} {% elif (time == 1) %} Today is Tuesday, {{ now().date()}} {% elif (time == 2) %} Today is Wednesday, {{ now().date()}} {% elif (time == 3) %} Today is Thursday, {{ now().date()}} {% elif (time == 4) %} Today is Friday, {{ now().date()}} {% elif (time == 5) %} Today is Saturday, {{ now().date()}} {% elif (time == 6) %} Today is Sunday, {{ now().date()}} {% else %} Today is fudged.... {% endif %}
Or you could just use this - secondary: "Today is {{ now().strftime('%A %d.%m.%Y') }}"
ps thank you for that great idea.


Old thread, not sure if anyone is interested but if like myself you have setup your full name on HA then it might be worth using (either directly or as a helper):
Looks cleaner with just the first name and fits better.