Ga naar inhoud


Aanbevolen berichten

Geplaatst:

Ik heb hier een mooi display van Waveshare liggen, 7" 800x480 resolutie, waar ik met de hulp van de online documentatie ESPHome + LVGL aan de gang heb gekregen.

Nu heb ik op mijn display een paar buttons gecreëerd, maar ik krijg het niet voor elkaar aan de aanraking van de button een actie te knopen.

Als ik op de button "klik" (met mijn vingers) dan zie ik dat het geregistreerd wordt (button reageerd), zie ik in de log files dat er een "touch" actie is gedetecteerd, maar ik wat ik ook probeer, ik krijg het niet voor elkaar om een actie aan de button te hangen.

 

Dit is een deel van de yaml:

            widgets:
              - label:
                  text: "Living"
              - button:
                  id: but_living_lights
                  width: 150 # choose the button dimensions so
                  height: 150 # they fill the columns nincely as they flow
                  widgets:
                    - label:
                        id: living_lights
                        align: CENTER
                        text_font: mdi_64
                        text: "\U000F0336" # mdi-lightbulb-outline
                        on_press:
                          - homeassistant.action:
                              action: group.toggle
                              data:
                                entity_id: group.living

De indentatie is vanwege de yaml structuur.

In plaats van "on_press" heb ik ook "on_release" geprobeerd, geen geluk 😞 . Vreemd genoeg is "on_touch" geen optie hier....

 

Mijn vraag is dus wat ik mis / fout doe.... Tot nu toe pas een halve dag gekost... 😞 (OK, dat was inclusief het werkend krijgen van het display... 😉 )

“Success is not final, failure is not fatal: it is the courage to continue that counts.” ~ Winston Churchill


Geplaatst: (aangepast)

Wat zegt de logfile hierover?

 

tap_action wellicht?

 

Wellicht moet je een boolean button aanmaken in "Helpers".

Kun je bij statussen de entity vinden en hier de status aanpassen?

aangepast door Con

Groet, Con. Gloeiende, gloeiende, een beetje humor moet kunnen, anders ga je maar ergens anders heen..
Sinds november 2024 gelukkig weer glasvezel via KPN.

Internet/PC: modem/router Fritzbox en TP-Link accesspoint, switch (8), switch (4)

PC: Intel Nuc i7 met W11. Laptop Thinkpad met W11 met 24H2.

Asus Gigabyte Home Assistant, 20 Shelly's en 2 ESP-tjes en Zigbee.

Geplaatst: (aangepast)

Log file van een touch event

 

21:02:43	[I]	[Touch points:	28]:		id=0 x=677, y=332 x.raw=678, y.raw=333
21:02:43	[I]	[Touch:415]			Touch detected at x=677, y=332
21:02:43	[D]	[main:228]			LVGL resuming
21:02:43	[D]	[switch:012]			'lcdbacklight' Turning ON.
21:02:43	[D]	[switch:055]			'lcdbacklight': Sending state ON
21:02:46	[D]	[text_sensor:064]		'Uptime Human Readable': Sending state '1d 1h 2m 44s'
21:02:46	[D]	[sensor:093]			'Uptime Sensor': Sending state 90163.87500 s with 0 decimals of accuracy

 

Als ik de yaml aanpas naar:

            widgets:
              - label:
                  text: "Living"
              - button:
                  id: but_living_lights
                  width: 150 # choose the button dimensions so
                  height: 150 # they fill the columns nincely as they flow
                  widgets:
                    - label:
                        id: living_lights
                        align: CENTER
                        text_font: mdi_64
                        text: "\U000F0336" # mdi-lightbulb-outline
                        on_press:
                          then:
                            switch.toggle: living_touch

 

De "switch" is als volgt geconfigureerd:

switch:
  - platform: homeassistant
    id: living_touch
    entity_id: switch.living_touched
    name: living_lights_button

 

Krijg ik dit resultaat:

