Merging weather01 page into the others

- All the weather pages now shares the same code, increasing standardization
- Support for other forecast parameters when supported by the integration
- Removed empty rows between the forecast parameters
This commit is contained in:
Edward Firmo
2023-03-26 17:21:10 +02:00
committed by GitHub
parent 881c50dd1f
commit 9616ea4c8f

View File

@@ -2404,76 +2404,15 @@ variables:
entity: !input "weather_entity"
name: '{{ weather_entity | replace("weather.","") }}' # used only during the creation of accuweather in variables
units:
hours_of_sun: "{{ state_attr(weather_entity, 'hours_of_sun_unit') if state_attr(weather_entity, 'hours_of_sun_unit') else ' h' }}"
precipitation: "{{ state_attr(weather_entity, 'precipitation_unit') if state_attr(weather_entity, 'precipitation_unit') else '%' }}"
hours_of_sun: "{{ state_attr(weather_entity, 'hours_of_sun_unit') if state_attr(weather_entity, 'hours_of_sun_unit') else 'h' }}"
precipitation: "{{ state_attr(weather_entity, 'precipitation_unit') if state_attr(weather_entity, 'precipitation_unit') else 'mm' }}"
precipitation_probability: "{{ state_attr(weather_entity, 'precipitation_probability_unit') if state_attr(weather_entity, 'precipitation_probability_unit') else '%' }}"
pressure: "{{ state_attr(weather_entity, 'temperature_unit') if state_attr(weather_entity, 'pressure_unit') }}"
temperature: "{{ state_attr(weather_entity, 'temperature_unit') if state_attr(weather_entity, 'temperature_unit') else '°' }}"
thunderstorm_probability: "{{ state_attr(weather_entity, 'thunderstorm_probability_unit') if state_attr(weather_entity, 'thunderstorm_probability_unit') else '%' }}"
uv_index: "{{ state_attr(weather_entity, 'uv_index_unit') if state_attr(weather_entity, 'uv_index_unit') }}"
visibility: "{{ state_attr(weather_entity, 'visibility_unit') if state_attr(weather_entity, 'visibility_unit') }}"
wind_speed: "{{ state_attr(weather_entity, 'wind_speed_unit') if state_attr(weather_entity, 'wind_speed_unit') }}"
accuweather:
forecast:
day_0:
realfeel_temperature:
min: "sensor.{{ weather.name }}_realfeel_temperature_min_0d"
max: "sensor.{{ weather.name }}_realfeel_temperature_max_0d"
hours_of_sun: "sensor.{{ weather.name }}_hours_of_sun_0d"
uv_index: "sensor.{{ weather.name }}_uv_index_0d"
thunderstorm_probability:
day: "sensor.{{ weather.name }}_thunderstorm_probability_day_0d"
night: "sensor.{{ weather.name }}_thunderstorm_probability_night_0d"
wind:
day: "sensor.{{ weather.name }}_wind_day_0d"
night: "sensor.{{ weather.name }}_wind_night_0d"
day_1:
realfeel_temperature:
min: "sensor.{{ weather.name }}_realfeel_temperature_min_1d"
max: "sensor.{{ weather.name }}_realfeel_temperature_max_1d"
hours_of_sun: "sensor.{{ weather.name }}_hours_of_sun_1d"
uv_index: "sensor.{{ weather.name }}_uv_index_1d"
thunderstorm_probability:
day: "sensor.{{ weather.name }}_thunderstorm_probability_day_1d"
night: "sensor.{{ weather.name }}_thunderstorm_probability_night_1d"
wind:
day: "sensor.{{ weather.name }}_wind_day_1d"
night: "sensor.{{ weather.name }}_wind_night_1d"
day_2:
realfeel_temperature:
min: "sensor.{{ weather.name }}_realfeel_temperature_min_2d"
max: "sensor.{{ weather.name }}_realfeel_temperature_max_2d"
hours_of_sun: "sensor.{{ weather.name }}_hours_of_sun_2d"
uv_index: "sensor.{{ weather.name }}_uv_index_2d"
thunderstorm_probability:
day: "sensor.{{ weather.name }}_thunderstorm_probability_day_2d"
night: "sensor.{{ weather.name }}_thunderstorm_probability_night_2d"
wind:
day: "sensor.{{ weather.name }}_wind_day_2d"
night: "sensor.{{ weather.name }}_wind_night_2d"
day_3:
realfeel_temperature:
min: "sensor.{{ weather.name }}_realfeel_temperature_min_3d"
max: "sensor.{{ weather.name }}_realfeel_temperature_max_3d"
hours_of_sun: "sensor.{{ weather.name }}_hours_of_sun_3d"
uv_index: "sensor.{{ weather.name }}_uv_index_3d"
thunderstorm_probability:
day: "sensor.{{ weather.name }}_thunderstorm_probability_day_3d"
night: "sensor.{{ weather.name }}_thunderstorm_probability_night_3d"
wind:
day: "sensor.{{ weather.name }}_wind_day_3d"
night: "sensor.{{ weather.name }}_wind_night_3d"
day_4:
realfeel_temperature:
min: "sensor.{{ weather.name }}_realfeel_temperature_min_4d"
max: "sensor.{{ weather.name }}_realfeel_temperature_max_4d"
hours_of_sun: "sensor.{{ weather.name }}_hours_of_sun_4d"
uv_index: "sensor.{{ weather.name }}_uv_index_4d"
thunderstorm_probability:
day: "sensor.{{ weather.name }}_thunderstorm_probability_day_4d"
night: "sensor.{{ weather.name }}_thunderstorm_probability_night_4d"
wind:
day: "sensor.{{ weather.name }}_wind_day_4d"
night: "sensor.{{ weather.name }}_wind_night_4d"
##### PUSH TO NEXTION DISPLAY #####
command_text_printf: "esphome.{{ nspanel_name }}_send_command_text_printf"
@@ -4337,7 +4276,7 @@ action:
##### NSPanel Outdoor Temp #####
- variables:
outdoor_temp: >-
{%- if is_number(states(outdoortemp)) -%}{{ states(outdoortemp) | round(1) }}
{%- if outdoortemp and is_number(states(outdoortemp)) -%}{{ states(outdoortemp) | round(1) }}
{%- else -%} {{state_attr(weather.entity,"temperature") | round(1) if state_attr(weather.entity, "temperature") else 0 }}
{%- endif -%}
### LABEL Outdoor Temp Font Color ###
@@ -4726,7 +4665,7 @@ action:
milliseconds: "{{ delay_value }}"
- service: "{{ command_show_all }}"
## PAGE BUTTONPAGE01 ##
## PAGE BUTTONPAGE01 ##
- conditions: '{{ trigger.event.data.new_state.state == page_buttonpage01 }}'
alias: 'buttonpage01 page'
sequence:
@@ -6321,212 +6260,106 @@ action:
component: climate.hotwater_temp
message: "{{ (states(hotwatertemp) | round(1) ~ weather.units.temperature) if is_number(states(hotwatertemp)) }}"
## PAGE WEATHE01 ##
- alias: 'weather01 page'
conditions: '{{ trigger.event.data.new_state.state == page_weather01 }}'
sequence:
- choose:
### DEFAULT - WEATHER ###
- conditions: '{{ weather.type == "Default" }}'
sequence:
##### SET weather PIC on Home Page ####
- service: "{{ command_printf }}"
data:
cmd: weather01.weather_icon.pic={{ nextion.pics.weather[states(weather_entity) | default('unknown')] }}
- delay:
milliseconds: "{{ delay_value }}"
##### SET TEMP MAX ####
- service: "{{ command_text_printf }}"
data:
component: weather01.temp_max ### Temperature MAX ###
message: '{{state_attr(weather.entity,"temperature") | round(0)}}{{ weather.units.temperature }}'
- delay:
milliseconds: "{{ delay_value }}"
##### Day Name #####
- service: "{{ command_text_printf }}"
data:
component: weather01.day
message: "{{ mui[language].relative_day.today }}"
- delay:
milliseconds: "{{ delay_value }}"
##### Day Date #####
- service: "{{ command_text_printf }}"
data:
component: weather01.date
message: "{{ mui_weekday_today }}"
- delay:
milliseconds: "{{ delay_value }}"
##### field 1 #####
##### field 2 #####
##### field 3 #####
- service: "{{ command_text_printf }}"
data:
component: weather01.value03
message: '{{state_attr(weather.entity,"wind_speed") | round(0)}} {{ weather.units.wind_speed }}'
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: weather01.value03_icon
message: "{{ nextion.icons.weather.wind }}"
- delay:
milliseconds: "{{ delay_value }}"
##### field 4 #####
##### field 5 #####
### ACCUWEATHER - WEATHER ###
- conditions: '{{ weather.type == "AccuWeather" }}'
sequence:
##### SET weather PIC on Home Page ####
- service: "{{ command_printf }}"
data:
cmd: weather01.weather_icon.pic={{ nextion.pics.weather[state_attr(weather_entity,'forecast')[0].condition | default('unknown')] }}
- delay:
milliseconds: "{{ delay_value }}"
##### SET TEMP MIN ####
- service: "{{ command_text_printf }}"
data:
component: weather01.temp_min ### Temperature MIN ###
message: '{{states(accuweather.forecast.day_0.realfeel_temperature.min) | round(0)}}{{ weather.units.temperature }}'
- delay:
milliseconds: "{{ delay_value }}"
##### Slash #####
- service: "{{ command_text_printf }}"
data:
component: weather01.slash
message: '/'
- delay:
milliseconds: "{{ delay_value }}"
##### SET TEMP MAX ####
- service: "{{ command_text_printf }}"
data:
component: weather01.temp_max ### Temperature MAX ###
message: '{{states(accuweather.forecast.day_0.realfeel_temperature.max) | round(0)}}{{ weather.units.temperature }}'
- delay:
milliseconds: "{{ delay_value }}"
##### Day Name #####
- service: "{{ command_text_printf }}"
data:
component: weather01.day
message: "{{ mui[language].relative_day.today }}"
- delay:
milliseconds: "{{ delay_value }}"
##### Day Date #####
- service: "{{ command_text_printf }}"
data:
component: weather01.date
message: "{{ mui_weekday_today }}"
- delay:
milliseconds: "{{ delay_value }}"
##### field 1 #####
- service: "{{ command_text_printf }}"
data:
component: weather01.value01
message: "{{ state_attr(weather.entity,'forecast')[0].precipitation_probability}} {{ weather.units.precipitation }}"
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: weather01.value01_icon
message: "{{ nextion.icons.weather.rain }}"
- delay:
milliseconds: "{{ delay_value }}"
##### field 2 #####
- service: "{{ command_text_printf }}"
data:
component: weather01.value02
message: "{{states(accuweather.forecast.day_0.hours_of_sun) | round(0)}} {{ weather.units.hours_of_sun }}"
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: weather01.value02_icon
message: "{{ nextion.icons.weather.sun }}"
- delay:
milliseconds: "{{ delay_value }}"
##### field 3 #####
- service: "{{ command_text_printf }}"
data:
component: weather01.value03
message: "{{state_attr(accuweather.forecast.day_0.uv_index, 'level')}} {{states(accuweather.forecast.day_0.uv_index) | round(0)}}"
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: weather01.value03_icon
message: "{{ nextion.icons.weather.protect }}"
- delay:
milliseconds: "{{ delay_value }}"
##### field 4 #####
- service: "{{ command_text_printf }}"
data:
component: weather01.value04
message: "{{states(accuweather.forecast.day_0.thunderstorm_probability.day) | round(0)}} {{ weather.units.thunderstorm_probability }}"
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: weather01.value04_icon
message: "{{ nextion.icons.weather.lightning }}"
- delay:
milliseconds: "{{ delay_value }}"
##### field 5 #####
- service: "{{ command_text_printf }}"
data:
component: weather01.value05
message: "{{states(accuweather.forecast.day_0.wind.day) | round(0)}} {{ weather.units.wind_speed }}"
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: weather01.value05_icon
message: "{{ nextion.icons.weather.wind }}"
### DEFAULT ###
default:
- service: "{{ command_printf }}"
data:
cmd: "page {{ page_home }}"
## PAGE WEATHE02 to WEATHE05 (FORECAST) ##
- alias: 'weather forecast pages'
conditions: '{{ trigger.event.data.new_state.state in [page_weather02, page_weather03, page_weather04, page_weather05] }}'
## PAGE WEATHER (WEATHE01 to WEATHE05) ##
- alias: 'weather pages'
conditions: '{{ trigger.event.data.new_state.state in [page_weather01, page_weather02, page_weather03, page_weather04, page_weather05] }}'
sequence:
- variables:
page_name: "{{ trigger.event.data.new_state.state }}"
page_index: "{{ (page_name[-2:] | int(0)) - 2 }}"
accuweather_day_name: "{{ 'day_' ~ (page_index+1) }}"
##### SET weather PIC on Home Page ####
page_index: "{{ (page_name[-2:] | int(0)) - 1 }}"
accuweather_day_name: "{{ 'day_' ~ page_index }}"
accuweather_sensor_prefix: "{{ 'sensor.' ~ weather.name ~ '_' }}"
accuweather_sensor_sufix: "{{ '_' ~ page_index ~ 'd' }}"
temp_min: >
{% if weather.type == 'AccuWeather' %}
{{ states(accuweather_sensor_prefix ~ 'realfeel_temperature_min' ~ accuweather_sensor_sufix) | default('unknown') }}
{% else %}
{{ state_attr(weather.entity,'forecast')[page_index].templow | default('unknown') }}
{% endif %}
temp_max: >
{% if weather.type == 'AccuWeather' %}
{{ states(accuweather_sensor_prefix ~ 'realfeel_temperature_max' ~ accuweather_sensor_sufix) | default('unknown') }}
{% else %}
{{ state_attr(weather.entity,'forecast')[page_index].temperature | default('unknown') }}
{% endif %}
precipitation: "{{ state_attr(weather.entity,'forecast')[page_index].precipitation | default('unknown') }}"
precipitation_probability: "{{ state_attr(weather.entity,'forecast')[page_index].precipitation_probability | default('unknown') }}"
hours_of_sun: >
{% if weather.type == 'AccuWeather' %}
{{ states(accuweather_sensor_prefix ~ 'hours_of_sun' ~ accuweather_sensor_sufix) | default('unknown') }}
{% else %}
{{ state_attr(weather.entity,'forecast')[page_index].hours_of_sun | default('unknown') }}
{% endif %}
uv_index: >
{% if weather.type == 'AccuWeather' %}
{{ states(accuweather_sensor_prefix ~ 'uv_index' ~ accuweather_sensor_sufix) | default('unknown') }}
{% else %}
{{ state_attr(weather.entity,'forecast')[page_index].uv_index | default('unknown') }}
{% endif %}
wind_speed: "{{ state_attr(weather.entity,'forecast')[page_index].wind_speed | default('unknown') }}"
thunderstorm_probability: >
{% if weather.type == 'AccuWeather' %}
{{ states(accuweather_sensor_prefix ~ 'thunderstorm_probability_day' ~ accuweather_sensor_sufix) | default('unknown') }}
{% else %}
{{ state_attr(weather.entity,'forecast')[page_index].thunderstorm_probability | default('unknown') }}
{% endif %}
parameters:
- name: precipitation_probability
visibility: "{{ is_number(precipitation_probability) }}"
value: "{{ (precipitation_probability | round(0) ~ weather.units.precipitation_probability) if is_number(precipitation_probability) }}"
icon: "{{ nextion.icons.weather.rain }}"
- name: precipitation
visibility: "{{ is_number(precipitation) }}"
value: "{{ (precipitation | round(0) ~ ' ' ~ weather.units.precipitation) if is_number(precipitation) }}"
icon: "{{ nextion.icons.weather.rain }}"
- name: hours_of_sun
visibility: "{{ is_number(hours_of_sun) }}"
value: "{{ (hours_of_sun | round(0) ~ ' ' ~ weather.units.hours_of_sun) if is_number(hours_of_sun) }}"
icon: "{{ nextion.icons.weather.sun }}"
- name: uv_index
visibility: "{{ is_number(uv_index) }}"
value: >
{{ (state_attr(accuweather_sensor_prefix ~ 'uv_index' ~ accuweather_sensor_sufix, 'level') | default(None) ~ ': ') if weather.type == 'AccuWeather' }}
{{ (uv_index | round(0) ~ weather.units.uv_index) if is_number(uv_index) }}
icon: "{{ nextion.icons.weather.protect }}"
- name: wind_speed
visibility: "{{ is_number(wind_speed) }}"
value: "{{ (wind_speed | round(0) ~ ' ' ~ weather.units.wind_speed) if is_number(wind_speed) }}"
icon: "{{ nextion.icons.weather.wind }}"
- name: thunderstorm_probability
visibility: "{{ is_number(thunderstorm_probability) }}"
value: "{{ (thunderstorm_probability | round(0) ~ weather.units.thunderstorm_probability) if is_number(thunderstorm_probability) }}"
icon: "{{ nextion.icons.weather.lightning }}"
##### SET weather PIC on Home Page ####
- service: "{{ command_printf }}"
data:
cmd: "{{ page_name }}.weather_icon.pic={{ nextion.pics.weather[state_attr(weather_entity,'forecast')[page_index+1].condition | default('unknown')] }}"
cmd: "{{ page_name }}.weather_icon.pic={{ nextion.pics.weather[states(weather_entity) | default('unknown')] if page_name == page_weather01 else nextion.pics.weather[state_attr(weather_entity,'forecast')[page_index].condition | default('unknown')] }}"
- delay:
milliseconds: "{{ delay_value }}"
##### Slash #####
- if: "{{ is_number(temp_min) }}"
then:
##### SET TEMP MIN ####
- service: "{{ command_text_printf }}"
data:
component: "{{ page_name }}.temp_min" ### Temperature MIN ###
message: '{{temp_min | round(0)}}{{ weather.units.temperature }}'
- delay:
milliseconds: "{{ delay_value }}"
##### Slash #####
- service: "{{ command_text_printf }}"
data:
component: "{{ page_name }}.slash"
message: '/'
- delay:
milliseconds: "{{ delay_value }}"
##### SET TEMP MAX ####
- service: "{{ command_text_printf }}"
data:
component: "{{ page_name }}.slash"
message: '/'
component: "{{ page_name }}.temp_max" ### Temperature MAX ###
message: '{{temp_max | round(0)}}{{ weather.units.temperature }}'
- delay:
milliseconds: "{{ delay_value }}"
@@ -6534,7 +6367,7 @@ action:
- service: "{{ command_text_printf }}"
data:
component: "{{ page_name }}.day"
message: "{{ (dict.values(mui[language].relative_day) | list)[page_index+1] }}"
message: "{{ (dict.values(mui[language].relative_day) | list)[page_index] }}"
- delay:
milliseconds: "{{ delay_value }}"
@@ -6542,156 +6375,26 @@ action:
- service: "{{ command_text_printf }}"
data:
component: "{{ page_name }}.date"
message: "{{ (dict.values(mui[language].weekdays) | list)[(now() + timedelta(days= (page_index+1))).weekday()] ~ ', ' ~ as_timestamp(now() + timedelta(days= (page_index+1))) | timestamp_custom(date_format) }}"
message: "{{ (dict.values(mui[language].weekdays) | list)[(now() + timedelta(days= (page_index))).weekday()] ~ ', ' ~ as_timestamp(now() + timedelta(days= (page_index))) | timestamp_custom(date_format) }}"
- delay:
milliseconds: "{{ delay_value }}"
- choose:
### DEFAULT - WEATHER ###
- conditions: '{{ weather.type == "Default" }}'
##### fields 1 to 5 (Parameters) #####
- repeat:
for_each: "{{ (parameters | selectattr('visibility', 'eq', true) | list)[:5] }}"
sequence:
##### SET TEMP MIN ####
- service: "{{ command_text_printf }}"
data:
component: "{{ page_name }}.temp_min" ### Temperature MIN ###
message: '{{state_attr(weather.entity,"forecast")[page_index].templow | round(0)}}{{ weather.units.temperature }}'
- delay:
milliseconds: "{{ delay_value }}"
##### SET TEMP MAX ####
- service: "{{ command_text_printf }}"
data:
component: "{{ page_name }}.temp_max" ### Temperature MAX ###
message: '{{state_attr(weather.entity,"forecast")[page_index].temperature | round(0)}}{{ weather.units.temperature }}'
- delay:
milliseconds: "{{ delay_value }}"
##### field 1 #####
##### field 2 #####
- service: "{{ command_text_printf }}"
data:
component: "{{ page_name }}.value02"
message: '{{state_attr(weather.entity,"forecast")[page_index].precipitation | round(1)}} {{ weather.units.precipitation }}'
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: "{{ page_name }}.value02_icon"
message: "{{ nextion.icons.weather.rain }}"
- delay:
milliseconds: "{{ delay_value }}"
##### field 3 #####
- service: "{{ command_text_printf }}"
data:
component: "{{ page_name }}.value03"
message: '{{state_attr(weather.entity,"forecast")[page_index].wind_speed | round(1)}} {{ weather.units.wind_speed }}'
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: "{{ page_name }}.value03_icon"
message: "{{ nextion.icons.weather.wind }}"
- delay:
milliseconds: "{{ delay_value }}"
##### field 4 #####
##### field 5 #####
### ACCUWEATHER - WEATHER ###
- conditions: '{{ weather.type == "AccuWeather" }}'
sequence:
##### SET TEMP MIN ####
- service: "{{ command_text_printf }}"
data:
component: "{{ page_name }}.temp_min" ### Temperature MIN ###
message: '{{states(accuweather.forecast[accuweather_day_name].realfeel_temperature.min) | round(0)}}{{ weather.units.temperature }}'
- delay:
milliseconds: "{{ delay_value }}"
##### SET TEMP MAX ####
- service: "{{ command_text_printf }}"
data:
component: "{{ page_name }}.temp_max" ### Temperature MAX ###
message: '{{states(accuweather.forecast[accuweather_day_name].realfeel_temperature.max) | round(0)}}{{ weather.units.temperature }}'
- delay:
milliseconds: "{{ delay_value }}"
##### field 1 #####
- service: "{{ command_text_printf }}"
data:
component: "{{ page_name }}.value01"
message: "{{ state_attr(weather.entity,'forecast')[page_index+1].precipitation_probability}} {{ weather.units.precipitation }}"
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: "{{ page_name }}.value01_icon"
message: "{{ nextion.icons.weather.rain }}"
- delay:
milliseconds: "{{ delay_value }}"
##### field 2 #####
- service: "{{ command_text_printf }}"
data:
component: "{{ page_name }}.value02"
message: "{{states(accuweather.forecast[accuweather_day_name].hours_of_sun) | round(0)}} {{ weather.units.hours_of_sun }}"
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: "{{ page_name }}.value02_icon"
message: "{{ nextion.icons.weather.sun }}"
- delay:
milliseconds: "{{ delay_value }}"
##### field 3 #####
- service: "{{ command_text_printf }}"
data:
component: "{{ page_name }}.value03"
message: "{{state_attr(accuweather.forecast[accuweather_day_name].uv_index, 'level')}} {{states(accuweather.forecast[accuweather_day_name].uv_index) | round(0)}}"
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: "{{ page_name }}.value03_icon"
message: "{{ nextion.icons.weather.protect }}"
- delay:
milliseconds: "{{ delay_value }}"
##### field 4 #####
- service: "{{ command_text_printf }}"
data:
component: "{{ page_name }}.value04"
message: "{{states(accuweather.forecast[accuweather_day_name].thunderstorm_probability.day) | round(0)}} {{ weather.units.thunderstorm_probability }}"
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: "{{ page_name }}.value04_icon"
message: "{{ nextion.icons.weather.lightning }}"
- delay:
milliseconds: "{{ delay_value }}"
##### field 5 #####
- service: "{{ command_text_printf }}"
data:
component: "{{ page_name }}.value05"
message: "{{states(accuweather.forecast[accuweather_day_name].wind.day) | round(0)}} {{ weather.units.wind_speed }}"
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: "{{ page_name }}.value05_icon"
message: "{{ nextion.icons.weather.wind }}"
### DEFAULT ####
default:
- service: "{{ command_printf }}"
- service: "{{ command_text_printf }}"
data:
cmd: "page {{ page_home }}"
component: "{{ page_name }}.value0{{ repeat.index }}"
message: "{{ repeat.item.value }}"
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: "{{ page_name }}.value0{{ repeat.index }}_icon"
message: "{{ repeat.item.icon }}"
- delay:
milliseconds: "{{ delay_value }}"
## PAGE NOTIFICATION ##
- conditions: '{{ trigger.event.data.new_state.state == page_notification }}'