Open jackjohnsonuk opened 6 years ago
Save New Duplicate & Edit Just Text Twitter 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
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_states('weather.yweather', 'clear-night') -%} mdi:weather-night {% elif is_states('weather.yweather', 'rain') -%} mdi:weather-rainy {% elif is_states('weather.yweather', 'snow') -%} mdi:weather-snowy {% elif is_states('weather.yweather', 'sleet') -%} mdi:weather-snowy-rainy {% elif is_states('weather.yweather', 'wind') -%} mdi:weather-windy-variant {% elif is_states('weather.yweather', 'fog') -%} mdi:weather-fog {% elif is_states('weather.yweather', 'cloudy') -%} mdi:weather-cloudy {% elif is_states('weather.yweather', 'partly-cloudy-day') -%} mdi:weather-partlycloudy {% elif is_states('weather.yweather', 'hail') -%} mdi:weather-hail {% elif is_states('weather.yweather', 'thunderstorm') -%} mdi:weather-lightning {% else %} mdi:help-circle {% endif %}
platform: time_date display_options:
platform: template sensors: time_of_day: value_template: > {% set current_hour = strptime(states('sensor.time'), "%H:%M").hour %} {% if current_hour < 12 %} Good Morning, Peter {% elif 12 <= current_hour < 18 %} Good Afternoon, Peter {% elif 18 <= current_hour < 23 %} Good Evening, Peter {% else %} Good Night, Peter {% endif %}