Compiling .pioenvs/frontdoordisplay/src/main.cpp.o
Linking .pioenvs/frontdoordisplay/firmware.elf
/data/cache/platformio/packages/toolchain-xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld: .pioenvs/frontdoordisplay/src/main.cpp.o:(.literal._Z5setupv+0x124): undefined reference to `_ZTVN7esphome13homeassistant19HomeassistantSwitchE'
/data/cache/platformio/packages/toolchain-xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld: .pioenvs/frontdoordisplay/src/main.cpp.o:(.literal._Z5setupv+0x128): undefined reference to `_ZTVN7esphome13homeassistant19HomeassistantSwitchE'
collect2: error: ld returned 1 exit status
*** [.pioenvs/frontdoordisplay/firmware.elf] Error 1

 

Zoeken gaat voort....

aangepast door Big fellow

“Success is not final, failure is not fatal: it is the courage to continue that counts.” ~ Winston Churchill

Geplaatst:

Voor het geval dat iemand zich afvraagt welk display het is: Waveshare ESP32-S3-Touch-LCD7 . Als ik dit eenmaal goed werkend heb, dan is het zeker een zeer mooie optie voor mensen die een groter touch display willen hebben voor hun home assistant installatie 🙂 

“Success is not final, failure is not fatal: it is the courage to continue that counts.” ~ Winston Churchill

  • 5 maanden later...
Geplaatst: (aangepast)

Ok, het heeft even geduurd, want het kwam een beetje op de achtergrond, maar vandaag toch weer eens opgepakt.

 

Met wat hulp van chatgpt, wat voor programmeren echt veel helpt!, ben ik tot dit gekomen:

 

Quote
################################################################################
# Substitution Variables
################################################################################
substitutions:
device_internal_name: frontdoordisplay
device_wifi_name: frontdoordisplay
device_friendly_name: Front Door Display
device_sampling_time: 30s
 
# glyphs
lightbulb: "\U000F0335"
ceiling_light: "\U000F0769"
lamp: "\U000F06B5"
floor_lamp: "\U000F08DD"
string_lights: "\U000F12BA"
track_light: "\U000F0914"
bulkhead_light: "\U000F1A2F"
led_strip: "\U000F07D6"
coach_lamp: "\U000F1020"
ceiling_fan_light: "\U000F1798"
previous: "\U0000F053"
next: "\U0000F054"
home: "\U0000F015"
 
################################################################################
# Globals
################################################################################
globals:
- id: wifi_connection
type: bool
restore_value: no
initial_value: "false"
- id: is_dark_theme
type: bool
restore_value: yes
initial_value: "false"
 
################################################################################
# Board Configuration
################################################################################
esphome:
name: ${device_internal_name}
friendly_name: ${device_friendly_name}
platformio_options:
build_flags: "-DBOARD_HAS_PSRAM"
board_build.arduino.memory_type: qio_opi
board_build.flash_mode: dio
board_upload.maximum_ram_size: 524288
on_boot:
priority: -10
then:
- if:
condition:
lambda: |-
auto *ts = id(ha_sun_state).state.c_str();
return strcmp(ts, "below_horizon") == 0;
then:
- script.execute: set_dark_theme
else:
- script.execute: set_light_theme
 
psram:
mode: octal
speed: 80MHz
 
esp32:
board: esp32s3box
variant: ESP32S3
flash_size: 8MB
framework:
type: esp-idf # Let ESPHome choose a compatible IDF (>=5.4.2)
 
################################################################################
# Enable logging
################################################################################
logger:
logs:
component: ERROR
 
################################################################################
# Enable Home Assistant API
################################################################################
api:
reboot_timeout: 0s
encryption:
key: "uRtk1Gt/EJAZAaGiulQcblYx19oXbVXx3vDe40brfeY="
on_client_connected:
- if:
condition:
lambda: 'return (0 == client_info.find("Home Assistant "));'
then:
- lvgl.widget.show: lbl_hastatus
on_client_disconnected:
- if:
condition:
lambda: 'return (0 == client_info.find("Home Assistant "));'
then:
- lvgl.widget.hide: lbl_hastatus
 
################################################################################
# OTA
################################################################################
ota:
- platform: esphome
password: "13a4051e6dc69ddf343f55949738fdb8"
 
################################################################################
# WiFi
################################################################################
wifi:
networks:
- ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
password: SuperSecret!
 
captive_portal:
 
