diff --git a/advanced/esphome/nspanel_esphome_addon_climate_base.yaml b/advanced/esphome/nspanel_esphome_addon_climate_base.yaml index 30a9e0b..9428419 100644 --- a/advanced/esphome/nspanel_esphome_addon_climate_base.yaml +++ b/advanced/esphome/nspanel_esphome_addon_climate_base.yaml @@ -134,13 +134,13 @@ script: disp1->hide_component("button06"); disp1->show_component("button07"); //Off // Set buttons colors - disp1->set_component_font_color("climate.button01_icon", 6339); - disp1->set_component_font_color("climate.button02_icon", 6339); - disp1->set_component_font_color("climate.button03_icon", (thermostat_embedded->mode==climate::CLIMATE_MODE_HEAT) ? 64164 : ((${addon_climate_heat}) ? 48631 : 6339)); - disp1->set_component_font_color("climate.button04_icon", (thermostat_embedded->mode==climate::CLIMATE_MODE_COOL) ? 1055 : ((${addon_climate_cool}) ? 48631 : 6339)); - disp1->set_component_font_color("climate.button05_icon", 6339); - disp1->set_component_font_color("climate.button06_icon", 6339); - disp1->set_component_font_color("climate.button07_icon", (thermostat_embedded->mode==climate::CLIMATE_MODE_OFF) ? 10597 : 35921); + disp1->set_component_font_color("climate.button01", 6339); + disp1->set_component_font_color("climate.button02", 6339); + disp1->set_component_font_color("climate.button03", (thermostat_embedded->mode==climate::CLIMATE_MODE_HEAT) ? 64164 : ((${addon_climate_heat}) ? 48631 : 6339)); + disp1->set_component_font_color("climate.button04", (thermostat_embedded->mode==climate::CLIMATE_MODE_COOL) ? 1055 : ((${addon_climate_cool}) ? 48631 : 6339)); + disp1->set_component_font_color("climate.button05", 6339); + disp1->set_component_font_color("climate.button06", 6339); + disp1->set_component_font_color("climate.button07", (thermostat_embedded->mode==climate::CLIMATE_MODE_OFF) ? 10597 : 35921); } - id: !extend addon_climate_set_climate_friendly_name diff --git a/advanced/esphome/nspanel_esphome_core.yaml b/advanced/esphome/nspanel_esphome_core.yaml index ad85d02..633ad65 100644 --- a/advanced/esphome/nspanel_esphome_core.yaml +++ b/advanced/esphome/nspanel_esphome_core.yaml @@ -2370,13 +2370,13 @@ script: static const char *const TAG = "script.page_climate"; if (construct_page) { ESP_LOGV(TAG, "Construct climate page"); - disp1->set_component_text_printf("climate.button01_icon", "%s", "\uEE8D"); //mdi:calendar-sync - disp1->set_component_text_printf("climate.button02_icon", "%s", "\uE069"); //mdi:autorenew - disp1->set_component_text_printf("climate.button03_icon", "%s", "\uE237"); //mdi:fire - disp1->set_component_text_printf("climate.button04_icon", "%s", "\uE716"); //mdi:snowflake - disp1->set_component_text_printf("climate.button05_icon", "%s", "\uE58D"); //mdi:water-percent - disp1->set_component_text_printf("climate.button06_icon", "%s", "\uE20F"); //mdi:fan - disp1->set_component_text_printf("climate.button07_icon", "%s", "\uE424"); //mdi:power + disp1->set_component_text_printf("climate.button01", "%s", "\uEE8D"); //mdi:calendar-sync + disp1->set_component_text_printf("climate.button02", "%s", "\uE069"); //mdi:autorenew + disp1->set_component_text_printf("climate.button03", "%s", "\uE237"); //mdi:fire + disp1->set_component_text_printf("climate.button04", "%s", "\uE716"); //mdi:snowflake + disp1->set_component_text_printf("climate.button05", "%s", "\uE58D"); //mdi:water-percent + disp1->set_component_text_printf("climate.button06", "%s", "\uE20F"); //mdi:fan + disp1->set_component_text_printf("climate.button07", "%s", "\uE424"); //mdi:power } addon_climate_update_page_climate->execute(); diff --git a/advanced/hmi/nspanel_eu_code/climate.txt b/advanced/hmi/nspanel_eu_code/climate.txt index 0310f84..72f8423 100644 --- a/advanced/hmi/nspanel_eu_code/climate.txt +++ b/advanced/hmi/nspanel_eu_code/climate.txt @@ -16,10 +16,12 @@ Page climate { sendme vis target_icon,0 - vis target_temp,0 + vis target_high,0 + vis target_low,0 vis current_temp,0 vis current_icon,0 - vis climateslider,0 + vis slider_high,0 + vis slider_low,0 vis button01,0 vis button02,0 vis button03,0 @@ -76,62 +78,74 @@ Variable (string) climatesetting Variable (string) lastclick Attributes - ID : 34 + ID : 27 Scope : local Text : Max. Text Size: 255 Variable (int32) temp_offset Attributes - ID : 36 + ID : 29 Scope: local Value: 0 Variable (int32) temp_step Attributes - ID : 37 + ID : 30 Scope: local Value: 0 Variable (int32) temp_number Attributes - ID : 43 + ID : 34 Scope: local Value: 0 Variable (int32) va0 Attributes - ID : 44 + ID : 35 Scope: local Value: 0 Variable (string) back_page Attributes - ID : 45 + ID : 36 Scope : local Text : home Max. Text Size: 15 Variable (int32) embedded Attributes - ID : 46 + ID : 37 Scope: global Value: 0 Variable (string) va2 Attributes - ID : 47 + ID : 38 Scope : local Text : Max. Text Size: 10 Variable (string) click_comp Attributes - ID : 49 + ID : 40 Scope : local Text : Max. Text Size: 8 +Variable (int32) single_slider + Attributes + ID : 44 + Scope: local + Value: 1 + +Variable (int32) active_slider + Attributes + ID : 45 + Scope: local + Value: 1 + Text current_temp Attributes ID : 3 @@ -348,99 +362,271 @@ Text value04 prints rand,0 printh FF FF FF -Text button01_icon +Text button01 Attributes ID : 18 Scope : local Dragging : 0 - Send Component ID : disabled + Send Component ID : on press and release Associated Keyboard: none Text : Max. Text Size : 10 -Text button02_icon + Events + Touch Press Event + printh 91 + prints "touchevent",0 + printh 00 + prints rand,0 + printh FF FF FF + + Touch Release Event + covx embedded.val,va2.txt,0,0 + lastclick.txt="{\"page\": \"climate\", \"key\": \"hvac_mode\", \"value\": \"auto\", \"embedded\": "+va2.txt+"}" + printh 92 + prints "localevent",0 + printh 00 + prints lastclick.txt,0 + printh 00 + printh FF FF FF + +Text button02 Attributes ID : 19 Scope : local Dragging : 0 - Send Component ID : disabled + Send Component ID : on press and release Associated Keyboard: none Text : Max. Text Size : 10 -Text button03_icon + Events + Touch Press Event + printh 91 + prints "touchevent",0 + printh 00 + prints rand,0 + printh FF FF FF + + Touch Release Event + covx embedded.val,va2.txt,0,0 + lastclick.txt="{\"page\": \"climate\", \"key\": \"hvac_mode\", \"value\": \"heat_cool\", \"embedded\": "+va2.txt+"}" + printh 92 + prints "localevent",0 + printh 00 + prints lastclick.txt,0 + printh 00 + printh FF FF FF + +Text button03 Attributes ID : 20 Scope : local Dragging : 0 - Send Component ID : disabled + Send Component ID : on press and release Associated Keyboard: none Text : Max. Text Size : 10 -Text button04_icon + Events + Touch Press Event + printh 91 + prints "touchevent",0 + printh 00 + prints rand,0 + printh FF FF FF + + Touch Release Event + covx embedded.val,va2.txt,0,0 + lastclick.txt="{\"page\": \"climate\", \"key\": \"hvac_mode\", \"value\": \"heat\", \"embedded\": "+va2.txt+"}" + printh 92 + prints "localevent",0 + printh 00 + prints lastclick.txt,0 + printh 00 + printh FF FF FF + +Text button04 Attributes ID : 21 Scope : local Dragging : 0 - Send Component ID : disabled + Send Component ID : on press and release Associated Keyboard: none Text : Max. Text Size : 10 -Text button05_icon + Events + Touch Press Event + printh 91 + prints "touchevent",0 + printh 00 + prints rand,0 + printh FF FF FF + + Touch Release Event + covx embedded.val,va2.txt,0,0 + lastclick.txt="{\"page\": \"climate\", \"key\": \"hvac_mode\", \"value\": \"cool\", \"embedded\": "+va2.txt+"}" + printh 92 + prints "localevent",0 + printh 00 + prints lastclick.txt,0 + printh 00 + printh FF FF FF + +Text button05 Attributes ID : 22 Scope : local Dragging : 0 - Send Component ID : disabled + Send Component ID : on press and release Associated Keyboard: none Text : Max. Text Size : 10 -Text button06_icon + Events + Touch Press Event + printh 91 + prints "touchevent",0 + printh 00 + prints rand,0 + printh FF FF FF + + Touch Release Event + covx embedded.val,va2.txt,0,0 + lastclick.txt="{\"page\": \"climate\", \"key\": \"hvac_mode\", \"value\": \"dry\", \"embedded\": "+va2.txt+"}" + printh 92 + prints "localevent",0 + printh 00 + prints lastclick.txt,0 + printh 00 + printh FF FF FF + +Text button06 Attributes ID : 23 Scope : local Dragging : 0 - Send Component ID : disabled + Send Component ID : on press and release Associated Keyboard: none Text : Max. Text Size : 10 -Text button07_icon + Events + Touch Press Event + printh 91 + prints "touchevent",0 + printh 00 + prints rand,0 + printh FF FF FF + + Touch Release Event + covx embedded.val,va2.txt,0,0 + lastclick.txt="{\"page\": \"climate\", \"key\": \"hvac_mode\", \"value\": \"fan_only\", \"embedded\": "+va2.txt+"}" + printh 92 + prints "localevent",0 + printh 00 + prints lastclick.txt,0 + printh 00 + printh FF FF FF + +Text button07 Attributes ID : 24 Scope : local Dragging : 0 - Send Component ID : disabled + Send Component ID : on press and release Associated Keyboard: none Text : Max. Text Size : 10 -Text button08_icon + Events + Touch Press Event + printh 91 + prints "touchevent",0 + printh 00 + prints rand,0 + printh FF FF FF + + Touch Release Event + covx embedded.val,va2.txt,0,0 + lastclick.txt="{\"page\": \"climate\", \"key\": \"hvac_mode\", \"value\": \"off\", \"embedded\": "+va2.txt+"}" + printh 92 + prints "localevent",0 + printh 00 + prints lastclick.txt,0 + printh 00 + printh FF FF FF + +Text button08 Attributes - ID : 38 + ID : 31 Scope : local Dragging : 0 - Send Component ID : disabled + Send Component ID : on press and release Associated Keyboard: none Text : Max. Text Size : 10 -Text button09_icon + Events + Touch Press Event + printh 91 + prints "touchevent",0 + printh 00 + prints rand,0 + printh FF FF FF + click_comp.txt="button08" + click_timer.en=1 + + Touch Release Event + if(click_timer.en==1) + { + click_timer.en=0 + lastclick.txt="{\"page\": \"climate\", \"event\": \"short_click\", \"component\": \""+click_comp.txt+"\"}" + printh 92 + prints "localevent",0 + printh 00 + prints lastclick.txt,0 + printh 00 + printh FF FF FF + } + +Text button09 Attributes - ID : 40 + ID : 32 Scope : local Dragging : 0 - Send Component ID : disabled + Send Component ID : on press and release Associated Keyboard: none Text : Max. Text Size : 10 -Text target_temp + Events + Touch Press Event + printh 91 + prints "touchevent",0 + printh 00 + prints rand,0 + printh FF FF FF + click_comp.txt="button09" + click_timer.en=1 + + Touch Release Event + if(click_timer.en==1) + { + click_timer.en=0 + lastclick.txt="{\"page\": \"climate\", \"event\": \"short_click\", \"component\": \""+click_comp.txt+"\"}" + printh 92 + prints "localevent",0 + printh 00 + prints lastclick.txt,0 + printh 00 + printh FF FF FF + } + +Text target_high Attributes - ID : 42 + ID : 33 Scope : local Dragging : 0 Send Component ID : disabled @@ -456,7 +642,25 @@ Text target_temp prints rand,0 printh FF FF FF -Slider climateslider +Text target_low + Attributes + ID : 46 + Scope : local + Dragging : 0 + Send Component ID : disabled + Associated Keyboard: none + Text : + Max. Text Size : 10 + + Events + Touch Press Event + printh 91 + prints "touchevent",0 + printh 00 + prints rand,0 + printh FF FF FF + +Slider slider_high Attributes ID : 7 Scope : local @@ -475,13 +679,46 @@ Slider climateslider printh FF FF FF Touch Release Event - temp_number.val=climateslider.val*temp_step.val + temp_number.val=slider_high.val*temp_step.val temp_number.val+=temp_offset.val va0.val=temp_number.val/10 - covx va0.val,target_temp.txt,0,0 + covx va0.val,target_high.txt,0,0 va0.val=temp_number.val%10 covx va0.val,va1.txt,0,0 - target_temp.txt+="."+va1.txt + target_high.txt+="."+va1.txt + timer01.en=1 + printh 91 + prints "touchevent",0 + printh 00 + prints rand,0 + printh FF FF FF + +Slider slider_low + Attributes + ID : 43 + Scope : local + Dragging : 0 + Send Component ID: disabled + Position : 20 + Upper range limit: 40 + Lower range limit: 0 + + Events + Touch Press Event + printh 91 + prints "touchevent",0 + printh 00 + prints rand,0 + printh FF FF FF + + Touch Release Event + temp_number.val=slider_high.val*temp_step.val + temp_number.val+=temp_offset.val + va0.val=temp_number.val/10 + covx va0.val,target_high.txt,0,0 + va0.val=temp_number.val%10 + covx va0.val,va1.txt,0,0 + target_high.txt+="."+va1.txt timer01.en=1 printh 91 prints "touchevent",0 @@ -491,7 +728,7 @@ Slider climateslider Button button_back Attributes - ID : 48 + ID : 39 Scope : local Dragging : 0 Send Component ID: disabled @@ -532,16 +769,16 @@ Hotspot decrease_temp printh 00 prints rand,0 printh FF FF FF - if(climateslider.val>0) + if(slider_high.val>0) { - climateslider.val-- - temp_number.val=climateslider.val*temp_step.val + slider_high.val-- + temp_number.val=slider_high.val*temp_step.val temp_number.val+=temp_offset.val va0.val=temp_number.val/10 - covx va0.val,target_temp.txt,0,0 + covx va0.val,target_high.txt,0,0 va0.val=temp_number.val%10 covx va0.val,va1.txt,0,0 - target_temp.txt+="."+va1.txt + target_high.txt+="."+va1.txt } Touch Release Event @@ -561,256 +798,21 @@ Hotspot increase_temp printh 00 prints rand,0 printh FF FF FF - if(climateslider.val0) + if(slider_high.val>0) { - climateslider.val-- - temp_number.val=climateslider.val*temp_step.val + slider_high.val-- + temp_number.val=slider_high.val*temp_step.val temp_number.val+=temp_offset.val va0.val=temp_number.val/10 - covx va0.val,target_temp.txt,0,0 + covx va0.val,target_high.txt,0,0 va0.val=temp_number.val%10 covx va0.val,va1.txt,0,0 - target_temp.txt+="."+va1.txt + target_high.txt+="."+va1.txt } Touch Release Event @@ -557,7 +802,7 @@ Hotspot increase_temp ID : 5 Scope : local Dragging : 0 - Send Component ID: disabled + Send Component ID: on press and release Events Touch Press Event @@ -566,256 +811,21 @@ Hotspot increase_temp printh 00 prints rand,0 printh FF FF FF - if(climateslider.val