diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index 20e4423..f33cdc3 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -35,7 +35,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l 🎉 Roadmap Roadmap can be found here [Roadmap](https://github.com/Blackymas/NSPanel_HA_Blueprint/labels/roadmap) -ℹ️ Version: v.3.2.1 +ℹ️ Version: v.3.2.2 ' @@ -2354,14 +2354,9 @@ trigger_variables: notification_text: "sensor.{{ nspanel_name }}_notification_text" notification_label: "sensor.{{ nspanel_name }}_notification_label" - ##### WEATHER Trigger ##### - weather: !input "weather" - weather_entity: !input "weather_entity" - accuweather_name: '{{ weather_entity |replace("weather.","") }}' - variables: ##### GENERAL ##### - blueprint_version: "3.2.1" + blueprint_version: "3.2.2" language: !input "language" date_format: !input "date_format" time_format: !input "time_format" @@ -2371,6 +2366,52 @@ variables: notification_sound: "switch.{{ nspanel_name }}_notification_sound" confirmation_message: "switch.{{ nspanel_name }}_confirmation_message" + ##### Nextion dict #### + nextion: + icons: + weather: + lightning: "\U0000E592" #E592 + protect: "\U0000F05C" #F05C + rain: "\U0000E595" #E595 + sun: "\U0000E5A7" #E5A7 + wind: "\U0000E59C" #E59C + pics: + weather: + sunny: "{{ '2' if is_state('sun.sun', 'above_horizon') else '15'}}" #some weather providers returns 'sunny' for 'clear-night' + cloudy: "3" + rainy: "4" + pouring: "5" + snowy: "6" + hail: "7" + snowy_rainy: "7" + fog: "8" + windy: "9" + windy_variant: "9" + lightning: "10" + partlycloudy: "{{ '11' if is_state('sun.sun', 'above_horizon') else '12'}}" + lightning_rainy: "{{ '13' if is_state('sun.sun', 'above_horizon') else '14'}}" + execptional: "{{ '13' if is_state('sun.sun', 'above_horizon') else '14'}}" + clear_night: "15" + unknown: "" + unavailable: "" + + ##### WEATHER #### + weather_entity: !input "weather_entity" # used only during the creation of weather in variables + weather: + type: !input "weather" + 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 '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') }}" + ##### PUSH TO NEXTION DISPLAY ##### command_text_printf: "esphome.{{ nspanel_name }}_send_command_text_printf" command_value: "esphome.{{ nspanel_name }}_send_command_value" @@ -2383,6 +2424,7 @@ variables: command_play_rtttl: "esphome.{{ nspanel_name }}_play_rtttl" command_set_settings_entity: "esphome.{{ nspanel_name }}_set_settings_entity" command_show_all: "esphome.{{ nspanel_name }}_send_command_show_all" + command_set_button: "esphome.{{ nspanel_name }}_set_button" ###### SYNC SETTINGS ##### delay_boot: !input "delay" @@ -2397,8 +2439,6 @@ variables: tft_path: !input "tft_path" ##### GENERAL ENTITYS ##### - - hotwatertemp: !input "hotwatertemp" outdoortemp: !input "outdoortemp" indoortemp: !input "indoortemp" @@ -2453,28 +2493,6 @@ variables: # # flame_pic_off: "60" # top_menu_blank: "60" - - - - weather_sunny: "2" - weather_cloudy: "3" - weather_rainy: "4" - weather_pouring: "5" - weather_snowy: "6" - weather_hail: "7" - weather_snowy_rainy: "7" - weather_fog: "8" - weather_windy: "9" - weather_windy_variant: "9" - weather_lightning: "10" - weather_partlycloudy_day: "11" - weather_partlycloudy_night: "12" - weather_lightning_rainy_day: "13" - weather_lightning_rainy_night: "14" - weather_execptional_day: "13" - weather_execptional_night: "14" - weather_clear_night: "15" - hotw_bt_blank: "79" hotw_bt_off: "80" hotw_bt_on: "81" @@ -2512,13 +2530,6 @@ variables: button_icon_fan: "\U0000E20F" #E20F button_icon_climate: "\U0000E392" #E392 - ###### "Weather" NEXTION FONT ICON MAPPING ##### - weather_icon_rain: "\U0000E595" #E595 - weather_icon_sun: "\U0000E5A7" #E5A7 - weather_icon_protect: "\U0000F05C" #F05C - weather_icon_lightning: "\U0000E592" #E592 - weather_icon_wind: "\U0000E59C" #E59C - ##### CHANGE ME END ########################################################################################################## @@ -3016,11 +3027,12 @@ variables: fri: Петък sat: Събота sun: Неделя - today: Днес - tomorrow: Утре - in_2_days: за 2 дни - in_3_days: за 3 дни - in_4_days: за 4 дни + relative_day: + today: Днес + tomorrow: Утре + in_2_days: за 2 дни + in_3_days: за 3 дни + in_4_days: за 4 дни climate: states: "on": на @@ -3036,11 +3048,12 @@ variables: fri: Pátek sat: Sobota sun: Neděle - today: Dnes - tomorrow: Zítra - in_2_days: za 2 dny - in_3_days: za 3 dny - in_4_days: za 4 dny + relative_day: + today: Dnes + tomorrow: Zítra + in_2_days: za 2 dny + in_3_days: za 3 dny + in_4_days: za 4 dny climate: states: "on": zapnuto @@ -3056,11 +3069,12 @@ variables: fri: Freitag sat: Samstag sun: Sonntag - today: Heute - tomorrow: Morgen - in_2_days: in 2 Tagen - in_3_days: in 3 Tagen - in_4_days: in 4 Tagen + relative_day: + today: Heute + tomorrow: Morgen + in_2_days: in 2 Tagen + in_3_days: in 3 Tagen + in_4_days: in 4 Tagen climate: states: "on": ein @@ -3076,11 +3090,12 @@ variables: fri: Fredag sat: Lørdag sun: Søndag - today: I dag - tomorrow: I morgen - in_2_days: om 2 dage - in_3_days: om 3 dage - in_4_days: om 4 dage + relative_day: + today: I dag + tomorrow: I morgen + in_2_days: om 2 dage + in_3_days: om 3 dage + in_4_days: om 4 dage climate: states: "on": på @@ -3096,11 +3111,12 @@ variables: fri: Friday sat: Saturday sun: Sunday - today: Today - tomorrow: Tomorrow - in_2_days: In 2 days - in_3_days: In 3 days - in_4_days: In 4 days + relative_day: + today: Today + tomorrow: Tomorrow + in_2_days: In 2 days + in_3_days: In 3 days + in_4_days: In 4 days climate: states: "on": on @@ -3116,11 +3132,12 @@ variables: fri: Viernes sat: Sábado sun: Domingo - today: Hoy - tomorrow: Mañana - in_2_days: en 2 Días - in_3_days: en 3 Días - in_4_days: en 4 Días + relative_day: + today: Hoy + tomorrow: Mañana + in_2_days: en 2 Días + in_3_days: en 3 Días + in_4_days: en 4 Días climate: states: "on": on @@ -3136,11 +3153,12 @@ variables: fri: Reede sat: Laupäev sun: Pühapäev - today: Täna - tomorrow: Homme - in_2_days: 2 päeva pärast - in_3_days: 3 päeva pärast - in_4_days: 4 päeva pärast + relative_day: + today: Täna + tomorrow: Homme + in_2_days: 2 päeva pärast + in_3_days: 3 päeva pärast + in_4_days: 4 päeva pärast climate: states: "on": aadressil @@ -3156,11 +3174,12 @@ variables: fri: Perjantai sat: Lauantai sun: Sunnuntai - today: Tänään - tomorrow: Huomenna - in_2_days: 2 päivän päästä - in_3_days: 3 päivän päästä - in_4_days: 4 päivän päästä + relative_day: + today: Tänään + tomorrow: Huomenna + in_2_days: 2 päivän päästä + in_3_days: 3 päivän päästä + in_4_days: 4 päivän päästä climate: states: "on": osoitteessa @@ -3176,11 +3195,12 @@ variables: fri: Vendredi sat: Samedi sun: Dimanche - today: Aujourd hui - tomorrow: Demain - in_2_days: Dans 2 jours - in_3_days: Dans 3 jours - in_4_days: Dans 4 jours + relative_day: + today: Aujourd hui + tomorrow: Demain + in_2_days: Dans 2 jours + in_3_days: Dans 3 jours + in_4_days: Dans 4 jours climate: states: "on": on @@ -3196,11 +3216,12 @@ variables: fri: Παρασκευή sat: Σάββατο sun: Κυριακή - today: Σήμερα - tomorrow: Αύριο - in_2_days: σε 2 ημέρες - in_3_days: σε 3 ημέρες - in_4_days: σε 4 ημέρες + relative_day: + today: Σήμερα + tomorrow: Αύριο + in_2_days: σε 2 ημέρες + in_3_days: σε 3 ημέρες + in_4_days: σε 4 ημέρες climate: states: "on": Ενεργό @@ -3216,11 +3237,12 @@ variables: fri: ישיש sat: תבש sun: ןושאר - today: םויה - tomorrow: רחמ - in_2_days: םיימוי דוע - in_3_days: םימי 3 דוע - in_4_days: םימי 4 דוע + relative_day: + today: םויה + tomorrow: רחמ + in_2_days: םיימוי דוע + in_3_days: םימי 3 דוע + in_4_days: םימי 4 דוע climate: states: "on": קולד @@ -3236,11 +3258,12 @@ variables: fri: Péntek sat: Szombat sun: Vasárnap - today: Ma - tomorrow: Holnap - in_2_days: 2 nap múlva - in_3_days: 3 nap múlva - in_4_days: 4 nap múlva + relative_day: + today: Ma + tomorrow: Holnap + in_2_days: 2 nap múlva + in_3_days: 3 nap múlva + in_4_days: 4 nap múlva climate: states: "on": a oldalon @@ -3256,11 +3279,12 @@ variables: fri: Jumat sat: Sabtu sun: Minggu - today: Hari ini - tomorrow: Besok - in_2_days: dalam 2 Hari - in_3_days: dalam 3 Hari - in_4_days: dalam 4 Hari + relative_day: + today: Hari ini + tomorrow: Besok + in_2_days: dalam 2 Hari + in_3_days: dalam 3 Hari + in_4_days: dalam 4 Hari climate: states: "on": on @@ -3276,11 +3300,12 @@ variables: fri: Venerdì sat: Sabato sun: Domenica - today: Oggi - tomorrow: Domani - in_2_days: in 2 giorni - in_3_days: in 3 giorni - in_4_days: in 4 giorni + relative_day: + today: Oggi + tomorrow: Domani + in_2_days: in 2 giorni + in_3_days: in 3 giorni + in_4_days: in 4 giorni climate: states: "on": on @@ -3296,11 +3321,12 @@ variables: fri: Penktadienis sat: Šeštadienis sun: Sekmadienis - today: Šiandien - tomorrow: Rytoj - in_2_days: per 2 dienas - in_3_days: per 3 dienas - in_4_days: per 4 dienas + relative_day: + today: Šiandien + tomorrow: Rytoj + in_2_days: per 2 dienas + in_3_days: per 3 dienas + in_4_days: per 4 dienas climate: states: "on": svetainėje @@ -3316,11 +3342,12 @@ variables: fri: Piektdiena sat: Sestdiena sun: Svētdiena - today: Šodien - tomorrow: Rīt - in_2_days: pēc 2 dienām - in_3_days: pēc 3 dienām - in_4_days: pēc 4 dienām + relative_day: + today: Šodien + tomorrow: Rīt + in_2_days: pēc 2 dienām + in_3_days: pēc 3 dienām + in_4_days: pēc 4 dienām climate: states: "on": vietnē @@ -3336,11 +3363,12 @@ variables: fri: Vrijdag sat: Zaterdag sun: Zondag - today: Vandaag - tomorrow: Morgen - in_2_days: in 2 dagen - in_3_days: in 3 dagen - in_4_days: in 4 dagen + relative_day: + today: Vandaag + tomorrow: Morgen + in_2_days: in 2 dagen + in_3_days: in 3 dagen + in_4_days: in 4 dagen climate: states: "on": aan @@ -3356,11 +3384,12 @@ variables: fri: Fredag sat: Lørdag sun: Søndag - today: I dag - tomorrow: I morgen - in_2_days: om 2 dager - in_3_days: om 3 dager - in_4_days: om 4 dager + relative_day: + today: I dag + tomorrow: I morgen + in_2_days: om 2 dager + in_3_days: om 3 dager + in_4_days: om 4 dager climate: states: "on": på @@ -3376,11 +3405,12 @@ variables: fri: Piątek sat: Sobota sun: Niedziela - today: Dzisiaj - tomorrow: Jutro - in_2_days: za 2 dni - in_3_days: za 3 dni - in_4_days: za 4 dni + relative_day: + today: Dzisiaj + tomorrow: Jutro + in_2_days: za 2 dni + in_3_days: za 3 dni + in_4_days: za 4 dni climate: states: "on": na @@ -3396,11 +3426,12 @@ variables: fri: Sexta-feira sat: Sábado sun: Domingo - today: Hoje - tomorrow: Amanhã - in_2_days: Em 2 dias - in_3_days: Em 3 dias - in_4_days: Em 4 dias + relative_day: + today: Hoje + tomorrow: Amanhã + in_2_days: Em 2 dias + in_3_days: Em 3 dias + in_4_days: Em 4 dias climate: states: "on": ligado @@ -3416,11 +3447,12 @@ variables: fri: Vineri sat: Sâmbătă sun: Duminică - today: Astăzi - tomorrow: Mâine - in_2_days: în 2 zile - in_3_days: în 3 zile - in_4_days: în 4 zile + relative_day: + today: Astăzi + tomorrow: Mâine + in_2_days: în 2 zile + in_3_days: în 3 zile + in_4_days: în 4 zile climate: states: "on": pe @@ -3436,11 +3468,12 @@ variables: fri: Пятница sat: Суббота sun: Воскресение - today: Сегодня - tomorrow: Завтра - in_2_days: на 2 дня - in_3_days: на 3 дня - in_4_days: на 4 дня + relative_day: + today: Сегодня + tomorrow: Завтра + in_2_days: на 2 дня + in_3_days: на 3 дня + in_4_days: на 4 дня climate: states: "on": включено @@ -3456,11 +3489,12 @@ variables: fri: Piatok sat: Sobota sun: Nedeľa - today: Dnes - tomorrow: Zajtra - in_2_days: o 2 dni - in_3_days: o 3 dni - in_4_days: o 4 dni + relative_day: + today: Dnes + tomorrow: Zajtra + in_2_days: o 2 dni + in_3_days: o 3 dni + in_4_days: o 4 dni climate: states: "on": zapnuté @@ -3476,11 +3510,12 @@ variables: fri: Petek sat: Sobota sun: Nedelja - today: Danes - tomorrow: Jutri - in_2_days: v 2 dneh - in_3_days: v 3 dneh - in_4_days: v 4 dneh + relative_day: + today: Danes + tomorrow: Jutri + in_2_days: v 2 dneh + in_3_days: v 3 dneh + in_4_days: v 4 dneh climate: states: "on": na @@ -3496,11 +3531,12 @@ variables: fri: Fredag sat: Lördag sun: Söndag - today: Idag - tomorrow: Imorgon - in_2_days: om 2 dagar - in_3_days: om 3 dagar - in_4_days: om 4 dagar + relative_day: + today: Idag + tomorrow: Imorgon + in_2_days: om 2 dagar + in_3_days: om 3 dagar + in_4_days: om 4 dagar climate: states: "on": på @@ -3516,11 +3552,12 @@ variables: fri: Cuma sat: Cumartesi sun: Pazar - today: Bugün - tomorrow: Yarın - in_2_days: 2 Gün İçinde - in_3_days: 3 Gün İçinde - in_4_days: 4 Gün İçinde + relative_day: + today: Bugün + tomorrow: Yarın + in_2_days: 2 Gün İçinde + in_3_days: 3 Gün İçinde + in_4_days: 4 Gün İçinde climate: states: "on": üzerinde @@ -3536,11 +3573,12 @@ variables: fri: п ятниця sat: Субота sun: Неділя - today: Сьогодні - tomorrow: Завтра - in_2_days: через 2 дні - in_3_days: через 3 дні - in_4_days: через 2 дні + relative_day: + today: Сьогодні + tomorrow: Завтра + in_2_days: через 2 дні + in_3_days: через 3 дні + in_4_days: через 2 дні climate: states: "on": увімк @@ -3555,53 +3593,6 @@ variables: mui_weekday_in_4_days: "{{ (dict.values(mui[language].weekdays) | list)[(now() + timedelta(days=4)).weekday()] ~ ', ' ~ as_timestamp(now() + timedelta(days=4)) | timestamp_custom(date_format) }}" #heat_mui: "{{ mui[language].climate.heat }}" - ##### FORCAST ACCUWEATHER - DAY 0 ##### - accuweather_realfeel_temperature_min_0d: "sensor.{{ accuweather_name }}_realfeel_temperature_min_0d" - accuweather_realfeel_temperature_max_0d: "sensor.{{ accuweather_name }}_realfeel_temperature_max_0d" - accuweather_hours_of_sun_0d: "sensor.{{ accuweather_name }}_hours_of_sun_0d" - accuweather_uv_index_0d: "sensor.{{ accuweather_name }}_uv_index_0d" - accuweather_thunderstorm_probability_day_0d: "sensor.{{ accuweather_name }}_thunderstorm_probability_day_0d" - accuweather_thunderstorm_probability_night_0d: "sensor.{{ accuweather_name }}_thunderstorm_probability_night_0d" - accuweather_wind_day_0d: "sensor.{{ accuweather_name }}_wind_day_0d" - accuweather_wind_night_0d: "sensor.{{ accuweather_name }}_wind_night_0d" - ##### FORCAST ACCUWEATHER - DAY 1 ##### - accuweather_realfeel_temperature_min_1d: "sensor.{{ accuweather_name }}_realfeel_temperature_min_1d" - accuweather_realfeel_temperature_max_1d: "sensor.{{ accuweather_name }}_realfeel_temperature_max_1d" - accuweather_hours_of_sun_1d: "sensor.{{ accuweather_name }}_hours_of_sun_1d" - accuweather_uv_index_1d: "sensor.{{ accuweather_name }}_uv_index_1d" - accuweather_thunderstorm_probability_day_1d: "sensor.{{ accuweather_name }}_thunderstorm_probability_day_1d" - accuweather_thunderstorm_probability_night_1d: "sensor.{{ accuweather_name }}_thunderstorm_probability_night_1d" - accuweather_wind_day_1d: "sensor.{{ accuweather_name }}_wind_day_1d" - accuweather_wind_night_1d: "sensor.{{ accuweather_name }}_wind_night_1d" - ##### FORCAST ACCUWEATHER - DAY 2 ##### - accuweather_realfeel_temperature_min_2d: "sensor.{{ accuweather_name }}_realfeel_temperature_min_2d" - accuweather_realfeel_temperature_max_2d: "sensor.{{ accuweather_name }}_realfeel_temperature_max_2d" - accuweather_hours_of_sun_2d: "sensor.{{ accuweather_name }}_hours_of_sun_2d" - accuweather_uv_index_2d: "sensor.{{ accuweather_name }}_uv_index_2d" - accuweather_thunderstorm_probability_day_2d: "sensor.{{ accuweather_name }}_thunderstorm_probability_day_2d" - accuweather_thunderstorm_probability_night_2d: "sensor.{{ accuweather_name }}_thunderstorm_probability_night_2d" - accuweather_wind_day_2d: "sensor.{{ accuweather_name }}_wind_day_2d" - accuweather_wind_night_2d: "sensor.{{ accuweather_name }}_wind_night_2d" - ##### FORCAST ACCUWEATHER - DAY 3 ##### - accuweather_realfeel_temperature_min_3d: "sensor.{{ accuweather_name }}_realfeel_temperature_min_3d" - accuweather_realfeel_temperature_max_3d: "sensor.{{ accuweather_name }}_realfeel_temperature_max_3d" - accuweather_hours_of_sun_3d: "sensor.{{ accuweather_name }}_hours_of_sun_3d" - accuweather_uv_index_3d: "sensor.{{ accuweather_name }}_uv_index_3d" - accuweather_thunderstorm_probability_day_3d: "sensor.{{ accuweather_name }}_thunderstorm_probability_day_3d" - accuweather_thunderstorm_probability_night_3d: "sensor.{{ accuweather_name }}_thunderstorm_probability_night_3d" - accuweather_wind_day_3d: "sensor.{{ accuweather_name }}_wind_day_3d" - accuweather_wind_night_3d: "sensor.{{ accuweather_name }}_wind_night_3d" - ##### FORCAST ACCUWEATHER - DAY 4 ##### - accuweather_realfeel_temperature_min_4d: "sensor.{{ accuweather_name }}_realfeel_temperature_min_4d" - accuweather_realfeel_temperature_max_4d: "sensor.{{ accuweather_name }}_realfeel_temperature_max_4d" - accuweather_hours_of_sun_4d: "sensor.{{ accuweather_name }}_hours_of_sun_4d" - accuweather_uv_index_4d: "sensor.{{ accuweather_name }}_uv_index_4d" - accuweather_thunderstorm_probability_day_4d: "sensor.{{ accuweather_name }}_thunderstorm_probability_day_4d" - accuweather_thunderstorm_probability_night_4d: "sensor.{{ accuweather_name }}_thunderstorm_probability_night_4d" - accuweather_wind_day_4d: "sensor.{{ accuweather_name }}_wind_day_4d" - accuweather_wind_night_4d: "sensor.{{ accuweather_name }}_wind_night_4d" - - ############################################################# ##### CLOSE - Variables ##### @@ -3658,7 +3649,7 @@ trigger: - platform: event event_type: state_changed event_data: - entity_id: '{{ weather_entity }}' + entity_id: !input "weather_entity" id: weather_state_change ##### HOME Value 01 - Trigger "home_value01_state" ##### @@ -4113,7 +4104,8 @@ action: ######################################################################################################################## # main - alias: "choose alias (name)" - - choose: + - alias: Main choices + choose: ##### JUMP TO - settings page lightsettings /coversettings / climate (SETTINGS ENTITY CHANGED) ##### - conditions: @@ -4202,30 +4194,21 @@ action: cmd: page home ##### PAGE CHANGED - changes when page changed ##### - - conditions: + - alias: Page changed + conditions: - condition: trigger id: current_page_changed sequence: ##### climate-page left - apply climate temperature if climate_optimistic ##### ## TODO - remove from here - if: - condition: template - value_template: '{{ trigger.event.data.old_state.state == page_climate }}' + value_template: '{{ trigger.event.data.old_state.state == page_climate and climate_optimistic and is_number(states(display_target_temperature)) and states(display_target_temperature) | float(0) != 0.0 }}' then: - - if: - - condition: template - value_template: '{{ climate_optimistic == true }}' - then: - - variables: - display_target_temperature: "{{states(display_target_temperature) | round(1)}}" - - if: - - condition: template - value_template: '{{ display_target_temperature != 0.0 }}' - then: - - service: climate.set_temperature - data: - entity_id: '{{ entity_long }}' - #hvac_mode: 'heat' - temperature: "{{ display_target_temperature }}" + - service: climate.set_temperature + data: + entity_id: '{{ entity_long }}' + #hvac_mode: 'heat' + temperature: "{{ states(display_target_temperature) | round(1) }}" - choose: ## PAGE HOME ## - conditions: '{{ trigger.event.data.new_state.state == page_home }}' @@ -4283,9 +4266,8 @@ action: ##### NSPanel Outdoor Temp ##### - variables: outdoor_temp: >- - {%- if outdoortemp is match "sensor." and states(outdoortemp).state != "unavailable" -%} {{ states(outdoortemp) |round(1) }} - {%- elif state_attr(weather_entity, "temperature") != None -%} {{state_attr(weather_entity,"temperature") | round(1)}} - {%- else -%} 0 + {%- 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 ### - delay: @@ -4300,14 +4282,9 @@ action: - service: "{{ command_text_printf }}" data: component: home.outdoor_temp - message: "{{ outdoor_temp }}°" + message: '{{ outdoor_temp }}{{ weather.units.temperature }}' ##### NSPanel Indoor Temp ##### - - variables: - indoor_temp: >- - {%- if indoortemp is match "sensor." and states(indoortemp).state != "unavailable" -%} {{ states(indoortemp) |round(1) }} - {%- else -%} {{ states(nspaneltemp) |round(1) }} - {%- endif -%} ### ICON Indoor Temp Font Color ### - delay: milliseconds: "{{ delay_value }}" @@ -4335,36 +4312,14 @@ action: - service: "{{ command_text_printf }}" data: component: home.current_temp - message: "{{ indoor_temp }}°" + message: "{{ states(indoortemp) | round(1) if indoortemp is match 'sensor.' and states(indoortemp) not in ['unavailable', 'unknown', 'none'] else states(nspaneltemp) | round(1) }}{{ weather.units.temperature }}" ##### Weather Icon Home Page ##### - - variables: - weather_pic: >- - {%- if states(weather_entity) == 'sunny' -%} {{ weather_sunny }} - {%- elif states(weather_entity) == 'cloudy' -%} {{ weather_cloudy }} - {%- elif states(weather_entity) == 'rainy' -%} {{ weather_rainy }} - {%- elif states(weather_entity) == 'pouring' -%} {{ weather_pouring }} - {%- elif states(weather_entity) == 'snowy' -%} {{ weather_snowy }} - {%- elif states(weather_entity) == 'hail' -%} {{ weather_hail }} - {%- elif states(weather_entity) == 'snowy-rainy' -%} {{ weather_snowy_rainy }} - {%- elif states(weather_entity) == 'fog' -%} {{ weather_fog }} - {%- elif states(weather_entity) == 'windy' -%} {{ weather_windy }} - {%- elif states(weather_entity) == 'windy-variant' -%} {{ weather_windy-variant }} - {%- elif states(weather_entity) == 'lightning' -%} {{ weather_lightning }} - {%- elif states(weather_entity) == 'partlycloudy' and states('sun.sun') == 'above_horizon' -%} {{ weather_partlycloudy_day }} - {%- elif states(weather_entity) == 'partlycloudy' and states('sun.sun') == 'below_horizon' -%} {{ weather_partlycloudy_night }} - {%- elif states(weather_entity) == 'lightning-rainy' and states('sun.sun') == 'above_horizon' -%} {{ weather_lightning_rainy_day }} - {%- elif states(weather_entity) == 'lightning-rainy' and states('sun.sun') == 'below_horizon' -%} {{ weather_lightning_rainy_night }} - {%- elif states(weather_entity) == 'execptional' and states('sun.sun') == 'above_horizon' -%} {{ weather_execptional_day }} - {%- elif states(weather_entity) == 'execptional' and states('sun.sun') == 'below_horizon' -%} {{ weather_execptional_night }} - {%- elif states(weather_entity) == 'clear-night' -%} {{ weather_clear_night }} - {%- endif -%} - - delay: milliseconds: "{{ delay_value }}" - service: "{{ command_printf }}" data: - cmd: home.weather.pic={{ weather_pic }} + cmd: home.weather.pic={{ nextion.pics.weather[states(weather_entity) | default('unknown')] }} ##### NSPanel Left Button Name ##### - if: @@ -4857,7 +4812,7 @@ action: {%- elif repeat.item.entity is match "automation." -%} {{ button_icon_automation }} {%- elif repeat.item.entity is match "button." -%} {{ button_icon_button }} {%- elif repeat.item.entity is match "input_button." -%} {{ button_icon_input_button }} - {%- elif repeat.item.entity is match "scene." -%} {{ button_icon_screne }} + {%- elif repeat.item.entity is match "scene." -%} {{ button_icon_scene }} {%- elif repeat.item.entity is match "script." -%} {{ button_icon_script }} {%- elif repeat.item.entity is match "person." -%} {{ button_icon_person }} {%- elif repeat.item.entity is match "binary_sensor." -%} {{ button_icon_binary_sensor }} @@ -4871,95 +4826,23 @@ action: {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} 0 {%- elif repeat.item.entity is match "light." and current_entity_state == 'on' and state_attr(repeat.item.entity, "brightness") != None -%} {{ (state_attr(repeat.item.entity, "brightness") | int * 100 /255) | round(0) }}% {%- elif repeat.item.entity is match "cover." and current_entity_state == 'open' and state_attr(repeat.item.entity, "current_position") != None -%} {{ (state_attr(repeat.item.entity, "current_position") | int(100)) | round(0) }}% - {%- elif repeat.item.entity is match "climate." and current_entity_state != 'off' and state_attr(repeat.item.entity, "current_temperature") != None -%} {{ (state_attr(repeat.item.entity, "current_temperature") | int) | round(0) }}° + {%- elif repeat.item.entity is match "climate." and current_entity_state != 'off' and state_attr(repeat.item.entity, "current_temperature") != None -%} {{ (state_attr(repeat.item.entity, "current_temperature") | int) | round(0) }}{{ weather.units.temperature }} {%- else -%} 0 {%- endif -%} - ##### SET Buttons Background #### - # - ##### SET Button PIC ##### - - service: "{{ command_printf }}" + ##### Set buttton ##### + - service: "{{ command_set_button }}" data: - cmd: "{{ repeat.item.button }}pic.pic={{ btn_pic }}" - ##### SET ICON Background ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_background_color }}" - data: - component: "{{ repeat.item.button }}icon" - message: "{{ btn_bg }}" - ##### SET LABEL Background ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_background_color }}" - data: - component: "{{ repeat.item.button }}text" - message: "{{ btn_bg }}" - ##### SET BRIGHTNESS Background Color ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_background_color }}" - data: - component: "{{ repeat.item.button }}bri" - message: "{{ btn_bg }}" + btn_id: "{{ repeat.item.button }}" + btn_pic: "{{ btn_pic }}" + btn_bg: "{{ btn_bg }}" + btn_icon_font: "{{ btn_icon_font }}" + btn_txt_font: "{{ btn_txt_font }}" + btn_bri_font: "{{ btn_bri_font }}" + btn_icon: "{{ btn_icon }}" + btn_label: "{{ btn_label }}" + btn_bri_txt: "{{ btn_bri_txt }}" - ##### SET Buttons Font Color #### - # - ##### SET ICON Font Color ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_font_color }}" - data: - component: "{{ repeat.item.button }}icon" - message: "{{ btn_icon_font }}" - ##### SET LABEL Font Color ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_font_color }}" - data: - component: "{{ repeat.item.button }}text" - message: "{{ btn_txt_font }}" - ##### SET BRIGHTNESS Font Color ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_font_color }}" - data: - component: "{{ repeat.item.button }}bri" - message: "{{ btn_bri_font }}" - - ##### SET Buttons Text Value #### - # - ##### "ICON" Value ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: "{{ repeat.item.button }}icon" - message: "{{ btn_icon }}" - ##### "LABEL" Value ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: "{{ repeat.item.button }}text" - message: "{{ btn_label }}" - - ##### "BRIGHTNESS" Value ##### - - delay: - milliseconds: "{{ delay_value }}" - - if: - - condition: template - value_template: "{{ btn_bri_txt == 0 }}" - then: - - service: "{{ command_text_printf }}" - data: - component: "{{ repeat.item.button }}bri" - message: " " - else: - - service: "{{ command_text_printf }}" - data: - component: "{{ repeat.item.button }}bri" - message: "{{ btn_bri_txt }}" ###### SHOW All component when page loading done ##### - delay: milliseconds: "{{ delay_value }}" @@ -5108,7 +4991,7 @@ action: {%- elif repeat.item.entity is match "automation." -%} {{ button_icon_automation }} {%- elif repeat.item.entity is match "button." -%} {{ button_icon_button }} {%- elif repeat.item.entity is match "input_button." -%} {{ button_icon_input_button }} - {%- elif repeat.item.entity is match "scene." -%} {{ button_icon_screne }} + {%- elif repeat.item.entity is match "scene." -%} {{ button_icon_scene }} {%- elif repeat.item.entity is match "script." -%} {{ button_icon_script }} {%- elif repeat.item.entity is match "person." -%} {{ button_icon_person }} {%- elif repeat.item.entity is match "binary_sensor." -%} {{ button_icon_binary_sensor }} @@ -5122,95 +5005,23 @@ action: {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} 0 {%- elif repeat.item.entity is match "light." and current_entity_state == 'on' and state_attr(repeat.item.entity, "brightness") != None -%} {{ (state_attr(repeat.item.entity, "brightness") | int * 100 /255) | round(0) }}% {%- elif repeat.item.entity is match "cover." and current_entity_state == 'open' and state_attr(repeat.item.entity, "current_position") != None -%} {{ (state_attr(repeat.item.entity, "current_position") | int(100)) | round(0) }}% - {%- elif repeat.item.entity is match "climate." and current_entity_state != 'off' and state_attr(repeat.item.entity, "current_temperature") != None -%} {{ (state_attr(repeat.item.entity, "current_temperature") | int) | round(0) }}° + {%- elif repeat.item.entity is match "climate." and current_entity_state != 'off' and state_attr(repeat.item.entity, "current_temperature") != None -%} {{ (state_attr(repeat.item.entity, "current_temperature") | int) | round(0) }}{{ weather.units.temperature }} {%- else -%} 0 {%- endif -%} - ##### SET Buttons Background #### - # - ##### SET Button PIC ##### - - service: "{{ command_printf }}" + ##### Set buttton ##### + - service: "{{ command_set_button }}" data: - cmd: "{{ repeat.item.button }}pic.pic={{ btn_pic }}" - ##### SET ICON Background ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_background_color }}" - data: - component: "{{ repeat.item.button }}icon" - message: "{{ btn_bg }}" - ##### SET LABEL Background ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_background_color }}" - data: - component: "{{ repeat.item.button }}text" - message: "{{ btn_bg }}" - ##### SET BRIGHTNESS Background Color ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_background_color }}" - data: - component: "{{ repeat.item.button }}bri" - message: "{{ btn_bg }}" + btn_id: "{{ repeat.item.button }}" + btn_pic: "{{ btn_pic }}" + btn_bg: "{{ btn_bg }}" + btn_icon_font: "{{ btn_icon_font }}" + btn_txt_font: "{{ btn_txt_font }}" + btn_bri_font: "{{ btn_bri_font }}" + btn_icon: "{{ btn_icon }}" + btn_label: "{{ btn_label }}" + btn_bri_txt: "{{ btn_bri_txt }}" - ##### SET Buttons Font Color #### - # - ##### SET ICON Font Color ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_font_color }}" - data: - component: "{{ repeat.item.button }}icon" - message: "{{ btn_icon_font }}" - ##### SET LABEL Font Color ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_font_color }}" - data: - component: "{{ repeat.item.button }}text" - message: "{{ btn_txt_font }}" - ##### SET BRIGHTNESS Font Color ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_font_color }}" - data: - component: "{{ repeat.item.button }}bri" - message: "{{ btn_bri_font }}" - - ##### SET Buttons Text Value #### - # - ##### "ICON" Value ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: "{{ repeat.item.button }}icon" - message: "{{ btn_icon }}" - ##### "LABEL" Value ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: "{{ repeat.item.button }}text" - message: "{{ btn_label }}" - - ##### "BRIGHTNESS" Value ##### - - delay: - milliseconds: "{{ delay_value }}" - - if: - - condition: template - value_template: "{{ btn_bri_txt == 0 }}" - then: - - service: "{{ command_text_printf }}" - data: - component: "{{ repeat.item.button }}bri" - message: " " - else: - - service: "{{ command_text_printf }}" - data: - component: "{{ repeat.item.button }}bri" - message: "{{ btn_bri_txt }}" ###### SHOW All component when page loading done ##### - delay: milliseconds: "{{ delay_value }}" @@ -5359,7 +5170,7 @@ action: {%- elif repeat.item.entity is match "automation." -%} {{ button_icon_automation }} {%- elif repeat.item.entity is match "button." -%} {{ button_icon_button }} {%- elif repeat.item.entity is match "input_button." -%} {{ button_icon_input_button }} - {%- elif repeat.item.entity is match "scene." -%} {{ button_icon_screne }} + {%- elif repeat.item.entity is match "scene." -%} {{ button_icon_scene }} {%- elif repeat.item.entity is match "script." -%} {{ button_icon_script }} {%- elif repeat.item.entity is match "person." -%} {{ button_icon_person }} {%- elif repeat.item.entity is match "binary_sensor." -%} {{ button_icon_binary_sensor }} @@ -5373,95 +5184,23 @@ action: {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} 0 {%- elif repeat.item.entity is match "light." and current_entity_state == 'on' and state_attr(repeat.item.entity, "brightness") != None -%} {{ (state_attr(repeat.item.entity, "brightness") | int * 100 /255) | round(0) }}% {%- elif repeat.item.entity is match "cover." and current_entity_state == 'open' and state_attr(repeat.item.entity, "current_position") != None -%} {{ (state_attr(repeat.item.entity, "current_position") | int(100)) | round(0) }}% - {%- elif repeat.item.entity is match "climate." and current_entity_state != 'off' and state_attr(repeat.item.entity, "current_temperature") != None -%} {{ (state_attr(repeat.item.entity, "current_temperature") | int) | round(0) }}° + {%- elif repeat.item.entity is match "climate." and current_entity_state != 'off' and state_attr(repeat.item.entity, "current_temperature") != None -%} {{ (state_attr(repeat.item.entity, "current_temperature") | int) | round(0) }}{{ weather.units.temperature }} {%- else -%} 0 {%- endif -%} - ##### SET Buttons Background #### - # - ##### SET Button PIC ##### - - service: "{{ command_printf }}" + ##### Set buttton ##### + - service: "{{ command_set_button }}" data: - cmd: "{{ repeat.item.button }}pic.pic={{ btn_pic }}" - ##### SET ICON Background ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_background_color }}" - data: - component: "{{ repeat.item.button }}icon" - message: "{{ btn_bg }}" - ##### SET LABEL Background ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_background_color }}" - data: - component: "{{ repeat.item.button }}text" - message: "{{ btn_bg }}" - ##### SET BRIGHTNESS Background Color ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_background_color }}" - data: - component: "{{ repeat.item.button }}bri" - message: "{{ btn_bg }}" + btn_id: "{{ repeat.item.button }}" + btn_pic: "{{ btn_pic }}" + btn_bg: "{{ btn_bg }}" + btn_icon_font: "{{ btn_icon_font }}" + btn_txt_font: "{{ btn_txt_font }}" + btn_bri_font: "{{ btn_bri_font }}" + btn_icon: "{{ btn_icon }}" + btn_label: "{{ btn_label }}" + btn_bri_txt: "{{ btn_bri_txt }}" - ##### SET Buttons Font Color #### - # - ##### SET ICON Font Color ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_font_color }}" - data: - component: "{{ repeat.item.button }}icon" - message: "{{ btn_icon_font }}" - ##### SET LABEL Font Color ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_font_color }}" - data: - component: "{{ repeat.item.button }}text" - message: "{{ btn_txt_font }}" - ##### SET BRIGHTNESS Font Color ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_font_color }}" - data: - component: "{{ repeat.item.button }}bri" - message: "{{ btn_bri_font }}" - - ##### SET Buttons Text Value #### - # - ##### "ICON" Value ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: "{{ repeat.item.button }}icon" - message: "{{ btn_icon }}" - ##### "LABEL" Value ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: "{{ repeat.item.button }}text" - message: "{{ btn_label }}" - - ##### "BRIGHTNESS" Value ##### - - delay: - milliseconds: "{{ delay_value }}" - - if: - - condition: template - value_template: "{{ btn_bri_txt == 0 }}" - then: - - service: "{{ command_text_printf }}" - data: - component: "{{ repeat.item.button }}bri" - message: " " - else: - - service: "{{ command_text_printf }}" - data: - component: "{{ repeat.item.button }}bri" - message: "{{ btn_bri_txt }}" ###### SHOW All component when page loading done ##### - delay: milliseconds: "{{ delay_value }}" @@ -5610,7 +5349,7 @@ action: {%- elif repeat.item.entity is match "automation." -%} {{ button_icon_automation }} {%- elif repeat.item.entity is match "button." -%} {{ button_icon_button }} {%- elif repeat.item.entity is match "input_button." -%} {{ button_icon_input_button }} - {%- elif repeat.item.entity is match "scene." -%} {{ button_icon_screne }} + {%- elif repeat.item.entity is match "scene." -%} {{ button_icon_scene }} {%- elif repeat.item.entity is match "script." -%} {{ button_icon_script }} {%- elif repeat.item.entity is match "person." -%} {{ button_icon_person }} {%- elif repeat.item.entity is match "binary_sensor." -%} {{ button_icon_binary_sensor }} @@ -5624,95 +5363,23 @@ action: {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} 0 {%- elif repeat.item.entity is match "light." and current_entity_state == 'on' and state_attr(repeat.item.entity, "brightness") != None -%} {{ (state_attr(repeat.item.entity, "brightness") | int * 100 /255) | round(0) }}% {%- elif repeat.item.entity is match "cover." and current_entity_state == 'open' and state_attr(repeat.item.entity, "current_position") != None -%} {{ (state_attr(repeat.item.entity, "current_position") | int(100)) | round(0) }}% - {%- elif repeat.item.entity is match "climate." and current_entity_state != 'off' and state_attr(repeat.item.entity, "current_temperature") != None -%} {{ (state_attr(repeat.item.entity, "current_temperature") | int) | round(0) }}° + {%- elif repeat.item.entity is match "climate." and current_entity_state != 'off' and state_attr(repeat.item.entity, "current_temperature") != None -%} {{ (state_attr(repeat.item.entity, "current_temperature") | int) | round(0) }}{{ weather.units.temperature }} {%- else -%} 0 {%- endif -%} - ##### SET Buttons Background #### - # - ##### SET Button PIC ##### - - service: "{{ command_printf }}" + ##### Set buttton ##### + - service: "{{ command_set_button }}" data: - cmd: "{{ repeat.item.button }}pic.pic={{ btn_pic }}" - ##### SET ICON Background ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_background_color }}" - data: - component: "{{ repeat.item.button }}icon" - message: "{{ btn_bg }}" - ##### SET LABEL Background ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_background_color }}" - data: - component: "{{ repeat.item.button }}text" - message: "{{ btn_bg }}" - ##### SET BRIGHTNESS Background Color ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_background_color }}" - data: - component: "{{ repeat.item.button }}bri" - message: "{{ btn_bg }}" + btn_id: "{{ repeat.item.button }}" + btn_pic: "{{ btn_pic }}" + btn_bg: "{{ btn_bg }}" + btn_icon_font: "{{ btn_icon_font }}" + btn_txt_font: "{{ btn_txt_font }}" + btn_bri_font: "{{ btn_bri_font }}" + btn_icon: "{{ btn_icon }}" + btn_label: "{{ btn_label }}" + btn_bri_txt: "{{ btn_bri_txt }}" - ##### SET Buttons Font Color #### - # - ##### SET ICON Font Color ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_font_color }}" - data: - component: "{{ repeat.item.button }}icon" - message: "{{ btn_icon_font }}" - ##### SET LABEL Font Color ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_font_color }}" - data: - component: "{{ repeat.item.button }}text" - message: "{{ btn_txt_font }}" - ##### SET BRIGHTNESS Font Color ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_font_color }}" - data: - component: "{{ repeat.item.button }}bri" - message: "{{ btn_bri_font }}" - - ##### SET Buttons Text Value #### - # - ##### "ICON" Value ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: "{{ repeat.item.button }}icon" - message: "{{ btn_icon }}" - ##### "LABEL" Value ##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: "{{ repeat.item.button }}text" - message: "{{ btn_label }}" - - ##### "BRIGHTNESS" Value ##### - - delay: - milliseconds: "{{ delay_value }}" - - if: - - condition: template - value_template: "{{ btn_bri_txt == 0 }}" - then: - - service: "{{ command_text_printf }}" - data: - component: "{{ repeat.item.button }}bri" - message: " " - else: - - service: "{{ command_text_printf }}" - data: - component: "{{ repeat.item.button }}bri" - message: "{{ btn_bri_txt }}" ###### SHOW All component when page loading done ##### - delay: milliseconds: "{{ delay_value }}" @@ -6229,17 +5896,20 @@ action: {%- endif -%} ## PAGE CLIMATE ## - - conditions: '{{ trigger.event.data.new_state.state == page_climate }}' - alias: 'climate page' + - alias: 'climate page' + conditions: '{{ trigger.event.data.new_state.state == page_climate }}' sequence: - variables: hvac_mode: "{{ states(entity_long) }}" outdoor_temp: >- - {%- if outdoortemp is match "sensor." and states(outdoortemp).state != "unavailable" -%} {{ states(outdoortemp) |round(0) }} - {%- elif state_attr(weather_entity, "temperature") != None -%} {{state_attr(weather_entity,"temperature") | round(0)}} - {%- else -%} 0 + {%- if outdoortemp is match "sensor." + and states(outdoortemp) != "unavailable" + and states(outdoortemp).state is defined + and is_number(states(outdoortemp).state) -%} + {{ states(outdoortemp) | round(1) }} + {%- else -%} {{state_attr(weather.entity,"temperature") | round(1) if is_number(state_attr(weather.entity, "temperature")) else 0 }} {%- endif -%} - heating_state: "{{ mui[language].climate.states.off if hvac_mode == 'off' else mui[language].climate.states.on }}" + heating_state: "{{ mui[language].climate.states.off if hvac_mode == 'off' else mui[language].climate.states.on }}" - service: "{{ command_text_printf }}" data: component: climate.climate_label @@ -6249,20 +5919,20 @@ action: - service: "{{ command_text_printf }}" data: component: outdoor_temp - message: "{{ outdoor_temp }}°" + message: "{{ outdoor_temp ~ weather.units.temperature }}" - service: "{{ command_text_printf }}" data: component: current_temp - message: "{{state_attr(entity_long, 'current_temperature') | round(1)}}°" + message: "{{ (state_attr(entity_long, 'current_temperature') | round(1) ~ weather.units.temperature) if is_number(state_attr(entity_long, 'current_temperature')) }}" - if: condition: template - value_template: '{{ hvac_mode != "off" }}' + value_template: '{{ hvac_mode != "off" and is_number(state_attr(entity_long, "temperature")) }}' then: - variables: target_temp: "{{state_attr(entity_long, 'temperature') | round(1)}}" - service: "{{ command_thermostat_cycle }}" data: - value: "{{target_temp}}" + value: "{{ target_temp }}" else: - service: "{{ command_thermostat_cycle }}" data: @@ -6271,11 +5941,10 @@ action: data: component: target_temp message: " " - - service: "{{ command_text_printf }}" data: component: heating_state - message: "{{heating_state}}" + message: "{{ heating_state }}" # HVAC Button PIC - variables: @@ -6305,1248 +5974,143 @@ action: - service: "{{ command_text_printf }}" data: component: climate.hotwater_temp - message: "{{ states(hotwatertemp) |round(1) }}°" + message: "{{ (states(hotwatertemp) | round(1) ~ weather.units.temperature) if is_number(states(hotwatertemp)) }}" - ## PAGE WEATHE01 ## - - conditions: '{{ trigger.event.data.new_state.state == page_weather01 }}' - alias: 'weather01 page' + ## 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: - - choose: - ### DEFAULT - WEATHER ### - - conditions: '{{ weather == "Default" }}' + - variables: + page_name: "{{ trigger.event.data.new_state.state }}" + 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[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 }}" + + - 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 }}.temp_max" ### Temperature MAX ### + message: '{{temp_max | round(0)}}{{ weather.units.temperature }}' + - delay: + milliseconds: "{{ delay_value }}" + + ##### Day Name ##### + - service: "{{ command_text_printf }}" + data: + component: "{{ page_name }}.day" + message: "{{ (dict.values(mui[language].relative_day) | list)[page_index] }}" + - delay: + milliseconds: "{{ delay_value }}" + + ##### Day Date ##### + - service: "{{ command_text_printf }}" + data: + component: "{{ page_name }}.date" + 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 }}" + + ##### fields 1 to 5 (Parameters) ##### + - repeat: + for_each: "{{ (parameters | selectattr('visibility', 'eq', true) | list)[:5] }}" sequence: - - variables: - # weather PIC - weather_icon: >- - {%- if states(weather_entity) == 'sunny' -%} {{ weather_sunny }} - {%- elif states(weather_entity) == 'cloudy' -%} {{ weather_cloudy }} - {%- elif states(weather_entity) == 'rainy' -%} {{ weather_rainy }} - {%- elif states(weather_entity) == 'pouring' -%} {{ weather_pouring }} - {%- elif states(weather_entity) == 'snowy' -%} {{ weather_snowy }} - {%- elif states(weather_entity) == 'hail' -%} {{ weather_hail }} - {%- elif states(weather_entity) == 'snowy-rainy' -%} {{ weather_snowy_rainy }} - {%- elif states(weather_entity) == 'fog' -%} {{ weather_fog }} - {%- elif states(weather_entity) == 'windy' -%} {{ weather_windy }} - {%- elif states(weather_entity) == 'windy-variant' -%} {{ weather_windy-variant }} - {%- elif states(weather_entity) == 'lightning' -%} {{ weather_lightning }} - {%- elif states(weather_entity) == 'partlycloudy' and states('sun.sun') == 'above_horizon' -%} {{ weather_partlycloudy_day }} - {%- elif states(weather_entity) == 'partlycloudy' and states('sun.sun') == 'below_horizon' -%} {{ weather_partlycloudy_night }} - {%- elif states(weather_entity) == 'lightning-rainy' and states('sun.sun') == 'above_horizon' -%} {{ weather_lightning_rainy_day }} - {%- elif states(weather_entity) == 'lightning-rainy' and states('sun.sun') == 'below_horizon' -%} {{ weather_lightning_rainy_night }} - {%- elif states(weather_entity) == 'execptional' and states('sun.sun') == 'above_horizon' -%} {{ weather_execptional_day }} - {%- elif states(weather_entity) == 'execptional' and states('sun.sun') == 'below_horizon' -%} {{ weather_execptional_night }} - {%- elif states(weather_entity) == 'clear-night' -%} {{ weather_clear_night }} - {%- endif -%} - - ##### SET weather PIC on Home Page #### - - service: "{{ command_printf }}" - data: - cmd: weather01.weather_icon.pic={{ weather_icon }} - - 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)}}°' - - delay: - milliseconds: "{{ delay_value }}" - - ##### Day Name ##### - - service: "{{ command_text_printf }}" - data: - component: weather01.day - message: "{{ mui[language].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)}} km/h' - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather01.value03_icon - message: "{{ weather_icon_wind }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 4 ##### - - ##### field 5 ##### - - ### ACCUWEATHER - WEATHER ### - - conditions: '{{ weather == "AccuWeather" }}' - sequence: - - variables: - # weather PIC - weather_icon: >- - {%- if state_attr(weather_entity,"forecast")[0].condition == 'sunny' -%} {{ weather_sunny }} - {%- elif state_attr(weather_entity,"forecast")[0].condition == 'cloudy' -%} {{ weather_cloudy }} - {%- elif state_attr(weather_entity,"forecast")[0].condition == 'rainy' -%} {{ weather_rainy }} - {%- elif state_attr(weather_entity,"forecast")[0].condition == 'pouring' -%} {{ weather_pouring }} - {%- elif state_attr(weather_entity,"forecast")[0].condition == 'snowy' -%} {{ weather_snowy }} - {%- elif state_attr(weather_entity,"forecast")[0].condition == 'hail' -%} {{ weather_hail }} - {%- elif state_attr(weather_entity,"forecast")[0].condition == 'snowy-rainy' -%} {{ weather_snowy_rainy }} - {%- elif state_attr(weather_entity,"forecast")[0].condition == 'fog' -%} {{ weather_fog }} - {%- elif state_attr(weather_entity,"forecast")[0].condition == 'windy' -%} {{ weather_windy }} - {%- elif state_attr(weather_entity,"forecast")[0].condition == 'windy-variant' -%} {{ weather_windy-variant }} - {%- elif state_attr(weather_entity,"forecast")[0].condition == 'lightning' -%} {{ weather_lightning }} - {%- elif state_attr(weather_entity,"forecast")[0].condition == 'partlycloudy' -%} {{ weather_partlycloudy_day }} - {%- elif state_attr(weather_entity,"forecast")[0].condition == 'lightning-rainy' -%} {{ weather_lightning_rainy_day }} - {%- elif state_attr(weather_entity,"forecast")[0].condition == 'execptional' -%} {{ weather_execptional_day }} - {%- elif state_attr(weather_entity,"forecast")[0].condition == 'clear-night' -%} {{ weather_clear_night }} - {%- endif -%} - - ##### SET weather PIC on Home Page #### - - service: "{{ command_printf }}" - data: - cmd: weather01.weather_icon.pic={{ weather_icon }} - - delay: - milliseconds: "{{ delay_value }}" - - ##### SET TEMP MIN #### - - service: "{{ command_text_printf }}" - data: - component: weather01.temp_min ### Temperature MIN ### - message: '{{states(accuweather_realfeel_temperature_min_0d) | round(0)}}°' - - 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_realfeel_temperature_max_0d) | round(0)}}°' - - delay: - milliseconds: "{{ delay_value }}" - - ##### Day Name ##### - - service: "{{ command_text_printf }}" - data: - component: weather01.day - message: "{{ mui[language].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}} %" - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather01.value01_icon - message: "{{ weather_icon_rain }}" - - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 2 ##### - - service: "{{ command_text_printf }}" - data: - component: weather01.value02 - message: "{{states(accuweather_hours_of_sun_0d) | round(0)}} h" - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather01.value02_icon - message: "{{ weather_icon_sun }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 3 ##### - - service: "{{ command_text_printf }}" - data: - component: weather01.value03 - message: "{{state_attr(accuweather_uv_index_0d, 'level')}} {{states(accuweather_uv_index_0d) | round(0)}}" - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather01.value03_icon - message: "{{ weather_icon_protect }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 4 ##### - - service: "{{ command_text_printf }}" - data: - component: weather01.value04 - message: "{{states(accuweather_thunderstorm_probability_day_0d) | round(0)}} %" - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather01.value04_icon - message: "{{ weather_icon_lightning }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 5 ##### - - service: "{{ command_text_printf }}" - data: - component: weather01.value05 - message: "{{states(accuweather_wind_day_0d) | round(0)}} km/h" - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather01.value05_icon - message: "{{ weather_icon_wind }}" - - ### DEFAULT ### - default: - - service: "{{ command_printf }}" + - service: "{{ command_text_printf }}" data: - cmd: "page {{ page_home }}" - - ## PAGE WEATHE02 ## - - conditions: '{{ trigger.event.data.new_state.state == page_weather02 }}' - alias: 'weather02 page' - sequence: - - choose: - ### DEFAULT - WEATHER ### - - conditions: '{{ weather == "Default" }}' - sequence: - - variables: - # weather PIC - weather_icon: >- - {%- if state_attr(weather_entity,"forecast")[0].condition == 'sunny' -%} {{ weather_sunny }} - {%- elif state_attr(weather_entity,"forecast")[0].condition == 'cloudy' -%} {{ weather_cloudy }} - {%- elif state_attr(weather_entity,"forecast")[0].condition == 'rainy' -%} {{ weather_rainy }} - {%- elif state_attr(weather_entity,"forecast")[0].condition == 'pouring' -%} {{ weather_pouring }} - {%- elif state_attr(weather_entity,"forecast")[0].condition == 'snowy' -%} {{ weather_snowy }} - {%- elif state_attr(weather_entity,"forecast")[0].condition == 'hail' -%} {{ weather_hail }} - {%- elif state_attr(weather_entity,"forecast")[0].condition == 'snowy-rainy' -%} {{ weather_snowy_rainy }} - {%- elif state_attr(weather_entity,"forecast")[0].condition == 'fog' -%} {{ weather_fog }} - {%- elif state_attr(weather_entity,"forecast")[0].condition == 'windy' -%} {{ weather_windy }} - {%- elif state_attr(weather_entity,"forecast")[0].condition == 'windy-variant' -%} {{ weather_windy-variant }} - {%- elif state_attr(weather_entity,"forecast")[0].condition == 'lightning' -%} {{ weather_lightning }} - {%- elif state_attr(weather_entity,"forecast")[0].condition == 'partlycloudy' -%} {{ weather_partlycloudy_day }} - {%- elif state_attr(weather_entity,"forecast")[0].condition == 'lightning-rainy' -%} {{ weather_lightning_rainy_day }} - {%- elif state_attr(weather_entity,"forecast")[0].condition == 'execptional' -%} {{ weather_execptional_day }} - {%- elif state_attr(weather_entity,"forecast")[0].condition == 'clear-night' -%} {{ weather_clear_night }} - {%- endif -%} - - ##### SET weather PIC on Home Page #### - - service: "{{ command_printf }}" - data: - cmd: weather02.weather_icon.pic={{ weather_icon }} - - delay: - milliseconds: "{{ delay_value }}" - - ##### SET TEMP MIN #### - - service: "{{ command_text_printf }}" - data: - component: weather02.temp_min ### Temperature MIN ### - message: '{{state_attr(weather_entity,"forecast")[0].templow | round(0)}}°' - - delay: - milliseconds: "{{ delay_value }}" - - ##### Slash ##### - - service: "{{ command_text_printf }}" - data: - component: weather02.slash - message: '/' - - delay: - milliseconds: "{{ delay_value }}" - - ##### SET TEMP MAX #### - - service: "{{ command_text_printf }}" - data: - component: weather02.temp_max ### Temperature MAX ### - message: '{{state_attr(weather_entity,"forecast")[0].temperature | round(0)}}°' - - delay: - milliseconds: "{{ delay_value }}" - - ##### Day Name ##### - - service: "{{ command_text_printf }}" - data: - component: weather02.day - message: "{{ mui[language].tomorrow }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### Day Date ##### - - service: "{{ command_text_printf }}" - data: - component: weather02.date - message: "{{ mui_weekday_tomorrow }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 1 ##### - - ##### field 2 ##### - - service: "{{ command_text_printf }}" - data: - component: weather02.value02 - message: '{{state_attr(weather_entity,"forecast")[0].precipitation| round(1)}} mm' - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather02.value02_icon - message: "{{ weather_icon_rain }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 3 ##### - - service: "{{ command_text_printf }}" - data: - component: weather02.value03 - message: '{{state_attr(weather_entity,"forecast")[0].wind_speed | round(1)}} km/h' - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather02.value03_icon - message: "{{ weather_icon_wind }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 4 ##### - - ##### field 5 ##### - - ### ACCUWEATHER - WEATHER ### - - conditions: '{{ weather == "AccuWeather" }}' - sequence: - - variables: - # weather PIC - weather_icon: >- - {%- if state_attr(weather_entity,"forecast")[1].condition == 'sunny' -%} {{ weather_sunny }} - {%- elif state_attr(weather_entity,"forecast")[1].condition == 'cloudy' -%} {{ weather_cloudy }} - {%- elif state_attr(weather_entity,"forecast")[1].condition == 'rainy' -%} {{ weather_rainy }} - {%- elif state_attr(weather_entity,"forecast")[1].condition == 'pouring' -%} {{ weather_pouring }} - {%- elif state_attr(weather_entity,"forecast")[1].condition == 'snowy' -%} {{ weather_snowy }} - {%- elif state_attr(weather_entity,"forecast")[1].condition == 'hail' -%} {{ weather_hail }} - {%- elif state_attr(weather_entity,"forecast")[1].condition == 'snowy-rainy' -%} {{ weather_snowy_rainy }} - {%- elif state_attr(weather_entity,"forecast")[1].condition == 'fog' -%} {{ weather_fog }} - {%- elif state_attr(weather_entity,"forecast")[1].condition == 'windy' -%} {{ weather_windy }} - {%- elif state_attr(weather_entity,"forecast")[1].condition == 'windy-variant' -%} {{ weather_windy-variant }} - {%- elif state_attr(weather_entity,"forecast")[1].condition == 'lightning' -%} {{ weather_lightning }} - {%- elif state_attr(weather_entity,"forecast")[1].condition == 'partlycloudy' -%} {{ weather_partlycloudy_day }} - {%- elif state_attr(weather_entity,"forecast")[1].condition == 'lightning-rainy' -%} {{ weather_lightning_rainy_day }} - {%- elif state_attr(weather_entity,"forecast")[1].condition == 'execptional' -%} {{ weather_execptional_day }} - {%- elif state_attr(weather_entity,"forecast")[1].condition == 'clear-night' -%} {{ weather_clear_night }} - {%- endif -%} - - ##### SET weather PIC on Home Page #### - - service: "{{ command_printf }}" - data: - cmd: weather02.weather_icon.pic={{ weather_icon }} - - delay: - milliseconds: "{{ delay_value }}" - - ##### SET TEMP MIN #### - - service: "{{ command_text_printf }}" - data: - component: weather02.temp_min ### Temperature MIN ### - message: '{{states(accuweather_realfeel_temperature_min_1d) | round(0)}}°' - - delay: - milliseconds: "{{ delay_value }}" - - ##### Slash ##### - - service: "{{ command_text_printf }}" - data: - component: weather02.slash - message: '/' - - delay: - milliseconds: "{{ delay_value }}" - - ##### SET TEMP MAX #### - - service: "{{ command_text_printf }}" - data: - component: weather02.temp_max ### Temperature MAX ### - message: '{{states(accuweather_realfeel_temperature_max_1d) | round(0)}}°' - - delay: - milliseconds: "{{ delay_value }}" - - ##### Day Name ##### - - service: "{{ command_text_printf }}" - data: - component: weather02.day - message: "{{ mui[language].tomorrow }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### Day Date ##### - - service: "{{ command_text_printf }}" - data: - component: weather02.date - message: "{{ mui_weekday_tomorrow }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 1 ##### - - service: "{{ command_text_printf }}" - data: - component: weather02.value01 - message: "{{ state_attr(weather_entity,'forecast')[1].precipitation_probability}} %" - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather02.value01_icon - message: "{{ weather_icon_rain }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 2 ##### - - service: "{{ command_text_printf }}" - data: - component: weather02.value02 - message: "{{states(accuweather_hours_of_sun_1d) | round(0)}} h" - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather02.value02_icon - message: "{{ weather_icon_sun }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 3 ##### - - service: "{{ command_text_printf }}" - data: - component: weather02.value03 - message: "{{state_attr(accuweather_uv_index_1d, 'level')}} {{states(accuweather_uv_index_1d) | round(0)}}" - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather02.value03_icon - message: "{{ weather_icon_protect }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 4 ##### - - service: "{{ command_text_printf }}" - data: - component: weather02.value04 - message: "{{states(accuweather_thunderstorm_probability_day_1d) | round(0)}} %" - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather02.value04_icon - message: "{{ weather_icon_lightning }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 5 ##### - - service: "{{ command_text_printf }}" - data: - component: weather02.value05 - message: "{{states(accuweather_wind_day_1d) | round(0)}} km/h" - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather02.value05_icon - message: "{{ weather_icon_wind }}" - - ### DEFAULT #### - default: - - service: "{{ command_printf }}" + component: "{{ page_name }}.value0{{ repeat.index }}" + message: "{{ repeat.item.value }}" + - delay: + milliseconds: "{{ delay_value }}" + - service: "{{ command_text_printf }}" data: - cmd: "page {{ page_home }}" - - ## PAGE WEATHE03 ## - - conditions: '{{ trigger.event.data.new_state.state == page_weather03 }}' - alias: 'weather03 page' - sequence: - - choose: - ### DEFAULT - WEATHER ### - - conditions: '{{ weather == "Default" }}' - sequence: - - variables: - # weather PIC - weather_icon: >- - {%- if state_attr(weather_entity,"forecast")[1].condition == 'sunny' -%} {{ weather_sunny }} - {%- elif state_attr(weather_entity,"forecast")[1].condition == 'cloudy' -%} {{ weather_cloudy }} - {%- elif state_attr(weather_entity,"forecast")[1].condition == 'rainy' -%} {{ weather_rainy }} - {%- elif state_attr(weather_entity,"forecast")[1].condition == 'pouring' -%} {{ weather_pouring }} - {%- elif state_attr(weather_entity,"forecast")[1].condition == 'snowy' -%} {{ weather_snowy }} - {%- elif state_attr(weather_entity,"forecast")[1].condition == 'hail' -%} {{ weather_hail }} - {%- elif state_attr(weather_entity,"forecast")[1].condition == 'snowy-rainy' -%} {{ weather_snowy_rainy }} - {%- elif state_attr(weather_entity,"forecast")[1].condition == 'fog' -%} {{ weather_fog }} - {%- elif state_attr(weather_entity,"forecast")[1].condition == 'windy' -%} {{ weather_windy }} - {%- elif state_attr(weather_entity,"forecast")[1].condition == 'windy-variant' -%} {{ weather_windy-variant }} - {%- elif state_attr(weather_entity,"forecast")[1].condition == 'lightning' -%} {{ weather_lightning }} - {%- elif state_attr(weather_entity,"forecast")[1].condition == 'partlycloudy' -%} {{ weather_partlycloudy_day }} - {%- elif state_attr(weather_entity,"forecast")[1].condition == 'lightning-rainy' -%} {{ weather_lightning_rainy_day }} - {%- elif state_attr(weather_entity,"forecast")[1].condition == 'execptional' -%} {{ weather_execptional_day }} - {%- elif state_attr(weather_entity,"forecast")[1].condition == 'clear-night' -%} {{ weather_clear_night }} - {%- endif -%} - - ##### SET weather PIC on Home Page #### - - service: "{{ command_printf }}" - data: - cmd: weather03.weather_icon.pic={{ weather_icon }} - - delay: - milliseconds: "{{ delay_value }}" - - ##### SET TEMP MIN #### - - service: "{{ command_text_printf }}" - data: - component: weather03.temp_min ### Temperature MIN ### - message: '{{state_attr(weather_entity,"forecast")[1].templow | round(0)}}°' - - delay: - milliseconds: "{{ delay_value }}" - - ##### Slash ##### - - service: "{{ command_text_printf }}" - data: - component: weather03.slash - message: '/' - - delay: - milliseconds: "{{ delay_value }}" - - ##### SET TEMP MAX #### - - service: "{{ command_text_printf }}" - data: - component: weather03.temp_max ### Temperature MAX ### - message: '{{state_attr(weather_entity,"forecast")[1].temperature | round(0)}}°' - - delay: - milliseconds: "{{ delay_value }}" - - ##### Day Name ##### - - service: "{{ command_text_printf }}" - data: - component: weather03.day - message: "{{ mui[language].in_2_days }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### Day Date ##### - - service: "{{ command_text_printf }}" - data: - component: weather03.date - message: "{{ mui_weekday_in_2_days }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 1 ##### - - ##### field 2 ##### - - service: "{{ command_text_printf }}" - data: - component: weather03.value02 - message: '{{state_attr(weather_entity,"forecast")[1].precipitation| round(1)}} mm' - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather03.value02_icon - message: "{{ weather_icon_rain }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 3 ##### - - service: "{{ command_text_printf }}" - data: - component: weather03.value03 - message: '{{state_attr(weather_entity,"forecast")[1].wind_speed | round(1)}} km/h' - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather03.value03_icon - message: "{{ weather_icon_wind }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 4 ##### - - ##### field 5 ##### - - ### ACCUWEATHER - WEATHER ### - - conditions: '{{ weather == "AccuWeather" }}' - sequence: - - variables: - # weather PIC - weather_icon: >- - {%- if state_attr(weather_entity,"forecast")[2].condition == 'sunny' -%} {{ weather_sunny }} - {%- elif state_attr(weather_entity,"forecast")[2].condition == 'cloudy' -%} {{ weather_cloudy }} - {%- elif state_attr(weather_entity,"forecast")[2].condition == 'rainy' -%} {{ weather_rainy }} - {%- elif state_attr(weather_entity,"forecast")[2].condition == 'pouring' -%} {{ weather_pouring }} - {%- elif state_attr(weather_entity,"forecast")[2].condition == 'snowy' -%} {{ weather_snowy }} - {%- elif state_attr(weather_entity,"forecast")[2].condition == 'hail' -%} {{ weather_hail }} - {%- elif state_attr(weather_entity,"forecast")[2].condition == 'snowy-rainy' -%} {{ weather_snowy_rainy }} - {%- elif state_attr(weather_entity,"forecast")[2].condition == 'fog' -%} {{ weather_fog }} - {%- elif state_attr(weather_entity,"forecast")[2].condition == 'windy' -%} {{ weather_windy }} - {%- elif state_attr(weather_entity,"forecast")[2].condition == 'windy-variant' -%} {{ weather_windy-variant }} - {%- elif state_attr(weather_entity,"forecast")[2].condition == 'lightning' -%} {{ weather_lightning }} - {%- elif state_attr(weather_entity,"forecast")[2].condition == 'partlycloudy' -%} {{ weather_partlycloudy_day }} - {%- elif state_attr(weather_entity,"forecast")[2].condition == 'lightning-rainy' -%} {{ weather_lightning_rainy_day }} - {%- elif state_attr(weather_entity,"forecast")[2].condition == 'execptional' -%} {{ weather_execptional_day }} - {%- elif state_attr(weather_entity,"forecast")[2].condition == 'clear-night' -%} {{ weather_clear_night }} - {%- endif -%} - - ##### SET weather PIC on Home Page #### - - service: "{{ command_printf }}" - data: - cmd: weather03.weather_icon.pic={{ weather_icon }} - - delay: - milliseconds: "{{ delay_value }}" - - ##### SET TEMP MIN #### - - service: "{{ command_text_printf }}" - data: - component: weather03.temp_min ### Temperature MIN ### - message: '{{states(accuweather_realfeel_temperature_min_2d) | round(0)}}°' - - delay: - milliseconds: "{{ delay_value }}" - - ##### Slash ##### - - service: "{{ command_text_printf }}" - data: - component: weather03.slash - message: '/' - - delay: - milliseconds: "{{ delay_value }}" - - ##### SET TEMP MAX #### - - service: "{{ command_text_printf }}" - data: - component: weather03.temp_max ### Temperature MAX ### - message: '{{states(accuweather_realfeel_temperature_max_2d) | round(0)}}°' - - delay: - milliseconds: "{{ delay_value }}" - - ##### Day Name ##### - - service: "{{ command_text_printf }}" - data: - component: weather03.day - message: "{{ mui[language].in_2_days }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### Day Date ##### - - service: "{{ command_text_printf }}" - data: - component: weather03.date - message: "{{ mui_weekday_in_2_days }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 1 ##### - - service: "{{ command_text_printf }}" - data: - component: weather03.value01 - message: "{{ state_attr(weather_entity,'forecast')[2].precipitation_probability}} %" - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather03.value01_icon - message: "{{ weather_icon_rain }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 2 ##### - - service: "{{ command_text_printf }}" - data: - component: weather03.value02 - message: "{{states(accuweather_hours_of_sun_2d) | round(0)}} h" - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather03.value02_icon - message: "{{ weather_icon_sun }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 3 ##### - - service: "{{ command_text_printf }}" - data: - component: weather03.value03 - message: "{{state_attr(accuweather_uv_index_2d, 'level')}} {{states(accuweather_uv_index_2d) | round(0)}}" - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather03.value03_icon - message: "{{ weather_icon_protect }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 4 ##### - - service: "{{ command_text_printf }}" - data: - component: weather03.value04 - message: "{{states(accuweather_thunderstorm_probability_day_2d) | round(0)}} %" - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather03.value04_icon - message: "{{ weather_icon_lightning }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 5 ##### - - service: "{{ command_text_printf }}" - data: - component: weather03.value05 - message: "{{states(accuweather_wind_day_2d) | round(0)}} km/h" - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather03.value05_icon - message: "{{ weather_icon_wind }}" - - ### DEFAULT ### - default: - - service: "{{ command_printf }}" - data: - cmd: "page {{ page_home }}" - - ## PAGE WEATHE04 ## - - conditions: '{{ trigger.event.data.new_state.state == page_weather04 }}' - alias: 'weather04 page' - sequence: - - choose: - ### DEFAULT - WEATHER ### - - conditions: '{{ weather == "Default" }}' - sequence: - - variables: - # weather PIC - weather_icon: >- - {%- if state_attr(weather_entity,"forecast")[2].condition == 'sunny' -%} {{ weather_sunny }} - {%- elif state_attr(weather_entity,"forecast")[2].condition == 'cloudy' -%} {{ weather_cloudy }} - {%- elif state_attr(weather_entity,"forecast")[2].condition == 'rainy' -%} {{ weather_rainy }} - {%- elif state_attr(weather_entity,"forecast")[2].condition == 'pouring' -%} {{ weather_pouring }} - {%- elif state_attr(weather_entity,"forecast")[2].condition == 'snowy' -%} {{ weather_snowy }} - {%- elif state_attr(weather_entity,"forecast")[2].condition == 'hail' -%} {{ weather_hail }} - {%- elif state_attr(weather_entity,"forecast")[2].condition == 'snowy-rainy' -%} {{ weather_snowy_rainy }} - {%- elif state_attr(weather_entity,"forecast")[2].condition == 'fog' -%} {{ weather_fog }} - {%- elif state_attr(weather_entity,"forecast")[2].condition == 'windy' -%} {{ weather_windy }} - {%- elif state_attr(weather_entity,"forecast")[2].condition == 'windy-variant' -%} {{ weather_windy-variant }} - {%- elif state_attr(weather_entity,"forecast")[2].condition == 'lightning' -%} {{ weather_lightning }} - {%- elif state_attr(weather_entity,"forecast")[2].condition == 'partlycloudy' -%} {{ weather_partlycloudy_day }} - {%- elif state_attr(weather_entity,"forecast")[2].condition == 'lightning-rainy' -%} {{ weather_lightning_rainy_day }} - {%- elif state_attr(weather_entity,"forecast")[2].condition == 'execptional' -%} {{ weather_execptional_day }} - {%- elif state_attr(weather_entity,"forecast")[2].condition == 'clear-night' -%} {{ weather_clear_night }} - {%- endif -%} - - ##### SET weather PIC on Home Page #### - - service: "{{ command_printf }}" - data: - cmd: weather04.weather_icon.pic={{ weather_icon }} - - delay: - milliseconds: "{{ delay_value }}" - - ##### SET TEMP MIN #### - - service: "{{ command_text_printf }}" - data: - component: weather04.temp_min ### Temperature MIN ### - message: '{{state_attr(weather_entity,"forecast")[2].templow | round(0)}}°' - - delay: - milliseconds: "{{ delay_value }}" - - ##### Slash ##### - - service: "{{ command_text_printf }}" - data: - component: weather04.slash - message: '/' - - delay: - milliseconds: "{{ delay_value }}" - - ##### SET TEMP MAX #### - - service: "{{ command_text_printf }}" - data: - component: weather04.temp_max ### Temperature MAX ### - message: '{{state_attr(weather_entity,"forecast")[2].temperature | round(0)}}°' - - delay: - milliseconds: "{{ delay_value }}" - - ##### Day Name ##### - - service: "{{ command_text_printf }}" - data: - component: weather04.day - message: "{{ mui[language].in_3_days }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### Day Date ##### - - service: "{{ command_text_printf }}" - data: - component: weather04.date - message: "{{ mui_weekday_in_3_days }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 1 ##### - - ##### field 2 ##### - - service: "{{ command_text_printf }}" - data: - component: weather04.value02 - message: '{{state_attr(weather_entity,"forecast")[2].precipitation| round(1)}} mm' - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather04.value02_icon - message: "{{ weather_icon_rain }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 3 ##### - - service: "{{ command_text_printf }}" - data: - component: weather04.value03 - message: '{{state_attr(weather_entity,"forecast")[2].wind_speed | round(1)}} km/h' - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather04.value03_icon - message: "{{ weather_icon_wind }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 4 ##### - - ##### field 5 ##### - - ### ACCUWEATHER - WEATHER ### - - conditions: '{{ weather == "AccuWeather" }}' - sequence: - - variables: - # weather PIC - weather_icon: >- - {%- if state_attr(weather_entity,"forecast")[3].condition == 'sunny' -%} {{ weather_sunny }} - {%- elif state_attr(weather_entity,"forecast")[3].condition == 'cloudy' -%} {{ weather_cloudy }} - {%- elif state_attr(weather_entity,"forecast")[3].condition == 'rainy' -%} {{ weather_rainy }} - {%- elif state_attr(weather_entity,"forecast")[3].condition == 'pouring' -%} {{ weather_pouring }} - {%- elif state_attr(weather_entity,"forecast")[3].condition == 'snowy' -%} {{ weather_snowy }} - {%- elif state_attr(weather_entity,"forecast")[3].condition == 'hail' -%} {{ weather_hail }} - {%- elif state_attr(weather_entity,"forecast")[3].condition == 'snowy-rainy' -%} {{ weather_snowy_rainy }} - {%- elif state_attr(weather_entity,"forecast")[3].condition == 'fog' -%} {{ weather_fog }} - {%- elif state_attr(weather_entity,"forecast")[3].condition == 'windy' -%} {{ weather_windy }} - {%- elif state_attr(weather_entity,"forecast")[3].condition == 'windy-variant' -%} {{ weather_windy-variant }} - {%- elif state_attr(weather_entity,"forecast")[3].condition == 'lightning' -%} {{ weather_lightning }} - {%- elif state_attr(weather_entity,"forecast")[3].condition == 'partlycloudy' -%} {{ weather_partlycloudy_day }} - {%- elif state_attr(weather_entity,"forecast")[3].condition == 'lightning-rainy' -%} {{ weather_lightning_rainy_day }} - {%- elif state_attr(weather_entity,"forecast")[3].condition == 'execptional' -%} {{ weather_execptional_day }} - {%- elif state_attr(weather_entity,"forecast")[3].condition == 'clear-night' -%} {{ weather_clear_night }} - {%- endif -%} - - ##### SET weather PIC on Home Page #### - - service: "{{ command_printf }}" - data: - cmd: weather04.weather_icon.pic={{ weather_icon }} - - delay: - milliseconds: "{{ delay_value }}" - - ##### SET TEMP MIN #### - - service: "{{ command_text_printf }}" - data: - component: weather04.temp_min ### Temperature MIN ### - message: '{{states(accuweather_realfeel_temperature_min_3d) | round(0)}}°' - - delay: - milliseconds: "{{ delay_value }}" - - ##### Slash ##### - - service: "{{ command_text_printf }}" - data: - component: weather04.slash - message: '/' - - delay: - milliseconds: "{{ delay_value }}" - - ##### SET TEMP MAX #### - - service: "{{ command_text_printf }}" - data: - component: weather04.temp_max ### Temperature MAX ### - message: '{{states(accuweather_realfeel_temperature_max_3d) | round(0)}}°' - - delay: - milliseconds: "{{ delay_value }}" - - ##### Day Name ##### - - service: "{{ command_text_printf }}" - data: - component: weather04.day - message: "{{ mui[language].in_3_days }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### Day Date ##### - - service: "{{ command_text_printf }}" - data: - component: weather04.date - message: "{{ mui_weekday_in_3_days }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 1 ##### - - service: "{{ command_text_printf }}" - data: - component: weather04.value01 - message: "{{ state_attr(weather_entity,'forecast')[3].precipitation_probability}} %" - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather04.value01_icon - message: "{{ weather_icon_rain }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 2 ##### - - service: "{{ command_text_printf }}" - data: - component: weather04.value02 - message: "{{states(accuweather_hours_of_sun_3d) | round(0)}} h" - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather04.value02_icon - message: "{{ weather_icon_sun }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 3 ##### - - service: "{{ command_text_printf }}" - data: - component: weather04.value03 - message: "{{state_attr(accuweather_uv_index_3d, 'level')}} {{states(accuweather_uv_index_3d) | round(0)}}" - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather04.value03_icon - message: "{{ weather_icon_protect }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 4 ##### - - service: "{{ command_text_printf }}" - data: - component: weather04.value04 - message: "{{states(accuweather_thunderstorm_probability_day_3d) | round(0)}} %" - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather04.value04_icon - message: "{{ weather_icon_lightning }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 5 ##### - - service: "{{ command_text_printf }}" - data: - component: weather04.value05 - message: "{{states(accuweather_wind_day_3d) | round(0)}} km/h" - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather04.value05_icon - message: "{{ weather_icon_wind }}" - - ### DEFAULT ### - default: - - service: "{{ command_printf }}" - data: - cmd: "page {{ page_home }}" - - ## PAGE WEATHE05 ## - - conditions: '{{ trigger.event.data.new_state.state == page_weather05 }}' - alias: 'weather05 page' - sequence: - - choose: - ### DEAFAULT - WEATHER ### - - conditions: '{{ weather == "Default" }}' - sequence: - - variables: - # weather PIC - weather_icon: >- - {%- if state_attr(weather_entity,"forecast")[3].condition == 'sunny' -%} {{ weather_sunny }} - {%- elif state_attr(weather_entity,"forecast")[3].condition == 'cloudy' -%} {{ weather_cloudy }} - {%- elif state_attr(weather_entity,"forecast")[3].condition == 'rainy' -%} {{ weather_rainy }} - {%- elif state_attr(weather_entity,"forecast")[3].condition == 'pouring' -%} {{ weather_pouring }} - {%- elif state_attr(weather_entity,"forecast")[3].condition == 'snowy' -%} {{ weather_snowy }} - {%- elif state_attr(weather_entity,"forecast")[3].condition == 'hail' -%} {{ weather_hail }} - {%- elif state_attr(weather_entity,"forecast")[3].condition == 'snowy-rainy' -%} {{ weather_snowy_rainy }} - {%- elif state_attr(weather_entity,"forecast")[3].condition == 'fog' -%} {{ weather_fog }} - {%- elif state_attr(weather_entity,"forecast")[3].condition == 'windy' -%} {{ weather_windy }} - {%- elif state_attr(weather_entity,"forecast")[3].condition == 'windy-variant' -%} {{ weather_windy-variant }} - {%- elif state_attr(weather_entity,"forecast")[3].condition == 'lightning' -%} {{ weather_lightning }} - {%- elif state_attr(weather_entity,"forecast")[3].condition == 'partlycloudy' -%} {{ weather_partlycloudy_day }} - {%- elif state_attr(weather_entity,"forecast")[3].condition == 'lightning-rainy' -%} {{ weather_lightning_rainy_day }} - {%- elif state_attr(weather_entity,"forecast")[3].condition == 'execptional' -%} {{ weather_execptional_day }} - {%- elif state_attr(weather_entity,"forecast")[3].condition == 'clear-night' -%} {{ weather_clear_night }} - {%- endif -%} - - ##### SET weather PIC on Home Page #### - - service: "{{ command_printf }}" - data: - cmd: weather05.weather_icon.pic={{ weather_icon }} - - delay: - milliseconds: "{{ delay_value }}" - - ##### SET TEMP MIN #### - - service: "{{ command_text_printf }}" - data: - component: weather05.temp_min ### Temperature MIN ### - message: '{{state_attr(weather_entity,"forecast")[3].templow | round(0)}}°' - - delay: - milliseconds: "{{ delay_value }}" - - ##### Slash ##### - - service: "{{ command_text_printf }}" - data: - component: weather05.slash - message: '/' - - delay: - milliseconds: "{{ delay_value }}" - - ##### SET TEMP MAX #### - - service: "{{ command_text_printf }}" - data: - component: weather05.temp_max ### Temperature MAX ### - message: '{{state_attr(weather_entity,"forecast")[3].temperature | round(0)}}°' - - delay: - milliseconds: "{{ delay_value }}" - - ##### Day Name ##### - - service: "{{ command_text_printf }}" - data: - component: weather05.day - message: "{{ mui[language].in_4_days }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### Day Date ##### - - service: "{{ command_text_printf }}" - data: - component: weather05.date - message: "{{ mui_weekday_in_4_days }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 1 ##### - - ##### field 2 ##### - - service: "{{ command_text_printf }}" - data: - component: weather05.value02 - message: '{{state_attr(weather_entity,"forecast")[3].precipitation| round(1)}} mm' - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather05.value02_icon - message: "{{ weather_icon_rain }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 3 ##### - - service: "{{ command_text_printf }}" - data: - component: weather05.value03 - message: '{{state_attr(weather_entity,"forecast")[3].wind_speed | round(1)}} km/h' - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather05.value03_icon - message: "{{ weather_icon_wind }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 4 ##### - - ##### field 5 ##### - - ### ACCUWEATHER - WEATHER ### - - conditions: '{{ weather == "AccuWeather" }}' - sequence: - - variables: - # weather PIC - weather_icon: >- - {%- if state_attr(weather_entity,"forecast")[4].condition == 'sunny' -%} {{ weather_sunny }} - {%- elif state_attr(weather_entity,"forecast")[4].condition == 'cloudy' -%} {{ weather_cloudy }} - {%- elif state_attr(weather_entity,"forecast")[4].condition == 'rainy' -%} {{ weather_rainy }} - {%- elif state_attr(weather_entity,"forecast")[4].condition == 'pouring' -%} {{ weather_pouring }} - {%- elif state_attr(weather_entity,"forecast")[4].condition == 'snowy' -%} {{ weather_snowy }} - {%- elif state_attr(weather_entity,"forecast")[4].condition == 'hail' -%} {{ weather_hail }} - {%- elif state_attr(weather_entity,"forecast")[4].condition == 'snowy-rainy' -%} {{ weather_snowy_rainy }} - {%- elif state_attr(weather_entity,"forecast")[4].condition == 'fog' -%} {{ weather_fog }} - {%- elif state_attr(weather_entity,"forecast")[4].condition == 'windy' -%} {{ weather_windy }} - {%- elif state_attr(weather_entity,"forecast")[4].condition == 'windy-variant' -%} {{ weather_windy-variant }} - {%- elif state_attr(weather_entity,"forecast")[4].condition == 'lightning' -%} {{ weather_lightning }} - {%- elif state_attr(weather_entity,"forecast")[4].condition == 'partlycloudy' -%} {{ weather_partlycloudy_day }} - {%- elif state_attr(weather_entity,"forecast")[4].condition == 'lightning-rainy' -%} {{ weather_lightning_rainy_day }} - {%- elif state_attr(weather_entity,"forecast")[4].condition == 'execptional' -%} {{ weather_execptional_day }} - {%- elif state_attr(weather_entity,"forecast")[4].condition == 'clear-night' -%} {{ weather_clear_night }} - {%- endif -%} - - ##### SET weather PIC on Home Page #### - - service: "{{ command_printf }}" - data: - cmd: weather05.weather_icon.pic={{ weather_icon }} - - delay: - milliseconds: "{{ delay_value }}" - - ##### SET TEMP MIN #### - - service: "{{ command_text_printf }}" - data: - component: weather05.temp_min ### Temperature MIN ### - message: '{{states(accuweather_realfeel_temperature_min_4d) | round(0)}}°' - - delay: - milliseconds: "{{ delay_value }}" - - ##### Slash ##### - - service: "{{ command_text_printf }}" - data: - component: weather05.slash - message: '/' - - delay: - milliseconds: "{{ delay_value }}" - - ##### SET TEMP MAX #### - - service: "{{ command_text_printf }}" - data: - component: weather05.temp_max ### Temperature MAX ### - message: '{{states(accuweather_realfeel_temperature_max_4d) | round(0)}}°' - - delay: - milliseconds: "{{ delay_value }}" - - ##### Day Name ##### - - service: "{{ command_text_printf }}" - data: - component: weather05.day - message: "{{ mui[language].in_4_days }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### Day Date ##### - - service: "{{ command_text_printf }}" - data: - component: weather05.date - message: "{{ mui_weekday_in_4_days }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 1 ##### - - service: "{{ command_text_printf }}" - data: - component: weather05.value01 - message: "{{ state_attr(weather_entity,'forecast')[4].precipitation_probability}} %" - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather05.value01_icon - message: "{{ weather_icon_rain }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 2 ##### - - service: "{{ command_text_printf }}" - data: - component: weather05.value02 - message: "{{states(accuweather_hours_of_sun_4d) | round(0)}} h" - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather05.value02_icon - message: "{{ weather_icon_sun }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 3 ##### - - service: "{{ command_text_printf }}" - data: - component: weather05.value03 - message: "{{state_attr(accuweather_uv_index_4d, 'level')}} {{states(accuweather_uv_index_4d) | round(0)}}" - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather05.value03_icon - message: "{{ weather_icon_protect }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 4 ##### - - service: "{{ command_text_printf }}" - data: - component: weather05.value04 - message: "{{states(accuweather_thunderstorm_probability_day_4d) | round(0)}} %" - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather05.value04_icon - message: "{{ weather_icon_lightning }}" - - delay: - milliseconds: "{{ delay_value }}" - - ##### field 5 ##### - - service: "{{ command_text_printf }}" - data: - component: weather05.value05 - message: "{{states(accuweather_wind_day_4d) | round(0)}} km/h" - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_text_printf }}" - data: - component: weather05.value05_icon - message: "{{ weather_icon_wind }}" - - ### DEFAULT ### - default: - - service: "{{ command_printf }}" - data: - cmd: "page {{ page_home }}" + 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 }}' @@ -7583,19 +6147,19 @@ action: message: "{{ qrcode_value }}" ## PAGE SETTINGS ## - - conditions: '{{ trigger.event.data.new_state.state == page_settings }}' - alias: 'settings page' - sequence: + #- conditions: '{{ trigger.event.data.new_state.state == page_settings }}' + # alias: 'settings page' + # sequence: ## PAGE BOOT ## - - conditions: '{{ trigger.event.data.new_state.state == page_boot }}' - alias: 'boot page' - sequence: + #- conditions: '{{ trigger.event.data.new_state.state == page_boot }}' + # alias: 'boot page' + # sequence: ## PAGE SCREENSAVER ## - - conditions: '{{ trigger.event.data.new_state.state == page_screensaver }}' - alias: 'screensaver page' - sequence: + #- conditions: '{{ trigger.event.data.new_state.state == page_screensaver }}' + # alias: 'screensaver page' + # sequence: ##### BOOT NSPANEL - automation reload ##### - conditions: @@ -7807,7 +6371,7 @@ action: btn_bri_txt: >- {%- if trigger.to_state.entity_id is match "light." and trigger.to_state.state == 'on' and trigger.to_state.attributes.brightness is defined -%} {{ (trigger.to_state.attributes.brightness | int * 100 /255) | round(0) }}% {%- elif trigger.to_state.entity_id is match "cover." and trigger.to_state.state == 'open' and trigger.to_state.attributes.current_position is defined -%} {{ (trigger.to_state.attributes.current_position | int) | round(0) }}% - {%- elif trigger.to_state.entity_id is match "climate." and trigger.to_state.state != 'off' and trigger.to_state.attributes.current_temperature is defined -%} {{ (trigger.to_state.attributes.current_temperature | int) | round(0) }}° + {%- elif trigger.to_state.entity_id is match "climate." and trigger.to_state.state != 'off' and trigger.to_state.attributes.current_temperature is defined -%} {{ (trigger.to_state.attributes.current_temperature | int) | round(0) }}{{ weather.units.temperature }} {%- else -%} 0 {%- endif -%} ##### SET Button PIC @@ -8722,7 +7286,7 @@ action: value_template: '{{ climate_optimistic == true }}' ## TODO - remove from here then: - variables: - current_setpoint: "{{states(display_target_temperature) | round(1)}}" + current_setpoint: "{{ states(display_target_temperature) | round(1) if is_number(states(display_target_temperature)) else states(display_target_temperature) }}" - service: "{{ command_thermostat_cycle }}" data: value: "{{ current_setpoint -0.5 }}" @@ -8750,7 +7314,7 @@ action: value_template: '{{ climate_optimistic == true }}' ## TODO - remove from here then: - variables: - current_setpoint: "{{states(display_target_temperature) | round(1)}}" + current_setpoint: "{{ states(display_target_temperature) | round(1) if is_number(states(display_target_temperature)) else states(display_target_temperature) }}" - service: "{{ command_thermostat_cycle }}" data: value: "{{ current_setpoint +0.5 }}" @@ -9331,7 +7895,7 @@ action: {%- elif left_button_entity is match "automation." -%} {{ button_icon_automation }} {%- elif left_button_entity is match "button." -%} {{ button_icon_button }} {%- elif left_button_entity is match "input_button." -%} {{ button_icon_input_button }} - {%- elif left_button_entity is match "scene." -%} {{ button_icon_screne }} + {%- elif left_button_entity is match "scene." -%} {{ button_icon_scene }} {%- elif left_button_entity is match "script." -%} {{ button_icon_script }} {%- elif left_button_entity is match "person." -%} {{ button_icon_person }} {%- elif left_button_entity is match "binary_sensor." -%} {{ button_icon_binary_sensor }} @@ -9425,7 +7989,7 @@ action: {%- elif left_button_entity is match "automation." -%} {{ button_icon_automation }} {%- elif left_button_entity is match "button." -%} {{ button_icon_button }} {%- elif left_button_entity is match "input_button." -%} {{ button_icon_input_button }} - {%- elif left_button_entity is match "scene." -%} {{ button_icon_screne }} + {%- elif left_button_entity is match "scene." -%} {{ button_icon_scene }} {%- elif left_button_entity is match "script." -%} {{ button_icon_script }} {%- elif left_button_entity is match "person." -%} {{ button_icon_person }} {%- elif left_button_entity is match "binary_sensor." -%} {{ button_icon_binary_sensor }} @@ -9542,7 +8106,7 @@ action: - condition: trigger id: outdoortemp_state - condition: template - value_template: "{{ states(current_page) == page_home and trigger.event.data.new_state.state != 'unavailable' }}" + value_template: "{{ states(current_page) == page_home and is_number(trigger.event.data.new_state.state) }}" sequence: ### LABEL Outdoor Temp Font Color ### - delay: @@ -9557,7 +8121,7 @@ action: - service: "{{ command_text_printf }}" data: component: home.outdoor_temp - message: "{{ trigger.event.data.new_state.state |round(1) }}°" + message: "{{ trigger.event.data.new_state.state | round(1) }}{{ weather.units.temperature }}" ##### INDOOR TEMP - entity ##### - conditions: @@ -9579,14 +8143,14 @@ action: - service: "{{ command_text_printf }}" data: component: home.current_temp - message: "{{ trigger.event.data.new_state.state |round(1) }}°" + message: "{{ trigger.event.data.new_state.state | round(1) }}{{ weather.units.temperature }}" ##### INDOOR TEMP - nspanel ##### - conditions: - condition: trigger id: nspaneltemp_state - condition: template - value_template: "{{ states(current_page) == page_home and trigger.event.data.new_state.state != 'unavailable' }}" + value_template: "{{ states(current_page) == page_home and is_number(trigger.event.data.new_state.state) }}" sequence: - if: - condition: template @@ -9605,7 +8169,7 @@ action: - service: "{{ command_text_printf }}" data: component: home.current_temp - message: "{{ trigger.event.data.new_state.state |round(1) }}°" + message: "{{ trigger.event.data.new_state.state | round(1) }}{{ weather.units.temperature }}" ##### WEATHER STATE - change update ##### - conditions: @@ -9631,36 +8195,15 @@ action: - service: "{{ command_text_printf }}" data: component: home.outdoor_temp - message: '{{trigger.event.data.new_state.attributes.temperature | round(0)}}°' + message: '{{trigger.event.data.new_state.attributes.temperature | round(1)}}{{ weather.units.temperature }}' - service: "{{ command_text_printf }}" data: component: climate.outdoor_temp - message: '{{trigger.event.data.new_state.attributes.temperature | round(0)}}°' + message: '{{trigger.event.data.new_state.attributes.temperature | round(1)}}{{ weather.units.temperature }}' - - variables: - weather_pic: >- - {%- if trigger.event.data.new_state.state == 'sunny' -%} {{ weather_sunny }} - {%- elif trigger.event.data.new_state.state == 'cloudy' -%} {{ weather_cloudy }} - {%- elif trigger.event.data.new_state.state == 'rainy' -%} {{ weather_rainy }} - {%- elif trigger.event.data.new_state.state == 'pouring' -%} {{ weather_pouring }} - {%- elif trigger.event.data.new_state.state == 'snowy' -%} {{ weather_snowy }} - {%- elif trigger.event.data.new_state.state == 'hail' -%} {{ weather_hail }} - {%- elif trigger.event.data.new_state.state == 'snowy-rainy' -%} {{ weather_snowy_rainy }} - {%- elif trigger.event.data.new_state.state == 'fog' -%} {{ weather_fog }} - {%- elif trigger.event.data.new_state.state == 'windy' -%} {{ weather_windy }} - {%- elif trigger.event.data.new_state.state == 'windy-variant' -%} {{ weather_windy-variant }} - {%- elif trigger.event.data.new_state.state == 'lightning' -%} {{ weather_lightning }} - {%- elif trigger.event.data.new_state.state == 'partlycloudy' and states('sun.sun') == 'above_horizon' -%} {{ weather_partlycloudy_day }} - {%- elif trigger.event.data.new_state.state == 'partlycloudy' and states('sun.sun') == 'below_horizon' -%} {{ weather_partlycloudy_night }} - {%- elif trigger.event.data.new_state.state == 'lightning-rainy' and states('sun.sun') == 'above_horizon' -%} {{ weather_lightning_rainy_day }} - {%- elif trigger.event.data.new_state.state == 'lightning-rainy' and states('sun.sun') == 'below_horizon' -%} {{ weather_lightning_rainy_night }} - {%- elif trigger.event.data.new_state.state == 'execptional' and states('sun.sun') == 'above_horizon' -%} {{ weather_execptional_day }} - {%- elif trigger.event.data.new_state.state == 'execptional' and states('sun.sun') == 'below_horizon' -%} {{ weather_execptional_night }} - {%- elif trigger.event.data.new_state.state == 'clear-night' -%} {{ weather_clear_night }} - {%- endif -%} - service: "{{ command_printf }}" data: - cmd: home.weather.pic={{ weather_pic }} + cmd: home.weather.pic={{ nextion.pics.weather[trigger.event.data.new_state.state | default('unknown')] }} @@ -9688,7 +8231,7 @@ action: - service: "{{ command_text_printf }}" data: component: current_temp - message: "{{ trigger.event.data.new_state.attributes.current_temperature | round(1)}}°" + message: "{{ trigger.event.data.new_state.attributes.current_temperature | round(1)}}{{ weather.units.temperature }}" - service: "{{ command_text_printf }}" data: component: heating_state @@ -9739,13 +8282,13 @@ action: - service: "{{ command_text_printf }}" data: component: home.hotwater_temp - message: "{{ trigger.event.data.new_state.state |round(1) }}°" + message: "{{ trigger.event.data.new_state.state |round(1) }}{{ weather.units.temperature }}" - delay: milliseconds: "{{ delay_value }}" - service: "{{ command_text_printf }}" data: component: climate.hotwater_temp - message: "{{ trigger.event.data.new_state.state |round(1) }}°" + message: "{{ trigger.event.data.new_state.state |round(1) }}{{ weather.units.temperature }}" # - delay: # milliseconds: "{{ delay_value }}" # - service: "{{ command_printf }}" diff --git a/nspanel_esphome.yaml b/nspanel_esphome.yaml index 9746491..72e636c 100644 --- a/nspanel_esphome.yaml +++ b/nspanel_esphome.yaml @@ -7,7 +7,7 @@ ##### ADVANCED CONFIGURATION - activate only when you know what you do ############################## -# substitutions: +# substitutions: # ## usage of secrets-file ## -> comment in ###### Change ME ###### # device_name: "nspanel-name" # Wird im Blueprint benötigt! # wifi_ssid: !secret nspanel_wifi_ssid # add in your esphome secrets file. @@ -36,7 +36,7 @@ wifi: ssid: ${wifi_ssid} password: ${wifi_password} power_save_mode: none - ##### advanced config - uncomment to use static IP-Config ##### + ##### advanced config - uncomment to use static IP-Config ##### # manual_ip: # static_ip: ${ip} # gateway: ${gw} @@ -49,15 +49,19 @@ wifi: password: ${wifi_password} ##### Functionality for the Nextion display ##### -external_components: - - source: github://pr#2956 - components: [nextion] - refresh: 1h +# external_components: +# - source: github://pr#2956 +# components: [nextion] +# refresh: 1h ##### ESPHOME CONFIGURATION ##### esphome: name: ${device_name} min_version: 2022.10.2 + on_boot: + priority: 601 + then: + - lambda: id(disp1).send_command_printf("DRAKJHSUYDGBNCJHGJKSHBDN"); ##### TYPE OF ESP BOARD ##### esp32: @@ -70,13 +74,13 @@ web_server: auth: username: admin password: ${wifi_password} - ##### advanced config - change to use web_password ##### + ##### advanced config - change to use web_password ##### # password: ${web_password} ##### OTA PASSWORD ##### ota: password: ${wifi_password} - ##### advanced config - change to use ota_password ##### + ##### advanced config - change to use ota_password ##### # password: ${ota_password} safe_mode: true reboot_timeout: 3min @@ -126,7 +130,7 @@ button: ##### START - API CONFIGURATION ##### api: - ##### advanced config - activate to use api_password ##### + ##### advanced config - activate to use api_password ##### # password: ${api_password} services: @@ -142,7 +146,7 @@ api: then: - lambda: 'id(disp1)->set_tft_url(url.c_str());' - lambda: 'id(disp1)->upload_tft();' - + ##### Service to send a command "printf" directly to the display ##### - service: send_command_printf variables: @@ -204,7 +208,7 @@ api: - wait_until: switch.is_on: nextion_init - lambda: 'id(disp1).set_component_font_color(component.c_str(), message);' - + ##### Service to send a command "background color" directly to the display ##### - service: send_command_background_color variables: @@ -263,7 +267,7 @@ api: song_str: string then: - rtttl.play: - rtttl: !lambda 'return song_str;' + rtttl: !lambda 'return song_str;' # Service to show a QR code on the display (ex. for WiFi password) - service: qr_code @@ -302,6 +306,41 @@ api: id(disp1).set_component_text_printf("target_temp", "%.1f°", value); id(display_target_temp).publish_state(value); + #### Service to set the buttons #### + - service: set_button + variables: + btn_id: string + btn_pic: int + btn_bg: int + btn_icon_font: int + btn_txt_font: int + btn_bri_font: int + btn_icon: string + btn_label: string + btn_bri_txt: string + then: + - wait_until: + switch.is_on: nextion_init + - lambda: |- + // ESP_LOGD("nextion", "set button %s", btn_id.c_str()); + std::string btnicon = btn_id.c_str() + std::string("icon"); + std::string btntext = btn_id.c_str() + std::string("text"); + std::string btnbri = btn_id.c_str() + std::string("bri"); + id(disp1).send_command_printf("%spic.pic=%i", btn_id.c_str(), btn_pic); + id(disp1).set_component_background_color(btnicon.c_str(), btn_bg); + id(disp1).set_component_background_color(btntext.c_str(), btn_bg); + id(disp1).set_component_background_color(btnbri.c_str(), btn_bg); + id(disp1).set_component_font_color(btnicon.c_str(), btn_icon_font); + id(disp1).set_component_font_color(btntext.c_str(), btn_txt_font); + id(disp1).set_component_font_color(btnbri.c_str(), btn_bri_font); + id(disp1).set_component_text_printf(btnicon.c_str(), "%s", btn_icon.c_str()); + id(disp1).set_component_text_printf(btntext.c_str(), "%s", btn_label.c_str()); + // id(disp1).set_component_text_printf(btnbri.c_str(), "%s", btn_bri_txt.c_str()); + if (strcmp(btn_bri_txt.c_str(), "0") != 0) { + id(disp1).set_component_text_printf(btnbri.c_str(), "%s", btn_bri_txt.c_str()); + } else { + id(disp1).set_component_text_printf(btnbri.c_str(), " "); + } ##### START - GLOBALS CONFIGURATION ##### globals: @@ -380,13 +419,15 @@ binary_sensor: api.connected: then: - switch.toggle: relay_1 - - lambda: id(disp1).send_command_printf("home.icon_top_01.pic=51"); - - lambda: id(disp1).send_command_printf("home.left_bt_pic.pic=98"); - if: condition: switch.is_on: relay_1 then: - - lambda: id(disp1).send_command_printf("home.icon_top_01.pic=105"); + - lambda: id(disp1).send_command_printf("home.left_bt_pic.pic=78"); + - lambda: id(disp1).send_command_printf("home.icon_top_01","\U0000E3A5"); + else: + - lambda: id(disp1).send_command_printf("home.left_bt_pic.pic=77"); + - lambda: id(disp1).send_command_printf("home.icon_top_01","\U0000FFFF"); ##### RIGHT BUTTON BELOW DISPLAY TO TOGGLE RELAY ##### @@ -406,19 +447,21 @@ binary_sensor: api.connected: then: - switch.toggle: relay_2 - - lambda: id(disp1).send_command_printf("home.icon_top_02.pic=51"); - - lambda: id(disp1).send_command_printf("home.right_bt_pic.pic=98"); - if: condition: switch.is_on: relay_2 then: - - lambda: id(disp1).send_command_printf("home.icon_top_02.pic=106"); + - lambda: id(disp1).send_command_printf("home.right_bt_pic.pic=78"); + - lambda: id(disp1).send_command_printf("home.icon_top_02","\U0000E3A8"); + else: + - lambda: id(disp1).send_command_printf("home.right_bt_pic.pic=77"); + - lambda: id(disp1).send_command_printf("home.icon_top_02","\U0000FFFF"); ##### JUMP PAGE TO SETTING PAGE ##### - platform: nextion name: $device_name setting page page_id: 0 - component_id: 53 + component_id: 52 internal: true on_multi_click: - timing: @@ -430,7 +473,7 @@ binary_sensor: - platform: nextion name: ${device_name} Restart page_id: 7 - component_id: 15 + component_id: 13 internal: true on_click: - button.press: restart_nspanel @@ -439,7 +482,7 @@ binary_sensor: - platform: nextion name: ${device_name} Restart page_id: 8 - component_id: 5 + component_id: 4 internal: true on_click: - button.press: restart_nspanel @@ -448,7 +491,7 @@ binary_sensor: - platform: nextion name: ${device_name} Sleep Modus page_id: 7 - component_id: 16 + component_id: 14 internal: true on_click: - switch.toggle: sleep_modus @@ -538,7 +581,7 @@ sensor: - number.set: id: display_brightness value: !lambda 'return int(x);' - # send text field percentage of current_lightslider_val + # send text field percentage of current_lightslider_val - lambda: id(disp1).set_component_text_printf("settings.a03", "%i", id(display_brightness_global)); ###### Display DIM Brightness GET VALUE FROM NSPanel SLIDER ##### @@ -554,7 +597,7 @@ sensor: - number.set: id: display_dim_brightness value: !lambda 'return int(x);' - # send text field percentage of current_lightslider_val + # send text field percentage of current_lightslider_val - lambda: id(disp1).set_component_text_printf("settings.a04", "%i", id(display_dim_brightness_global)); ###### Send current page to HA @@ -623,7 +666,7 @@ text_sensor: value: !lambda return x; - lambda: |- id(page_timer)->execute(int(id(page_timeout).state)); - + ##### last click lightsettings page, the main action variable - push to HA ##### - platform: nextion nextion_id: disp1 @@ -741,7 +784,7 @@ text_sensor: id(page_timer)->execute(int(id(page_timeout).state)); -##### START - SWITCH CONFIGURATION ##### +##### START - SWITCH CONFIGURATION ##### switch: # ##### Restart switch ###### @@ -798,7 +841,7 @@ switch: id: relay_2 pin: number: 19 - + ##### DISPLAY ALWAYS ON ##### - platform: gpio name: ${device_name} Screen Power @@ -832,7 +875,7 @@ switch: value: '1' - lambda: id(disp1).set_component_value("settings.a02",1); - ##### Relay Local control Fallback ##### + ##### Relay Local control Fallback ##### - platform: template name: ${device_name} Relay 1 Local Fallback id: relay1_fallback @@ -925,7 +968,7 @@ display: on_setup: then: - lambda: id(disp1).send_command_printf("page 8"); - - lambda: id(disp1).set_component_text_printf("boot.esph_version", "%s", "3.2"); ### esphome-version ### + - lambda: id(disp1).set_component_text_printf("boot.esph_version", "%s", "3.2.2"); ### esphome-version ### - wait_until: api.connected - lambda: id(disp1).set_component_text_printf("boot.ip_addr", "%s", id(ip_address).state.c_str()); diff --git a/nspanel_eu.HMI b/nspanel_eu.HMI index cb939b5..9d08a73 100644 Binary files a/nspanel_eu.HMI and b/nspanel_eu.HMI differ diff --git a/nspanel_eu.tft b/nspanel_eu.tft index 00eac9e..f9fd808 100644 Binary files a/nspanel_eu.tft and b/nspanel_eu.tft differ diff --git a/nspanel_us.HMI b/nspanel_us.HMI index 6b2baf1..84f1f67 100644 Binary files a/nspanel_us.HMI and b/nspanel_us.HMI differ diff --git a/nspanel_us.tft b/nspanel_us.tft index 5fb0697..90a1323 100644 Binary files a/nspanel_us.tft and b/nspanel_us.tft differ