################################################################################
# Web Server
################################################################################
web_server:
port: 80
version: 2
include_internal: true
local: true
 
################################################################################
# I2C Bus
################################################################################
i2c:
sda: GPIO08
scl: GPIO09
scan: True
id: bus_a
 
################################################################################
# IO Extender
################################################################################
ch422g:
- id: ch422g_hub
 
################################################################################
# Switch
################################################################################
switch:
- platform: restart
name: "Restart"
id: device_restart
 
- platform: safe_mode
name: Use Safe Mode
id: device_safe_mode
 
- platform: gpio
id: lcdbacklight
name: lcdbacklight
pin:
ch422g: ch422g_hub
number: 2
mode:
output: true
inverted: false
restore_mode: ALWAYS_ON
 
################################################################################
# Interval
################################################################################
interval:
- interval: 10s
then:
- if:
condition:
wifi.connected:
then:
- lambda: |-
id(wifi_connection) = true;
else:
- lambda: |-
id(wifi_connection) = false;
 
################################################################################
# Sensors
################################################################################
sensor:
- platform: wifi_signal
name: "WiFi Signal Sensor"
id: ${device_internal_name}_wifi_signal_sensor
update_interval: ${device_sampling_time}
 
- platform: uptime
name: "Uptime Sensor"
id: ${device_internal_name}_uptime_sensor
update_interval: ${device_sampling_time}
internal: true
on_raw_value:
then:
- text_sensor.template.publish:
id: ${device_internal_name}_uptime_human
state: !lambda |-
int seconds = round(id(${device_internal_name}_uptime_sensor).raw_state);
int days = seconds / (24 * 3600);
seconds = seconds % (24 * 3600);
int hours = seconds / 3600;
seconds = seconds % 3600;
int minutes = seconds / 60;
seconds = seconds % 60;
return (
(days ? to_string(days) + "d " : "") +
(hours ? to_string(hours) + "h " : "") +
(minutes ? to_string(minutes) + "m " : "") +
(to_string(seconds) + "s")
).c_str();
 
- platform: homeassistant
id: battery_charging
entity_id: sensor.1be6e4_Battery_Power
internal: true
 
- platform: homeassistant
id: grid_output
entity_id: sensor.grid_output
internal: true
 
- platform: homeassistant
id: grid_input
entity_id: sensor.grid_input
internal: true
 
- platform: homeassistant
id: solar_gen
entity_id: sensor.1be6e4_ac_output_total_power
internal: true
 
- platform: homeassistant
id: home_use
entity_id: sensor.1be6e4_total_consumption_power
internal: true
 
- platform: homeassistant
id: battery_soc
entity_id: sensor.1be6e4_remaining_battery_capacity
internal: true
 
- platform: template
name: "Living lights"
id: living_touch
 
################################################################################
# Text Sensors
################################################################################
text_sensor:
- platform: wifi_info
ip_address:
name: IP Address
id: ${device_internal_name}_ip_address
ssid:
name: Connected SSID
id: ${device_internal_name}_connected_ssid
mac_address:
name: Mac Wifi Address
id: ${device_internal_name}_mac_address
 
- platform: template
name: Uptime Human Readable
id: ${device_internal_name}_uptime_human
icon: mdi:clock-start
 
- platform: template
name: RTC
id: label_clock
 
# Sun state from HA for theme switching
- platform: homeassistant
id: ha_sun_state
entity_id: sun.sun
internal: true
on_value:
then:
- if:
condition:
lambda: 'return x == "below_horizon";'
then:
- script.execute: set_dark_theme
else:
- script.execute: set_light_theme
 
################################################################################
# Home Assistant Button Entities (16 total)
################################################################################
button:
# Page 1 (11..18)
- platform: template
name: "button-11"
id: ha_button_11
- platform: template
name: "button-12"
id: ha_button_12
- platform: template
name: "button-13"
id: ha_button_13
- platform: template
name: "button-14"
id: ha_button_14
- platform: template
name: "button-15"
id: ha_button_15
- platform: template
name: "button-16"
id: ha_button_16
- platform: template
name: "button-17"
id: ha_button_17
- platform: template
name: "button-18"
id: ha_button_18
 
