adding ui changes
This commit is contained in:
parent
6c93608d78
commit
cf2498d819
1 changed files with 183 additions and 41 deletions
224
thermostat.yml
224
thermostat.yml
|
@ -125,12 +125,15 @@ sensor:
|
||||||
humidity:
|
humidity:
|
||||||
name: "Humidity"
|
name: "Humidity"
|
||||||
id: humidity
|
id: humidity
|
||||||
|
filters:
|
||||||
|
- round: 1
|
||||||
on_value:
|
on_value:
|
||||||
then:
|
then:
|
||||||
- lvgl.label.update:
|
- lvgl.label.update:
|
||||||
id: humidity_label
|
id: humidity_label
|
||||||
text: !lambda |-
|
text: !lambda |-
|
||||||
return to_string(' : ') + to_string(x) + to_string('%');
|
auto hum = " " + str_truncate(to_string(x), 4) + "%";
|
||||||
|
return hum;
|
||||||
|
|
||||||
pressure:
|
pressure:
|
||||||
name: "Pressure"
|
name: "Pressure"
|
||||||
|
@ -161,6 +164,71 @@ sensor:
|
||||||
unit_of_measurement: °C
|
unit_of_measurement: °C
|
||||||
icon: 'mdi:thermometer-alert'
|
icon: 'mdi:thermometer-alert'
|
||||||
|
|
||||||
|
mapping:
|
||||||
|
- id: weather_mapping
|
||||||
|
from: string
|
||||||
|
to: string
|
||||||
|
entries:
|
||||||
|
Clear: ""
|
||||||
|
light-rain: ""
|
||||||
|
medium-rain: ""
|
||||||
|
heavy-rain: ""
|
||||||
|
text_sensor:
|
||||||
|
- platform: homeassistant
|
||||||
|
id: weather
|
||||||
|
entity_id: sensor.pirateweather_summary
|
||||||
|
on_value:
|
||||||
|
then:
|
||||||
|
- lvgl.label.update:
|
||||||
|
id: out_weather_label
|
||||||
|
text: !lambda |-
|
||||||
|
return id(weather_mapping)[x];
|
||||||
|
- platform: homeassistant
|
||||||
|
id: weather_summary
|
||||||
|
entity_id: sensor.pirateweather_minutely_summary
|
||||||
|
on_value:
|
||||||
|
then:
|
||||||
|
- lvgl.label.update:
|
||||||
|
id: out_weather_sum_label
|
||||||
|
text: !lambda |-
|
||||||
|
return x;
|
||||||
|
- platform: homeassistant
|
||||||
|
id: weather_temp
|
||||||
|
entity_id: sensor.pirateweather_temperature
|
||||||
|
on_value:
|
||||||
|
then:
|
||||||
|
- lvgl.label.update:
|
||||||
|
id: out_temp_label
|
||||||
|
text: !lambda |-
|
||||||
|
auto temp = " " + x + "°";
|
||||||
|
return temp;
|
||||||
|
- platform: homeassistant
|
||||||
|
id: weather_hum
|
||||||
|
entity_id: weather.pirateweather
|
||||||
|
attribute: humidity
|
||||||
|
# on_value:
|
||||||
|
# then:
|
||||||
|
# - lvgl.label.update:
|
||||||
|
# id: out_hum_label
|
||||||
|
# text: !lambda |-
|
||||||
|
# auto hum = " " + x + "%";
|
||||||
|
# return hum;
|
||||||
|
- platform: homeassistant
|
||||||
|
id: weather_dew
|
||||||
|
entity_id: weather.pirateweather
|
||||||
|
attribute: dew_point
|
||||||
|
# on_value:
|
||||||
|
# then:
|
||||||
|
# - lvgl.label.update:
|
||||||
|
# id: out_dew_label
|
||||||
|
# text: !lambda |-
|
||||||
|
# auto temp = " " + x + "°";
|
||||||
|
# return temp;
|
||||||
|
# - platform: template
|
||||||
|
# id: weather_temp
|
||||||
|
# entity_id: weather.pirateweather
|
||||||
|
# attribute: temperature
|
||||||
|
|
||||||
switch:
|
switch:
|
||||||
- platform: homeassistant
|
- platform: homeassistant
|
||||||
id: heater
|
id: heater
|
||||||
|
@ -382,6 +450,14 @@ climate:
|
||||||
state:
|
state:
|
||||||
checked: true
|
checked: true
|
||||||
|
|
||||||
|
# output:
|
||||||
|
# - platform: gpio
|
||||||
|
# id: backlight
|
||||||
|
# pin:
|
||||||
|
# ch422g:
|
||||||
|
# number: 2
|
||||||
|
# allow_other_uses: true
|
||||||
|
|
||||||
# Example minimal configuration entry
|
# Example minimal configuration entry
|
||||||
display:
|
display:
|
||||||
- platform: rpi_dpi_rgb
|
- platform: rpi_dpi_rgb
|
||||||
|
@ -398,7 +474,7 @@ display:
|
||||||
number: 3
|
number: 3
|
||||||
enable_pin:
|
enable_pin:
|
||||||
ch422g:
|
ch422g:
|
||||||
allow_other_uses: true
|
# allow_other_uses: true
|
||||||
number: 2
|
number: 2
|
||||||
de_pin:
|
de_pin:
|
||||||
number: 5
|
number: 5
|
||||||
|
@ -408,7 +484,9 @@ display:
|
||||||
vsync_pin:
|
vsync_pin:
|
||||||
number: 3
|
number: 3
|
||||||
ignore_strapping_warning: true
|
ignore_strapping_warning: true
|
||||||
pclk_pin: 7
|
pclk_pin:
|
||||||
|
number: 7
|
||||||
|
# allow_other_uses: true
|
||||||
hsync_back_porch: 30
|
hsync_back_porch: 30
|
||||||
hsync_front_porch: 210
|
hsync_front_porch: 210
|
||||||
hsync_pulse_width: 30
|
hsync_pulse_width: 30
|
||||||
|
@ -427,6 +505,25 @@ font:
|
||||||
weight: 500
|
weight: 500
|
||||||
id: h2
|
id: h2
|
||||||
size: 40
|
size: 40
|
||||||
|
extras:
|
||||||
|
- file: "fonts/vm.ttf"
|
||||||
|
glyphs: [
|
||||||
|
"", # nf:wifi
|
||||||
|
"", # nf:up
|
||||||
|
"", # nf:down
|
||||||
|
"", # nf:off
|
||||||
|
"", # nf:humidity
|
||||||
|
"", # nf:temp
|
||||||
|
"", # nf:dew
|
||||||
|
"", # nf:clear
|
||||||
|
"", # nf:rain
|
||||||
|
"", # nf:snow
|
||||||
|
"", # nf:partlycloudy
|
||||||
|
"", # nf:stormy
|
||||||
|
"", # nf:cloudy
|
||||||
|
"", # nf:night
|
||||||
|
"", # nf:cloudynight
|
||||||
|
]
|
||||||
- file:
|
- file:
|
||||||
type: gfonts
|
type: gfonts
|
||||||
family: Quicksand
|
family: Quicksand
|
||||||
|
@ -441,6 +538,16 @@ font:
|
||||||
"", # nf:down
|
"", # nf:down
|
||||||
"", # nf:off
|
"", # nf:off
|
||||||
"", # nf:humidity
|
"", # nf:humidity
|
||||||
|
"", # nf:temp
|
||||||
|
"", # nf:dew
|
||||||
|
"", # nf:clear
|
||||||
|
"", # nf:rain
|
||||||
|
"", # nf:snow
|
||||||
|
"", # nf:partlycloudy
|
||||||
|
"", # nf:stormy
|
||||||
|
"", # nf:cloudy
|
||||||
|
"", # nf:night
|
||||||
|
"", # nf:cloudynight
|
||||||
]
|
]
|
||||||
- file:
|
- file:
|
||||||
type: gfonts
|
type: gfonts
|
||||||
|
@ -535,37 +642,33 @@ touchscreen:
|
||||||
touch.x_raw,
|
touch.x_raw,
|
||||||
touch.y_raw
|
touch.y_raw
|
||||||
);
|
);
|
||||||
on_release:
|
# on_release:
|
||||||
then:
|
# then:
|
||||||
- if:
|
# - if:
|
||||||
condition: lvgl.is_paused
|
# condition: lvgl.is_paused
|
||||||
then:
|
# then:
|
||||||
- lvgl.resume:
|
# - lvgl.resume:
|
||||||
- lvgl.widget.redraw:
|
# - lvgl.widget.redraw:
|
||||||
- switch.turn_on: display_backlight
|
# - switch.turn_on: display_backlight
|
||||||
|
|
||||||
color:
|
color:
|
||||||
- id: bg
|
- id: bg
|
||||||
hex: 282A36
|
hex: 282A36
|
||||||
|
|
||||||
output:
|
# output:
|
||||||
- platform: ledc
|
# - platform: ledc
|
||||||
pin:
|
# pin:
|
||||||
ch422g:
|
# number: 7
|
||||||
number: 2
|
# allow_other_uses: true
|
||||||
allow_other_uses: true
|
# frequency: 1220
|
||||||
mode:
|
# id: backlight
|
||||||
output: true
|
|
||||||
inverted: False
|
|
||||||
frequency: 1220
|
|
||||||
id: gpio_backlight_pwm
|
|
||||||
|
|
||||||
light:
|
# light:
|
||||||
- platform: monochromatic
|
# - platform: monochromatic
|
||||||
output: gpio_backlight_pwm
|
# output: backlight
|
||||||
name: ${devicename} Display Backlight
|
# name: Display Backlight
|
||||||
id: back_light
|
# id: back_light
|
||||||
restore_mode: ALWAYS_ON
|
# restore_mode: ALWAYS_ON
|
||||||
|
|
||||||
number:
|
number:
|
||||||
- platform: template
|
- platform: template
|
||||||
|
@ -588,12 +691,12 @@ lvgl:
|
||||||
bg_color: 0x57c7ff
|
bg_color: 0x57c7ff
|
||||||
knob:
|
knob:
|
||||||
bg_color: 0x57c7ff
|
bg_color: 0x57c7ff
|
||||||
on_idle:
|
# on_idle:
|
||||||
timeout: !lambda "return (id(display_timeout).state * 1000);"
|
# timeout: !lambda "return (id(display_timeout).state * 1000);"
|
||||||
then:
|
# then:
|
||||||
- logger.log: "LVGL is idle"
|
# - logger.log: "LVGL is idle"
|
||||||
- switch.turn_off: display_backlight
|
# - switch.turn_off: display_backlight
|
||||||
- lvgl.pause:
|
# - lvgl.pause:
|
||||||
|
|
||||||
pages:
|
pages:
|
||||||
- id: main_page
|
- id: main_page
|
||||||
|
@ -992,19 +1095,20 @@ lvgl:
|
||||||
text_color: 0xE2E4E5
|
text_color: 0xE2E4E5
|
||||||
|
|
||||||
- obj:
|
- obj:
|
||||||
height: 50%
|
height: 70%
|
||||||
y: 100
|
y: 80
|
||||||
width: 170
|
width: 170
|
||||||
x: 0
|
x: 0
|
||||||
bg_opa: 0
|
bg_opa: 0
|
||||||
border_width: 0
|
border_width: 0
|
||||||
|
scrollable: false
|
||||||
layout:
|
layout:
|
||||||
type: flex
|
type: flex
|
||||||
pad_row: 40
|
pad_row: 20
|
||||||
pad_column: 4
|
pad_column: 2
|
||||||
flex_flow: COLUMN
|
flex_flow: COLUMN
|
||||||
flex_align_main: CENTER
|
flex_align_main: START
|
||||||
flex_align_cross: CENTER
|
flex_align_cross: START
|
||||||
flex_align_track: CENTER
|
flex_align_track: CENTER
|
||||||
widgets:
|
widgets:
|
||||||
- label:
|
- label:
|
||||||
|
@ -1012,7 +1116,45 @@ lvgl:
|
||||||
text_font: h3
|
text_font: h3
|
||||||
text: " : 50%"
|
text: " : 50%"
|
||||||
text_color: ${color_white}
|
text_color: ${color_white}
|
||||||
align: center
|
align: LEFT_MID
|
||||||
|
- obj:
|
||||||
|
bg_color: ${color_white}
|
||||||
|
height: 2
|
||||||
|
width: 100%
|
||||||
|
pad_top: 50
|
||||||
|
- label:
|
||||||
|
id: out_weather_label
|
||||||
|
text_font: h3
|
||||||
|
text: ""
|
||||||
|
text_color: ${color_white}
|
||||||
|
pad_top: 50
|
||||||
|
align: LEFT_MID
|
||||||
|
long_mode: WRAP
|
||||||
|
- label:
|
||||||
|
id: out_weather_sum_label
|
||||||
|
text_font: h4
|
||||||
|
text: ""
|
||||||
|
text_color: ${color_white}
|
||||||
|
align: LEFT_MID
|
||||||
|
long_mode: WRAP
|
||||||
|
- label:
|
||||||
|
id: out_temp_label
|
||||||
|
text_font: h2
|
||||||
|
text: ""
|
||||||
|
text_color: ${color_white}
|
||||||
|
align: LEFT_MID
|
||||||
|
# - label:
|
||||||
|
# id: out_hum_label
|
||||||
|
# text_font: h3
|
||||||
|
# text: " : 50%"
|
||||||
|
# text_color: ${color_white}
|
||||||
|
# align: LEFT_MID
|
||||||
|
# - label:
|
||||||
|
# id: out_dew_label
|
||||||
|
# text_font: h3
|
||||||
|
# text: "."
|
||||||
|
# text_color: ${color_white}
|
||||||
|
# align: LEFT_MID
|
||||||
|
|
||||||
|
|
||||||
- label:
|
- label:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue