-
-
Save dstreefkerk/c0ea601a9a1f1f0f4ca3e19f3fb2234a to your computer and use it in GitHub Desktop.
Home Assistant Mushroom card templates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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: | |
#Updated to greet the user by first name only | |
{% set time = now().hour %} | |
{% set firstname = user.split(" ") | first %} | |
{% if (time >= 18) %} | |
Good Evening, {{firstname}}! | |
{% elif (time >= 12) %} | |
Good Afternoon, {{firstname}}! | |
{% elif (time >= 5) %} | |
Good Morning, {{firstname}}! | |
{% else %} | |
Hello, {{firstname}}! | |
{% endif %} | |
Hello, {{user}}! | |
{% endif %} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment