Copy - platform: time_date
display_options:
- 'time'
- platform: template
sensors:
time_of_day:
value_template: >
{% set current_hour = strptime(states('sensor.time'), "%H:%M").hour %}
{% if current_hour < 12 %}
Good Morning, User
{% elif 12 <= current_hour < 18 %}
Good Afternoon, User
{% elif 18 <= current_hour < 23 %}
Good Evening, User
{% else %}
Good Night, User
{% endif %}
- platform: template
sensors:
greeter_card_info:
value_template: >
Current Location: {{ states('yourawesome_device_tracker') }}
Next Event: {{ as_timestamp(states.calendar.your_awesome_mail.attributes.start_time) | timestamp_custom('%Y/%m/%d at %H:%M') }} - {{ states.calendar.your_awesome_mail.attributes.message }}
- platform: command_line
name: "Outside: Alerts"
icon: alert-outline
command: "/home/.homeassistant/homeassistant/includes/script/shell/check-weather.sh"
scan_interval: 180
- platform: template
sensors:
outside_temp:
friendly_name: "Outside Temperature"
unit_of_measurement: '°C'
value_template: "{{ states.weather.yweather.attributes.temperature }}"
icon_template: >
{% if is_state("weather.yweather", "sunny") -%}
mdi:weather-sunny
{% elif is_state('weather.yweather', 'clear-night') -%}
mdi:weather-night
{% elif is_state('weather.yweather', 'rain') -%}
mdi:weather-rainy
{% elif is_state('weather.yweather', 'snow') -%}
mdi:weather-snowy
{% elif is_state('weather.yweather', 'sleet') -%}
mdi:weather-snowy-rainy
{% elif is_state('weather.yweather', 'wind') -%}
mdi:weather-windy-variant
{% elif is_state('weather.yweather', 'fog') -%}
mdi:weather-fog
{% elif is_state('weather.yweather', 'cloudy') -%}
mdi:weather-cloudy
{% elif is_state('weather.yweather', 'partly-cloudy-day') -%}
mdi:weather-partlycloudy
{% elif is_state('weather.yweather', 'hail') -%}
mdi:weather-hail
{% elif is_state('weather.yweather', 'thunderstorm') -%}
mdi:weather-lightning
{% else %}
mdi:help-circle
{% endif %}
entity_picture_template: >
{% if is_state("weather.yweather", "sunny") -%}
/local/weather_icons/static/sunny.svg
{% elif is_state('weather.yweather', 'clear-night') -%}
/local/weather_icons/static/clear-night.svg
{% elif is_state('weather.yweather', 'rain') -%}
/local/weather_icons/static/rain.svg
{% elif is_state('weather.yweather', 'snow') -%}
/local/weather_icons/static/snow.svg
{% elif is_state('weather.yweather', 'sleet') -%}
/local/weather_icons/static/sleet.svg
{% elif is_state('weather.yweather', 'wind') -%}
/local/weather_icons/static/wind.svg
{% elif is_state('weather.yweather', 'fog') -%}
/local/weather_icons/static/fog.svg
{% elif is_state('weather.yweather', 'cloudy') -%}
/local/weather_icons/static/cloudy.svg
{% elif is_state('weather.yweather', 'partly-cloudy-day') -%}
/local/weather_icons/static/partly-cloudy-day.svg
{% elif is_state('weather.yweather', 'hail') -%}
/local/weather_icons/static/hail.svg
{% elif is_state('weather.yweather', 'thunderstorm') -%}
/local/weather_icons/static/thunderstorm.svg
{% else %}
/local/weather_icons/static/help.svg
{% endif %}