# Page 2 (21..28)
- platform: template
name: "button-21"
id: ha_button_21
- platform: template
name: "button-22"
id: ha_button_22
- platform: template
name: "button-23"
id: ha_button_23
- platform: template
name: "button-24"
id: ha_button_24
- platform: template
name: "button-25"
id: ha_button_25
- platform: template
name: "button-26"
id: ha_button_26
- platform: template
name: "button-27"
id: ha_button_27
- platform: template
name: "button-28"
id: ha_button_28
 
################################################################################
# Colors
################################################################################
color:
- id: my_red
red: 100%
green: 0%
blue: 0%
- id: my_pink
red: 100%
green: 10%
blue: 40%
- id: my_yellow
red: 100%
green: 100%
blue: 0%
- id: my_green
red: 0%
green: 100%
blue: 0%
- id: my_blue
red: 0%
green: 0%
blue: 100%
- id: my_gray
red: 50%
green: 50%
blue: 50%
- id: my_white
red: 100%
green: 100%
blue: 100%
- id: my_black
red: 0%
green: 0%
blue: 0%
 
################################################################################
# Fonts
################################################################################
font:
- file: "fonts/arial.ttf"
id: arial_48
size: 48
- file: "fonts/arial.ttf"
id: arial_36
size: 36
- file: "fonts/arial.ttf"
id: arial_24
size: 24
- file: "gfonts://Roboto"
id: roboto10
size: 10
bpp: 4
- file: "fonts/materialdesignicons-webfont.ttf"
id: mdi_64
size: 64
bpp: 4
glyphs: [
"\U000F0335", # mdi-lightbulb
"\U000F0336", # mdi-lightbulb-outline
]
 
################################################################################
# Display
################################################################################
display:
- platform: rpi_dpi_rgb
id: my_display
update_interval: never
auto_clear_enabled: false
color_order: RGB
pclk_frequency: 16MHZ
dimensions:
width: 800
height: 480
de_pin:
number: 5
hsync_pin:
number: 46
ignore_strapping_warning: true
vsync_pin:
number: 3
ignore_strapping_warning: true
pclk_pin: 7
pclk_inverted: true
reset_pin:
ch422g: ch422g_hub
number: 3
hsync_back_porch: 8
hsync_front_porch: 8
hsync_pulse_width: 4
vsync_back_porch: 16
vsync_front_porch: 16
vsync_pulse_width: 4
data_pins:
red:
- 1
- 2
- 42
- 41
- 40
blue:
- 14
- 38
- 18
- 17
- 10
green:
- 39
- 0
- 45
- 48
- 47
- 21
 
################################################################################
# Touchscreen
################################################################################
touchscreen:
platform: gt911
id: my_touch
interrupt_pin: GPIO4
reset_pin:
ch422g: ch422g_hub
number: 1
mode: OUTPUT
on_touch:
- lambda: |-
ESP_LOGI("Touch", "Touch detected at x=%d, y=%d", touch.x, touch.y);
on_release:
- if:
condition: lvgl.is_paused
then:
- logger.log: "LVGL resuming"
- lvgl.resume:
- lvgl.widget.redraw:
- switch.turn_on: lcdbacklight
on_update:
- lambda: |-
for (auto touch: touches) {
if (touch.state <= 2) {
ESP_LOGI("Touch points:", "id=%d x=%d, y=%d x.raw=%d, y.raw=%d", touch.id, touch.x, touch.y, touch.x_raw, touch.y_raw);
}
}
 
################################################################################
# Number
################################################################################
number:
- platform: template
name: LVGL Screen timeout
optimistic: true
id: display_timeout
unit_of_measurement: "s"
initial_value: 45
restore_value: true
min_value: 10
max_value: 180
step: 5
mode: box
 
################################################################################
# Scripts (theme switching)
################################################################################
script:
- id: set_dark_theme
mode: queued
then:
- lambda: 'id(is_dark_theme) = true;'
# Bottom nav + page headers
- lvgl.widget.update: { id: top_layer, styles: header_footer_dark }
- lvgl.widget.update: { id: [header_page1, header_page2], styles: header_footer_dark }
# Buttons (resting state for dark theme)
- lvgl.widget.update:
id:
- button_11
- button_12
- button_13
- button_14
- button_15
- button_16
- button_17
- button_18
- button_21
- button_22
- button_23
- button_24
- button_25
- button_26
- button_27
- button_28
styles: btn_dark
 
