Hi
I’m using in a project the Mstack Atom S3 with the small but briliant display and I would like to visulize some sensors values using the button to change the “page” for each sensor
I have defined the button
binary_sensor:
- platform: gpio
name: Button
id: S3_button
pin:
number: GPIO41
inverted: true
mode:
input: true
pullup: true
filters:
- delayed_off: 10ms
on_press:
then:
- logger.log: Button Pressed
and I succed to mange the display via Lambda and display the value of a SINGLE sensor
display:
- platform: st7789v # https://esphome.io/components/display/st7789v.html
id: disp
model: Custom
backlight_pin: GPIO16
cs_pin: GPIO15
dc_pin: GPIO33
reset_pin: GPIO34
height: 128
width: 128
offset_height: 2
offset_width: 1
eightbitcolor: true
update_interval: 3s
lambda: |-
it.print((128 / 2), (128 / 3) * 1 + 5, id(roboto_24), id(my_gray), TextAlign::CENTER,"SoC %");
it.printf((128 / 2), (128 / 3) * 2 + 5, id(roboto_32), id(my_gray), TextAlign::CENTER, "%.1f%", id(state_of_charge).state);
#add the other sensors and switch the page using the button
but not sure how to use the “on-press” function inside the lambda to change display visualization for antoher sensor status
any direction on how to implement the code ??
thanks
Davide