-
-
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 %} | |
@Morcegolas
It'd be better to create a group of lights in the helpers section and turn that group off.
I have some lights that I don't want to show or turn off when I hold the button, like my underglow, backlighting, deck lights, etc.
You can also use the group properties to set the icon color and count how many lights are on.
type: custom:mushroom-template-card
primary: Lights
secondary: >-
{% set count =
states|selectattr('entity_id','in',state_attr('light.all_people_lights','entity_id'))|selectattr('state','eq','on')|list|count
%} {{count}} lights on
icon: mdi:lightbulb
icon_color: >-
{% set count =
states|selectattr('entity_id','in',state_attr('light.all_people_lights','entity_id'))|selectattr('state','eq','on')|list|count
%} {% if count > 0 %} orange {%endif%}
tap_action:
action: navigate
navigation_path: /dashboard-mushroom/lights
layout: vertical
hold_action:
action: call-service
service: light.turn_off
data: {}
target:
entity_id: light.all_people_lights
also set it to a hold action, not a tap action, using a tap action is one miss-tap away from putting everyone in the dark.
Thanks, I didn't even know where I could create groups ;)
Hi guys , i came strait forward from Youtube page and i am a bit confused on setting the count . I have followed every step but when i switch the light on for a room is automatically count 2 lights ! meanwhile i have only one light in that room ! the same light inside the room been used in both Horizontal Stack configuration , how do you go about sorting this out ? I have one main light . Thanks
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 %}
hi guys, i added this and it works fine, but shows me the english format of Date
i would need the Format 12.04.2023.
would be nice if someone have an hint for. Just 2 days with HA.
How do we get that chip where it shows what lights are on?
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 %}
THANK YOU SO MUCH!
now()
is python date object so you can use formatting.
{% set current_datetime = now() -%}
Today is {{ current_datetime.strftime("%A") }}, {{ current_datetime.date()}}
@stoniwankenobii this way will be easier ;)
@dos1973 you can use formatting
now().strftime("%d.%m.%Y")
YOU'RE A WIZARD HARRY
can someone please give detail instruction how to creat the light counter card
What is required to have the dashboard format correctly on a tablet or desktop?
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 %}
I made this, but I want to make that clickable, when I click it, it turns all the lights off, how can I do that?
Thanks
EDIT: I found a solution for this, created a Script and then I set the script as an action for this.