- id: set_light_theme
mode: queued
then:
- lambda: 'id(is_dark_theme) = false;'
- lvgl.widget.update: { id: top_layer, styles: header_footer_light }
- lvgl.widget.update: { id: [header_page1, header_page2], styles: header_footer_light }
- lvgl.widget.update:
id:
- button_11
- button_12
- button_13
- button_14
- button_15
- button_16
- button_17
- button_18
- button_21
- button_22
- button_23
- button_24
- button_25
- button_26
- button_27
- button_28
styles: btn_light
 
############################################ START OF LVGL
lvgl:
 
on_idle:
timeout: !lambda "return (id(display_timeout).state * 1000);"
then:
- logger.log: "LVGL is idle"
- switch.turn_off: lcdbacklight
- lvgl.pause:
 
theme:
label:
text_font: montserrat_24
button:
bg_color: 0x2F8CD8
bg_grad_color: 0x005782
bg_grad_dir: VER
bg_opa: COVER
border_color: 0x0077b3
border_width: 1
text_color: 0xFFFFFF
pressed:
bg_color: 0x006699
bg_grad_color: 0x00334d
checked:
bg_color: 0x1d5f96
bg_grad_color: 0x03324A
text_color: 0xfff300
buttonmatrix:
bg_opa: TRANSP
border_color: 0x0077b3
border_width: 0
text_color: 0xFFFFFF
pad_all: 0
items:
bg_color: 0x2F8CD8
bg_grad_color: 0x005782
bg_grad_dir: VER
bg_opa: COVER
border_color: 0x0077b3
border_width: 1
text_color: 0xFFFFFF
text_font: montserrat_24
pressed:
bg_color: 0x006699
bg_grad_color: 0x00334d
checked:
bg_color: 0x1d5f96
bg_grad_color: 0x03324A
text_color: 0x005580
switch:
bg_color: 0xC0C0C0
bg_grad_color: 0xb0b0b0
bg_grad_dir: VER
bg_opa: COVER
checked:
bg_color: 0x1d5f96
bg_grad_color: 0x03324A
bg_grad_dir: VER
bg_opa: COVER
knob:
bg_color: 0xFFFFFF
bg_grad_color: 0xC0C0C0
bg_grad_dir: VER
bg_opa: COVER
slider:
border_width: 1
border_opa: 15%
bg_color: 0xcccaca
bg_opa: 15%
indicator:
bg_color: 0x1d5f96
bg_grad_color: 0x03324A
bg_grad_dir: VER
bg_opa: COVER
knob:
bg_color: 0x2F8CD8
bg_grad_color: 0x005782
bg_grad_dir: VER
bg_opa: COVER
border_color: 0x0077b3
border_width: 1
text_color: 0xFFFFFF
 
style_definitions:
- id: header_footer
bg_color: 0x2F8CD8
bg_grad_color: 0x005782
bg_grad_dir: VER
bg_opa: COVER
border_opa: TRANSP
radius: 0
pad_all: 0
pad_row: 0
pad_column: 0
border_color: 0x0077b3
text_color: 0xFFFFFF
width: 100%
height: 30
 
- id: header_footer_light
bg_color: 0x2F8CD8
bg_grad_color: 0x005782
bg_grad_dir: VER
bg_opa: COVER
border_opa: TRANSP
radius: 0
pad_all: 0
text_color: 0xFFFFFF
width: 100%
height: 30
 
- id: header_footer_dark
bg_color: 0x111418
bg_grad_color: 0x0A0C0F
bg_grad_dir: VER
bg_opa: COVER
border_opa: TRANSP
radius: 0
pad_all: 0
text_color: 0xE0E0E0
width: 100%
height: 30
 
# Resting styles
- id: btn_light
bg_color: 0x2F8CD8
bg_grad_color: 0x005782
bg_grad_dir: VER
bg_opa: COVER
border_color: 0x0077b3
border_width: 1
text_color: 0xFFFFFF
 
