diff --git a/esphome.yaml b/esphome.yaml index 8794edb..0d007f8 100644 --- a/esphome.yaml +++ b/esphome.yaml @@ -364,6 +364,11 @@ globals: restore_value: no initial_value: '' + ##### lastclick_ccurrentpage State ##### + - id: currentpage_global + type: std::string + restore_value: no + initial_value: '' ##### START - BINARY SENSOR CONFIGURATION ##### binary_sensor: @@ -604,6 +609,27 @@ text_sensor: id: lastclick_climatesettings_global value: !lambda return x; + ##### currentpage sensor, the main action variable - push to HA ##### + - platform: nextion + nextion_id: disp1 + name: ${device_name} current Page New + id: disp1_currentpage_new + update_interval: 50ms + component_name: current_p_va + internal: false + filters: + - lambda: |- + if (strcmp(x.c_str(), id(currentpage_global).c_str()) != 0) { + return x; + } else { + return {}; + } + on_value: + then: + - globals.set: + id: currentpage_global + value: !lambda return x; + ##### START - SWITCH CONFIGURATION ##### switch: