Trzinka
(Robert PeriÄ)
December 9, 2021, 1:17pm
1
add to configuration.yaml
sensor:
# Time & date
- platform: time_date
display_options:
- "time"
- "date"
- "date_time"
- "date_time_utc"
- "date_time_iso"
- "time_date"
- "time_utc"
- "beat"
# Seasons
- platform: season
name: "Seasons"
# Change the date display
- platform: template
sensors:
date_long:
friendly_name: 'Date'
value_template: >
{% set months = ["January.", "February.", "March.", "April.", "May.", "June.", "July.", "August.", "September.", "October.", "November.", "December.""] %}
{% set month = months[now().strftime('%m') | int -1] %}
{% set days = ["Sunday, ", "Monday, ", "Tuesday, ", "Wednesday, ", "Thursday, ", "Friday, ", "Saturday, "] %}
{% set day = days[now().strftime('%w') | int] %}
{{ day + ' ' + now().strftime('%d') + '.' + now().strftime('%m') + '.' + month + ' '+ now().strftime('%Y') }}
# Parts of the day - View the current part of the day
- platform: template
sensors:
greeting:
friendly_name: 'Part of the day'
value_template: >
{% set state = states('sensor.time') %}
{% if '22:00' <= state < '06:00' %}
Night
{% elif '06:00' <= state < '08:00' %}
Morning
{% elif '08:00' <= state < '20:00' %}
Day
{% else %}
Evening
{% endif %}
===================
add 1 cards
type: vertical-stack
cards:
- type: horizontal-stack
cards:
- type: entity
entity: sensor.time
name: Time
- type: entity
entity: sensor.greeting
state_color: true
icon: mdi:timelapse
- type: entity
entity: sensor.seasons
- type: horizontal-stack
cards:
- type: weather-forecast
entity: weather.dom
show_forecast: false
name: Home
- type: custom:weather-card
entity: weather.dom
number_of_forecasts: '5'
name: Weather
===================
add 2 cards
type: vertical-stack
cards:
- type: horizontal-stack
cards:
- type: entity
entity: sensor.date_long
icon: mdi:calendar-month
- type: iframe
url: >-
https://embed.windy.com/embed2.html?lat=xx.xxxxxx&lon=xx.xxxxxx&detailLat=xx.xxxxxx&detailLon=xx.xxxxxx&width=650&height=450&zoom=9&level=surface&overlay=clouds&product=ecmwf&menu=&message=&marker=&calendar=now&pressure=&type=map&location=coordinates&detail=&metricWind=default&metricTemp=default&radarRange=-1
aspect_ratio: 95%
NOTE: your coordinates where is xx (lat=xx.xxxxxx&lon=xx.xxxxxx&detailLat=xx.xxxxxx&detailLon=xx.xxxxxx add )
1 Like
AllHailJ
(J Gent)
December 9, 2021, 2:54pm
2
I had to change platform seasons to get this to check valid
# Seasons
- platform: season
name: "Seasons"
Trzinka
(Robert PeriÄ)
December 9, 2021, 3:09pm
3
Sorry, my mistake. The original is in Slovene and when I translated it I accidentally deleted " ". Thanks for the warning, I corrected it. But I donât think there should be a problem because the name on the card overrides the default name. Anyway, thanks and regards from Slovenia.
JohnPlou
(John)
December 26, 2022, 8:27pm
4
Hi Robert.
I inserted the copied text into my âsensor.yamlâ, but the following error occured:
Invalid config for [sensor.template]: invalid template (TemplateSyntaxError: expected token â,â, got âSundayâ) for dictionary value @ data[âsensorsâ][âdate_longâ][âvalue_templateâ]. Got '{% set months = [âJanuary.â, âFebruary.â, âMarch.â, âApril.â, âMay.â, âJune.â, âJuly.â, âAugust.â, âSeptember.â, âOctober.â, âNovember.â, âDecember.â"] %} {% set month = months[now().strftime('%m') | int -1] %} {% set days = ["Sunday, ", "Monday, ", "Tuesday, ", "Wednesday, ", "Thursday, ", "Friday, ", "Saturday, "] %} {% set day = days[now().strftime('%w') | int] %} {{ day + ' ' + now().strftime('%d') + '.' + now().strftime('%m') + '.' + month + ' '+ now().strftime('%Y') ⌠(See ?, line ?).
Any ideas what can be wrong?
spacegaier
(Philip Allgaier)
January 2, 2023, 10:46am
6
After December (in the list of months) there is a second redundant quotation mark (") that needs to be removed.
2 Likes
lidans5
(lior)
January 2, 2023, 3:33pm
7
should be added to sensors.yaml or to configuration.yaml?
JohnPlou
(John)
January 2, 2023, 9:38pm
8
You are totally right Philip!
When I delete the extra quotation mark, everything worked!
Thank you for your help!
cb24nz
(Carl)
January 4, 2023, 11:07am
9
that did it, thanks Phillip
Has anyone discovered a way to make the map static? Using that on a mobile app makes it impossible to scroll.
Hi everyone, I just followed the instructions in the beginning of the post and got the following error
Anyone got a fix?
The Season YAML configuration has been removed
This stops working in version 2022.12.0. Please address before upgrading.
Configuring Season using YAML has been removed.
Your existing YAML configuration is not used by Home Assistant.
Remove the YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue.
Novell1
(Novell1)
April 23, 2024, 3:54pm
12
Hello cb24nz, spacegaier, lidans5, JohnPlou and Trzinka,
as a new HA user, I would like to display the date on the start page, as shown by Trzinka. Does anyone have a detailed description for me as a âgreenhornâ on how to integrate this?
Does (add to Configuration.yaml) have to be inserted on line13 (see printscreen)?
Where does the script (add 1 cards) belong? Also the script add2 cards, in a new card (tile)?
Many thanks for your support!
Novell1