- id: btn_dark
bg_color: 0x1A1F24
bg_grad_color: 0x111418
bg_grad_dir: VER
bg_opa: COVER
border_color: 0x2A3036
border_width: 1
text_color: 0xE0E0E0
 
# Temporary "pressed" darker style for dark theme
- id: btn_darker
bg_color: 0x0F1216
bg_grad_color: 0x0A0C0F
bg_grad_dir: VER
bg_opa: COVER
border_color: 0x1C2228
border_width: 1
text_color: 0xD0D0D0
 
# Bottom navigation bar
top_layer:
widgets:
- label:
text_font: montserrat_12
text: "\uF1EB"
id: lbl_hastatus
hidden: true
align: top_right
x: -2
y: 7
text_align: right
text_color: 0xFFFFFF
- buttonmatrix:
align: bottom_mid
styles: header_footer_light
pad_all: 0
outline_width: 0
id: top_layer
items:
styles: header_footer_light
text_font: montserrat_12
rows:
- buttons:
- id: page_prev
text: "\uF053"
on_press:
then:
lvgl.page.previous:
- id: page_home
text: "\uF015"
on_press:
then:
lvgl.page.show: main_page
- id: page_next
text: "\uF054"
on_press:
then:
lvgl.page.next:
 
# Pages (2 × 8 buttons)
pages:
- id: main_page
widgets:
- obj:
id: header_page1
align: TOP_MID
styles: header_footer_light
widgets:
- label:
text: "Page 1"
align: CENTER
text_align: CENTER
text_color: 0xFFFFFF
 
- obj:
align: CENTER
width: 720
height: 400
pad_all: 6
bg_opa: TRANSP
border_opa: TRANSP
layout:
type: FLEX
flex_flow: ROW_WRAP
flex_align_main: SPACE_EVENLY
flex_align_cross: CENTER
widgets:
# Buttons 11..18
- button:
id: button_11
styles: btn_light
width: 170
height: 150
widgets: [ { label: { text_font: mdi_64, x: 40, y: 5, text_align: CENTER, text: "${lightbulb}" } }, { label: { text_align: CENTER, y: 75, text_color: 0xFFFFFF, text: "Living Room" } } ]
on_press:
then:
- if: { condition: { lambda: 'return id(is_dark_theme);' }, then: { lvgl.widget.update: { id: button_11, styles: btn_darker } }, else: { lvgl.widget.update: { id: button_11, styles: btn_dark } } }
- button.press: ha_button_11
- homeassistant.event: { event: esphome.button_pressed, data: { button: "button-11" } }
on_release:
then:
- if: { condition: { lambda: 'return id(is_dark_theme);' }, then: { lvgl.widget.update: { id: button_11, styles: btn_dark } }, else: { lvgl.widget.update: { id: button_11, styles: btn_light } } }
- button:
id: button_12
styles: btn_light
width: 170
height: 150
widgets: [ { label: { text_font: mdi_64, x: 40, y: 5, text_align: CENTER, text: "${lightbulb}" } }, { label: { text_align: CENTER, x: 20, y: 75, text_color: 0xFFFFFF, text: "Bed Room" } } ]
on_press:
then:
- if: { condition: { lambda: 'return id(is_dark_theme);' }, then: { lvgl.widget.update: { id: button_12, styles: btn_darker } }, else: { lvgl.widget.update: { id: button_12, styles: btn_dark } } }
- button.press: ha_button_12
- homeassistant.event: { event: esphome.button_pressed, data: { button: "button-12" } }
on_release:
then:
- if: { condition: { lambda: 'return id(is_dark_theme);' }, then: { lvgl.widget.update: { id: button_12, styles: btn_dark } }, else: { lvgl.widget.update: { id: button_12, styles: btn_light } } }
 
- button:
id: button_13
styles: btn_light
width: 170
height: 150
widgets: [ { label: { text_font: mdi_64, x: 40, y: 5, text_align: CENTER, text: "${lightbulb}" } }, { label: { text_align: CENTER, x: 35, y: 75, text_color: 0xFFFFFF, text: "Office" } } ]
on_press:
then:
- if: { condition: { lambda: 'return id(is_dark_theme);' }, then: { lvgl.widget.update: { id: button_13, styles: btn_darker } }, else: { lvgl.widget.update: { id: button_13, styles: btn_dark } } }
- button.press: ha_button_13
- homeassistant.event: { event: esphome.button_pressed, data: { button: "button-13" } }
on_release:
then:
- if: { condition: { lambda: 'return id(is_dark_theme);' }, then: { lvgl.widget.update: { id: button_13, styles: btn_dark } }, else: { lvgl.widget.update: { id: button_13, styles: btn_light } } }
 
- button:
id: button_14
styles: btn_light
width: 170
height: 150
widgets: [ { label: { align: CENTER, text: "button-14" } } ]
on_press:
then:
- if: { condition: { lambda: 'return id(is_dark_theme);' }, then: { lvgl.widget.update: { id: button_14, styles: btn_darker } }, else: { lvgl.widget.update: { id: button_14, styles: btn_dark } } }
- button.press: ha_button_14
- homeassistant.event: { event: esphome.button_pressed, data: { button: "button-14" } }
on_release:
then:
- if: { condition: { lambda: 'return id(is_dark_theme);' }, then: { lvgl.widget.update: { id: button_14, styles: btn_dark } }, else: { lvgl.widget.update: { id: button_14, styles: btn_light } } }
 
- button:
id: button_15
styles: btn_light
width: 170
height: 150
widgets: [ { label: { align: CENTER, text: "button-15" } } ]
on_press:
then:
- if: { condition: { lambda: 'return id(is_dark_theme);' }, then: { lvgl.widget.update: { id: button_15, styles: btn_darker } }, else: { lvgl.widget.update: { id: button_15, styles: btn_dark } } }
- button.press: ha_button_15
- homeassistant.event: { event: esphome.button_pressed, data: { button: "button-15" } }
on_release:
then:
- if: { condition: { lambda: 'return id(is_dark_theme);' }, then: { lvgl.widget.update: { id: button_15, styles: btn_dark } }, else: { lvgl.widget.update: { id: button_15, styles: btn_light } } }
 
- button:
id: button_16
styles: btn_light
width: 170
height: 150
widgets: [ { label: { align: CENTER, text: "button-16" } } ]
on_press:
then:
- if: { condition: { lambda: 'return id(is_dark_theme);' }, then: { lvgl.widget.update: { id: button_16, styles: btn_darker } }, else: { lvgl.widget.update: { id: button_16, styles: btn_dark } } }
- button.press: ha_button_16
- homeassistant.event: { event: esphome.button_pressed, data: { button: "button-16" } }
on_release:
then:
- if: { condition: { lambda: 'return id(is_dark_theme);' }, then: {

 

Ik heb nu twee paginas met 8 knoppen elk, wat zeker nog gaat veranderen naar een paar knoppen en een informatie widget, zoals het weer oid, op de home pagina, en dan misschien op de 2e pagina wat andere info / knoppen....

 

Dit is het display wat ik in gebruik heb:

 

image.thumb.png.114e5177cfca34a09ef534c7e3538d36.png

 

Dit display heeft standaard heel veel interfaces beschikbaar:

 

image.thumb.png.847b65b9987477e71d39a5eb4c6b166d.png

 

Dus als je op zoek bent naar een mooi, bruikbaar display voor Home Assistant, welke ook nog een aantal goed bruikbare interfaces heeft, dan is dit misschien een goede optie. En aangezien het nu 11.11 is in China, krijg je ook nog eens een mooie korting 😉 

aangepast door Big fellow

“Success is not final, failure is not fatal: it is the courage to continue that counts.” ~ Winston Churchill

Maak een account aan of log in om te reageren

Je moet een lid zijn om een reactie te kunnen achterlaten

Account aanmaken

Registreer voor een nieuwe account in onze community. Het is erg gemakkelijk!

Registreer een nieuwe account

Inloggen

Heb je reeds een account? Log hier in.

Nu inloggen
  • Wie is er online   0 leden

    • Er zijn geen geregistreerde gebruikers deze pagina aan het bekijken
×
×
  • Nieuwe aanmaken...