1904 lines
64 KiB
YAML
1904 lines
64 KiB
YAML
|
||
## You can change the friendly name if you wish on line 7 below. The friendly name is how the device will show in HA
|
||
## However the <name:> is how HA connects to the device eg. esp32-s3-box-3.local is the mDNS hostname for the device.
|
||
## Once added to HA changing the device name can lead to connection issues, between HA and the device.
|
||
|
||
substitutions:
|
||
friendly_name: ESP32-S3-Box-3
|
||
device_name: esp32-s3-box-3
|
||
####################################################################
|
||
#### change the micro wake word to be used on the line below #####
|
||
#### options are okay_nabu, hey_jarvis, alexa #####
|
||
####################################################################
|
||
micro_wake_word_model: okay_nabu
|
||
####################################################################
|
||
#### Days and months ####
|
||
## Change the values on the right to match your locale ##
|
||
monday: Monday
|
||
tuesday: Tuesday
|
||
wednesday: Wednesday
|
||
thursday: Thursday
|
||
friday: Friday
|
||
saturday: Saturday
|
||
sunday: Sunday
|
||
|
||
jan: January
|
||
feb: February
|
||
mar: March
|
||
apr: April
|
||
may: May
|
||
jun: June
|
||
jul: July
|
||
aug: August
|
||
sept: September
|
||
oct: October
|
||
nov: November
|
||
dec: December
|
||
|
||
api_password: !secret esp32-s3-box-3_api
|
||
ota_password: !secret ota_password
|
||
wifi_ssid: !secret wifi_ssid
|
||
wifi_password: !secret wifi_password
|
||
gateway: !secret ip_gateway
|
||
subnet: !secret ip_subnet
|
||
ip: !secret esp32-s3-box-3_ip
|
||
version: "2024.06.01"
|
||
hvac_sensor: temp_local
|
||
|
||
#pins
|
||
pin_mute: GPIO1
|
||
pin_but_tl: GPIO0
|
||
pin_backlight: GPIO47
|
||
pin_lcd_cs: GPIO5
|
||
pin_lcd_dc: GPIO4
|
||
pin_lcd_reset: GPIO48
|
||
pin_lcd_clk: GPIO7
|
||
pin_lcd_mosi: GPIO6
|
||
pin_ir_tx: GPIO38
|
||
pin_ir_rx: GPIO39
|
||
pin_sda_a: GPIO08
|
||
pin_scl_a: GPIO18
|
||
pin_sda_b: GPIO41
|
||
pin_scl_b: GPIO40
|
||
pin_presence: GPIO21
|
||
pin_vbatt: GPIO10
|
||
pin_i2s_lrclk: GPIO45
|
||
pin_i2s_bclk: GPIO17
|
||
pin_i2s_mclk: GPIO2
|
||
pin_i2s_dout: GPIO15
|
||
pin_dac_enable: GPIO46
|
||
pin_i2s_din: GPIO16
|
||
pin_touch_interrupt: GPIO3
|
||
|
||
packages:
|
||
board: !include boards/esp32s3box_custom.yaml
|
||
connection: !include common/wifi_voice_custom.yaml
|
||
time: !include templates/time.yaml
|
||
temp: !include sensors/s3box_aht20.yaml
|
||
battery: !include sensors/s3box_battery.yaml
|
||
i2c: !include interfaces/s3box_i2c.yaml
|
||
irblast: !include interfaces/s3box_ir.yaml
|
||
clima: !include templates/climate_sens.yaml
|
||
logger: !include templates/logger.yaml
|
||
|
||
interval:
|
||
- interval: 10s
|
||
then:
|
||
- if:
|
||
condition:
|
||
- lambda: 'return { (id(api_connection) != true) };'
|
||
then:
|
||
- if:
|
||
condition:
|
||
api.connected:
|
||
then:
|
||
- lambda: "id(api_connection) = true;"
|
||
else:
|
||
- if:
|
||
condition:
|
||
not:
|
||
api.connected:
|
||
then:
|
||
- lambda: "id(api_connection) = false;"
|
||
- interval: 10s
|
||
then:
|
||
- if:
|
||
condition:
|
||
- lambda: 'return { (id(wifi_connection) != true) };'
|
||
then:
|
||
- if:
|
||
condition:
|
||
wifi.connected:
|
||
then:
|
||
- lambda: "id(wifi_connection) = true;"
|
||
else:
|
||
- if:
|
||
condition:
|
||
not:
|
||
wifi.connected:
|
||
then:
|
||
- lambda: "id(wifi_connection) = false;"
|
||
- interval: 20s
|
||
then:
|
||
- component.update: s3_box_lcd
|
||
|
||
select:
|
||
- platform: template
|
||
entity_category: config
|
||
name: Wake word engine location
|
||
id: wake_word_engine_location
|
||
optimistic: true
|
||
restore_value: true
|
||
options:
|
||
- In Home Assistant
|
||
- On device
|
||
initial_option: In Home Assistant
|
||
on_value:
|
||
- if:
|
||
condition:
|
||
lambda: return x == "In Home Assistant";
|
||
then:
|
||
- micro_wake_word.stop
|
||
- delay: 500ms
|
||
- lambda: id(va).set_use_wake_word(true);
|
||
- voice_assistant.start_continuous:
|
||
- text_sensor.template.publish:
|
||
id: wakeword_location
|
||
state: !lambda 'return "Home Assistant";'
|
||
- component.update: s3_box_lcd
|
||
- if:
|
||
condition:
|
||
lambda: return x == "On device";
|
||
then:
|
||
- text_sensor.template.publish:
|
||
id: wakeword_location
|
||
state: !lambda 'return "On Device";'
|
||
- lambda: id(va).set_use_wake_word(false);
|
||
- voice_assistant.stop
|
||
- delay: 500ms
|
||
- micro_wake_word.start
|
||
- component.update: s3_box_lcd
|
||
script:
|
||
- id: set_volume
|
||
then:
|
||
- media_player.volume_set:
|
||
volume: !lambda return 0.5 + id(speaker_volume) * 0.05 ;
|
||
|
||
- id: saver_enabled
|
||
then:
|
||
- if:
|
||
condition:
|
||
switch.is_on: s_saver
|
||
then:
|
||
- light.turn_on:
|
||
id: led
|
||
brightness: 100%
|
||
- delay: 30s
|
||
- light.turn_on:
|
||
id: led
|
||
brightness: 30%
|
||
- display.page.show: saver_page
|
||
- component.update: s3_box_lcd
|
||
- if:
|
||
condition:
|
||
- switch.is_on: s_saver_mode
|
||
then:
|
||
- delay: 180s
|
||
- light.turn_off: led
|
||
mode: restart
|
||
|
||
- id: saver_enabled_manual
|
||
then:
|
||
- if:
|
||
condition:
|
||
switch.is_on: s_saver
|
||
then:
|
||
- light.turn_on:
|
||
id: led
|
||
brightness: 30%
|
||
- display.page.show: saver_page
|
||
- component.update: s3_box_lcd
|
||
- if:
|
||
condition:
|
||
- switch.is_on: s_saver_mode
|
||
then:
|
||
- delay: 180s
|
||
- light.turn_off: led
|
||
mode: restart
|
||
|
||
globals:
|
||
- id: wifi_connection
|
||
type: bool
|
||
restore_value: no
|
||
initial_value: "false"
|
||
- id: api_connection
|
||
type: bool
|
||
restore_value: no
|
||
initial_value: "false"
|
||
- id: mute_value
|
||
type: bool
|
||
restore_value: no
|
||
initial_value: "false"
|
||
- id: speaker_volume
|
||
type: int
|
||
restore_value: no
|
||
initial_value: '5'
|
||
|
||
button:
|
||
- platform: restart
|
||
id: reboot
|
||
name: "Reboot"
|
||
|
||
switch:
|
||
- platform: template
|
||
name: Mute
|
||
id: mute_switch
|
||
optimistic: True
|
||
on_turn_on:
|
||
- voice_assistant.stop:
|
||
- micro_wake_word.stop:
|
||
- delay: 50ms
|
||
- lambda: id(va).set_use_wake_word(false);
|
||
- media_player.volume_set: 0%
|
||
on_turn_off:
|
||
- media_player.volume_set: 100%
|
||
- if:
|
||
condition:
|
||
lambda: return id(wake_word_engine_location).state == "In Home Assistant";
|
||
then:
|
||
- lambda: id(va).set_use_wake_word(true);
|
||
- delay: 50ms
|
||
- voice_assistant.start_continuous:
|
||
else:
|
||
- delay: 50ms
|
||
- micro_wake_word.start
|
||
restore_mode: RESTORE_DEFAULT_OFF
|
||
|
||
- platform: template
|
||
name: Screensaver
|
||
id: s_saver
|
||
optimistic: true
|
||
restore_mode: RESTORE_DEFAULT_OFF
|
||
# on_turn_on:
|
||
# - script.execute: saver_enabled
|
||
# on_turn_off:
|
||
# - script.execute: saver_enabled
|
||
|
||
- platform: template
|
||
name: Screensaver_mode
|
||
id: s_saver_mode
|
||
optimistic: true
|
||
restore_mode: RESTORE_DEFAULT_OFF
|
||
# on_turn_on:
|
||
# - script.execute: saver_enabled
|
||
# on_turn_off:
|
||
# - script.execute: saver_enabled
|
||
|
||
- platform: template
|
||
name: Screensaver_mode
|
||
id: s_saver_presc
|
||
optimistic: true
|
||
restore_mode: RESTORE_DEFAULT_OFF
|
||
# on_turn_on:
|
||
# - script.execute: saver_enabled
|
||
# on_turn_off:
|
||
# - script.execute: saver_enabled
|
||
|
||
output:
|
||
- platform: ledc
|
||
pin: ${pin_backlight}
|
||
id: backlight_output
|
||
|
||
light:
|
||
- platform: monochromatic
|
||
id: led
|
||
name: LCD Backlight
|
||
entity_category: config
|
||
output: backlight_output
|
||
restore_mode: RESTORE_DEFAULT_ON
|
||
default_transition_length: 500ms
|
||
|
||
|
||
text_sensor:
|
||
- platform: template
|
||
id: wakeword_location
|
||
|
||
i2s_audio:
|
||
- id: i2s_shared
|
||
i2s_lrclk_pin:
|
||
number: ${pin_i2s_lrclk}
|
||
ignore_strapping_warning: true
|
||
i2s_bclk_pin: ${pin_i2s_bclk}
|
||
i2s_mclk_pin: ${pin_i2s_mclk}
|
||
access_mode: duplex
|
||
|
||
adf_pipeline:
|
||
- platform: i2s_audio
|
||
type: audio_out
|
||
id: adf_i2s_out
|
||
i2s_audio_id: i2s_shared
|
||
i2s_dout_pin: ${pin_i2s_dout}
|
||
adf_alc: false
|
||
dac:
|
||
i2c_id: bus_a
|
||
model: es8311
|
||
address: 0x18
|
||
enable_pin:
|
||
number: ${pin_dac_enable}
|
||
ignore_strapping_warning: true
|
||
sample_rate: 16000
|
||
bits_per_sample: 16bit
|
||
fixed_settings: true
|
||
|
||
- platform: i2s_audio
|
||
type: audio_in
|
||
id: adf_i2s_in
|
||
i2s_audio_id: i2s_shared
|
||
i2s_din_pin: ${pin_i2s_din}
|
||
pdm: false
|
||
adc:
|
||
i2c_id: bus_a
|
||
model: es7210
|
||
address: 0x40
|
||
sample_rate: 16000
|
||
bits_per_sample: 16bit
|
||
fixed_settings: true
|
||
|
||
media_player:
|
||
- platform: adf_pipeline
|
||
id: adf_media_player
|
||
name: s3-box_media_player
|
||
internal: false
|
||
keep_pipeline_alive: true
|
||
announcement_audio:
|
||
sample_rate: 24000
|
||
bits_per_sample: 16
|
||
num_channels: 1
|
||
pipeline:
|
||
- self
|
||
- resampler
|
||
- adf_i2s_out
|
||
on_play:
|
||
- display.page.show: media_page
|
||
- component.update: s3_box_lcd
|
||
|
||
microphone:
|
||
- platform: adf_pipeline
|
||
id: box_mic
|
||
keep_pipeline_alive: true
|
||
pipeline:
|
||
- adf_i2s_in
|
||
- resampler
|
||
- self
|
||
|
||
micro_wake_word:
|
||
models:
|
||
- model: ${micro_wake_word_model}
|
||
on_wake_word_detected:
|
||
- voice_assistant.start:
|
||
wake_word: !lambda return wake_word;
|
||
|
||
voice_assistant:
|
||
id: va
|
||
microphone: box_mic
|
||
media_player: adf_media_player
|
||
use_wake_word: true
|
||
noise_suppression_level: 2
|
||
auto_gain: 31dBFS
|
||
volume_multiplier: 4.0
|
||
on_listening:
|
||
- script.execute: saver_enabled
|
||
- display.page.show: listening_page
|
||
- component.update: s3_box_lcd
|
||
on_stt_vad_end:
|
||
- display.page.show: thinking_page
|
||
- component.update: s3_box_lcd
|
||
on_tts_end:
|
||
- display.page.show: replying_page
|
||
- component.update: s3_box_lcd
|
||
- delay: 5s
|
||
- display.page.show: idle_page
|
||
- component.update: s3_box_lcd
|
||
on_end:
|
||
- if:
|
||
condition:
|
||
lambda: return id(wake_word_engine_location).state == "On device";
|
||
then:
|
||
- wait_until:
|
||
not:
|
||
voice_assistant.is_running:
|
||
- micro_wake_word.start
|
||
else:
|
||
- wait_until:
|
||
not:
|
||
voice_assistant.is_running:
|
||
- lambda: id(va).set_use_wake_word(false);
|
||
- voice_assistant.stop:
|
||
- delay: 100ms
|
||
- lambda: id(va).set_use_wake_word(true);
|
||
- delay: 100ms
|
||
- voice_assistant.start_continuous:
|
||
on_client_connected:
|
||
- if:
|
||
condition:
|
||
lambda: return id(wake_word_engine_location).state == "On device";
|
||
then:
|
||
- micro_wake_word.start
|
||
else:
|
||
- lambda: id(va).set_use_wake_word(true);
|
||
- voice_assistant.start_continuous:
|
||
|
||
image:
|
||
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/images/error.png"
|
||
id: error_img
|
||
resize: 320x240
|
||
type: RGB24
|
||
use_transparency: true
|
||
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/images/idle.png"
|
||
id: idle_img
|
||
resize: 320x240
|
||
type: RGB24
|
||
use_transparency: true
|
||
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/images/listening.png"
|
||
id: listening_img
|
||
resize: 320x240
|
||
type: RGB24
|
||
use_transparency: true
|
||
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/images/thinking.png"
|
||
id: thinking_img
|
||
resize: 320x240
|
||
type: RGB24
|
||
use_transparency: true
|
||
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/images/replying.png"
|
||
id: replying_img
|
||
resize: 320x240
|
||
type: RGB24
|
||
use_transparency: true
|
||
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/images/loading.png"
|
||
id: loading_img
|
||
resize: 320x240
|
||
type: RGB24
|
||
use_transparency: true
|
||
|
||
font:
|
||
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/fonts/consola.ttf"
|
||
id: my_font
|
||
size: 14
|
||
glyphs:
|
||
'&@!"''%()+=,-_.:°/$€£¥?0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyzÀàÁáÂâÃãÄäĀāĂăÅåǺǻẠạĄąÆæǼǽĆćĈĉČčĊċÇçĎďĐđÐðÈèÉéÊêẼẽĚěËëĒēĔĕĖėẸẹĘęĜĝǦǧĞğĠġĢģĤĥĦħıÌìÍíÎîĨĩÏïĪīĬĭİỊịĮįȷĴĵĶķĸĹ弾ĻļŁłĿŀŃńÑñŇňŅņƝɲŊŋʼnÒòÓóÔôÕõÖöŌōŎŏŐőỌọǪǫØøǾǿŒœŔŕŘřŖŗŚśŜŝŠšŞşȘșẞߍťŢţȚțŦŧÞþÙùÚúÛûŨũÜüŪūŬŭŮůŰűỤụŲųẀẁẂẃŴŵẄẅỲỳÝýŶŷỸỹŸÿȲȳŹźŽžŻżIJijƏə'
|
||
|
||
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/fonts/consola.ttf"
|
||
id: my_font2
|
||
size: 72
|
||
glyphs:
|
||
'&@!"''%()+=,-_.:°/$€£¥?0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyzÀàÁáÂâÃãÄäĀāĂăÅåǺǻẠạĄąÆæǼǽĆćĈĉČčĊċÇçĎďĐđÐðÈèÉéÊêẼẽĚěËëĒēĔĕĖėẸẹĘęĜĝǦǧĞğĠġĢģĤĥĦħıÌìÍíÎîĨĩÏïĪīĬĭİỊịĮįȷĴĵĶķĸĹ弾ĻļŁłĿŀŃńÑñŇňŅņƝɲŊŋʼnÒòÓóÔôÕõÖöŌōŎŏŐőỌọǪǫØøǾǿŒœŔŕŘřŖŗŚśŜŝŠšŞşȘșẞߍťŢţȚțŦŧÞþÙùÚúÛûŨũÜüŪūŬŭŮůŰűỤụŲųẀẁẂẃŴŵẄẅỲỳÝýŶŷỸỹŸÿȲȳŹźŽžŻżIJijƏə'
|
||
|
||
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/fonts/consola.ttf"
|
||
id: my_font3
|
||
size: 28
|
||
glyphs:
|
||
'&@!"''%()+=,-_.:°/$€£¥?0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyzÀàÁáÂâÃãÄäĀāĂăÅåǺǻẠạĄąÆæǼǽĆćĈĉČčĊċÇçĎďĐđÐðÈèÉéÊêẼẽĚěËëĒēĔĕĖėẸẹĘęĜĝǦǧĞğĠġĢģĤĥĦħıÌìÍíÎîĨĩÏïĪīĬĭİỊịĮįȷĴĵĶķĸĹ弾ĻļŁłĿŀŃńÑñŇňŅņƝɲŊŋʼnÒòÓóÔôÕõÖöŌōŎŏŐőỌọǪǫØøǾǿŒœŔŕŘřŖŗŚśŜŝŠšŞşȘșẞߍťŢţȚțŦŧÞþÙùÚúÛûŨũÜüŪūŬŭŮůŰűỤụŲųẀẁẂẃŴŵẄẅỲỳÝýŶŷỸỹŸÿȲȳŹźŽžŻżIJijƏə'
|
||
|
||
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/fonts/consola.ttf"
|
||
id: my_font4
|
||
size: 40
|
||
glyphs:
|
||
'&@!"''%()+=,-_.:°/$€£¥?0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyzÀàÁáÂâÃãÄäĀāĂăÅåǺǻẠạĄąÆæǼǽĆćĈĉČčĊċÇçĎďĐđÐðÈèÉéÊêẼẽĚěËëĒēĔĕĖėẸẹĘęĜĝǦǧĞğĠġĢģĤĥĦħıÌìÍíÎîĨĩÏïĪīĬĭİỊịĮįȷĴĵĶķĸĹ弾ĻļŁłĿŀŃńÑñŇňŅņƝɲŊŋʼnÒòÓóÔôÕõÖöŌōŎŏŐőỌọǪǫØøǾǿŒœŔŕŘřŖŗŚśŜŝŠšŞşȘșẞߍťŢţȚțŦŧÞþÙùÚúÛûŨũÜüŪūŬŭŮůŰűỤụŲųẀẁẂẃŴŵẄẅỲỳÝýŶŷỸỹŸÿȲȳŹźŽžŻżIJijƏə'
|
||
|
||
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/fonts/consola.ttf"
|
||
id: my_font5
|
||
size: 22
|
||
glyphs:
|
||
'&@!"''%()+=,-_.:°/$€£¥?0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyzÀàÁáÂâÃãÄäĀāĂăÅåǺǻẠạĄąÆæǼǽĆćĈĉČčĊċÇçĎďĐđÐðÈèÉéÊêẼẽĚěËëĒēĔĕĖėẸẹĘęĜĝǦǧĞğĠġĢģĤĥĦħıÌìÍíÎîĨĩÏïĪīĬĭİỊịĮįȷĴĵĶķĸĹ弾ĻļŁłĿŀŃńÑñŇňŅņƝɲŊŋʼnÒòÓóÔôÕõÖöŌōŎŏŐőỌọǪǫØøǾǿŒœŔŕŘřŖŗŚśŜŝŠšŞşȘșẞߍťŢţȚțŦŧÞþÙùÚúÛûŨũÜüŪūŬŭŮůŰűỤụŲųẀẁẂẃŴŵẄẅỲỳÝýŶŷỸỹŸÿȲȳŹźŽžŻżIJijƏə'
|
||
|
||
|
||
|
||
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/fonts/materialdesignicons-webfont.ttf"
|
||
id: icon_font_55
|
||
size: 45
|
||
glyphs: [
|
||
"\U000F0079",#battery 100%
|
||
"\U000F0082",#battery 90%
|
||
"\U000F0081",#battery 80%
|
||
"\U000F0080",#battery 70%
|
||
"\U000F007F",#battery 60%
|
||
"\U000F007E",#battery 50%
|
||
"\U000F007D",#battery 40%
|
||
"\U000F007C",#battery 30%
|
||
"\U000F007B",#battery 20%
|
||
"\U000F007A",#battery 10%
|
||
"\U000F10CD",#battery warning
|
||
"\U000F050F",#temp sensor
|
||
"\U000F024A",#garden/flower
|
||
"\U000F16BD",#wifi connected
|
||
"\U000F16BC",#wifidisconnected
|
||
"\U000F07D0",#api connected
|
||
"\U000F12A8",#touch button
|
||
"\U000F0EBA",#stats
|
||
"\U000F087B",#api disconnected
|
||
"\U000F0B6C",#car
|
||
"\U000F057E",#speaker on
|
||
"\U000F0581",#speaker off
|
||
"\U000F0493",#settings cog
|
||
"\U000F1C6F",#info
|
||
"\U000F06E8",#light bulb illuminated
|
||
"\U000F0335",#light bulb off
|
||
"\U000F075A",#music
|
||
"\U000F0A19",#toggle off
|
||
"\U000F0521",#toggle on
|
||
]
|
||
|
||
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/fonts/materialdesignicons-webfont.ttf"
|
||
id: icon_font_80
|
||
size: 75
|
||
glyphs: [
|
||
"\U000F1322",#tools
|
||
"\U000F12D4",#garage open
|
||
"\U000F12D3",#garage closed
|
||
"\U000F0238",#heating
|
||
"\U000F0B2C",#up
|
||
"\U000F0B26",#down
|
||
"\U000F024A",#garden
|
||
"\U000F1987",#floods
|
||
"\U000F04C8",#spots
|
||
"\U000F1722",#fire off
|
||
"\U000F068A",#alarm unarmed
|
||
"\U000F099D",#alarm armed
|
||
"\U000F1A12",#home button
|
||
"\U000F0D90",#monitor_off
|
||
"\U000F0B28",#left
|
||
"\U000F192D",#electricity
|
||
"\U000F1A1B",#gas
|
||
"\U000F0B6C",#car battery
|
||
"\U000F0873",#car miles non
|
||
"\U000F0875",#car miles low
|
||
"\U000F0874",#car miles full
|
||
"\U000F0B2A",#right
|
||
"\U000F04B9",#living room
|
||
"\U000F1061",#dining
|
||
"\U000F06E8",#light bulb illuminated
|
||
"\U000F0335",#light bulb off
|
||
"\U000F07F4",#tv
|
||
"\U000F1160",#kitchen
|
||
"\U000F0210",#fan
|
||
"\U000F050F",#temp
|
||
"\U000F01AE",#gbp pound symbol
|
||
"\U000F1747",#tall lamp
|
||
"\U000F0769",#ceiling
|
||
"\U000F075A",#music
|
||
"\U000F05CB",#voice
|
||
"\U000F0FCE",#scene
|
||
"\U000F040A",#play
|
||
"\U000F03E4",#pause
|
||
"\U000F04DB",#stop
|
||
"\U000F04AD",#next track
|
||
"\U000F04AE",#previous track
|
||
"\U000F075E",#vol minus
|
||
"\U000F075D",#vol plus
|
||
"\U000F040E",#play/pause
|
||
|
||
]
|
||
|
||
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/fonts/DSEG14Classic-Regular.ttf"
|
||
id: my_fontseg
|
||
size: 72
|
||
|
||
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/fonts/DSEG7Classic-Regular.ttf"
|
||
id: my_fontseg2
|
||
size: 72
|
||
|
||
color:
|
||
- id: green
|
||
hex: '75D15F'
|
||
- id: red
|
||
hex: 'FF3131'
|
||
- id: blue
|
||
hex: '47B7E9'
|
||
- id: blue_drk
|
||
hex: '085296'
|
||
- id: amber
|
||
hex: 'FBAB35'
|
||
- id: lime
|
||
hex: '20FC30'
|
||
- id: pink
|
||
hex: 'D92BBC'
|
||
- id: yellow
|
||
hex: 'FFC000'
|
||
- id: black
|
||
hex: '000000'
|
||
- id: white
|
||
hex: 'ffffff'
|
||
- id: purple
|
||
hex: '73264D'
|
||
- id: light_blue
|
||
hex: 'CFE2F3'
|
||
|
||
spi:
|
||
clk_pin: ${pin_lcd_clk}
|
||
mosi_pin: ${pin_lcd_mosi}
|
||
|
||
display:
|
||
- platform: ili9xxx
|
||
id: s3_box_lcd
|
||
model: S3BOX
|
||
data_rate: 40MHz
|
||
cs_pin: ${pin_lcd_cs}
|
||
dc_pin: ${pin_lcd_dc}
|
||
reset_pin:
|
||
number: ${pin_lcd_reset}
|
||
inverted: true
|
||
update_interval: never
|
||
##################################################################################################
|
||
################ The below section defines, what is displayed on the screen, ##############
|
||
################ the colours and mdi icons are defined above under font: and Color: ##############
|
||
################ they are then referenced in the config below. ##############
|
||
##################################################################################################
|
||
pages:
|
||
- id: idle_page ##### home page ######
|
||
lambda: |-
|
||
it.fill(id(black));
|
||
if(id(api_connection) == true) {
|
||
it.printf(15, 5, id(icon_font_55), blue, "\U000F07D0");
|
||
} else {
|
||
it.printf(15, 5, id(icon_font_55), red, "\U000F087B");
|
||
}
|
||
if(id(wifi_connection) == true) {
|
||
it.printf(80, 5, id(icon_font_55), lime, "\U000F16BD");
|
||
} else {
|
||
it.printf(80, 5, id(icon_font_55), red, "\U000F16BC");
|
||
}
|
||
if(id(battery_voltage).has_state ()) {
|
||
if(id(battery_voltage).state <= 2.7) {
|
||
// Replace battery, less than 10% 420, 558 / 87
|
||
it.printf(135, 5, id(icon_font_55), "\U000F10CD");
|
||
} else if (id(battery_percent).state >= 98) {
|
||
// "\U000F0079" # mdi-battery
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F0079");
|
||
} else if (id(battery_percent).state >= 90) {
|
||
// "\U000F0082" # mdi-battery-90
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F0082");
|
||
} else if (id(battery_percent).state >= 80) {
|
||
// "\U000F0081" # mdi-battery-80
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F0081");
|
||
} else if (id(battery_percent).state >= 70) {
|
||
// "\U000F0080" # mdi-battery-70
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F0080");
|
||
} else if (id(battery_percent).state >= 60) {
|
||
// "\U000F007F" # mdi-battery-60
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F007F");
|
||
} else if (id(battery_percent).state >= 50) {
|
||
// "\U000F007E" # mdi-battery-50
|
||
it.printf(135, 5, id(icon_font_55), amber, "\U000F007E");
|
||
} else if (id(battery_percent).state >= 40) {
|
||
// "\U000F007D" # mdi-battery-40
|
||
it.printf(135, 5, id(icon_font_55), amber, "\U000F007D");
|
||
} else if (id(battery_percent).state >= 30) {
|
||
// "\U000F007C" # mdi-battery-30
|
||
it.printf(135, 5, id(icon_font_55), red, "\U000F007C");
|
||
} else if (id(battery_percent).state >= 20) {
|
||
// "\U000F007B" # mdi-battery-20
|
||
it.printf(135, 5, id(icon_font_55), red, "\U000F007B");
|
||
} else if (id(battery_percent).state >= 10) {
|
||
// "\U000F007A" # mdi-battery-10
|
||
it.printf(135, 5, id(icon_font_55), red, "\U000F007A");
|
||
}
|
||
}
|
||
if(id(mute_switch).state) {
|
||
it.printf(190, 5, id(icon_font_55), red, "\U000F0581");
|
||
} else {
|
||
it.printf(190, 5, id(icon_font_55), lime, "\U000F057E");
|
||
}
|
||
it.printf(250, 5, id(icon_font_55), pink, "\U000F1C6F");
|
||
|
||
|
||
it.printf(20, 75, id(icon_font_80), blue,"\U000F050F");
|
||
it.printf(40, 120, id(my_font3), white, "%.f", id(temp_local).state);
|
||
it.printf(120, 75, id(icon_font_80), yellow,"\U000F06E8" );
|
||
it.printf(220, 75, id(icon_font_80), purple,"\U000F0210");
|
||
|
||
|
||
it.printf(20, 155, id(icon_font_80), red,"\U000F075A");
|
||
it.printf(120, 155, id(icon_font_80), blue,"\U000F0FCE");
|
||
it.printf(220, 155, id(icon_font_80), lime,"\U000F05CB");
|
||
|
||
|
||
|
||
|
||
- id: template_page
|
||
lambda: |-
|
||
it.fill(id(black));
|
||
if(id(api_connection) == true) {
|
||
it.printf(15, 5, id(icon_font_55), blue, "\U000F07D0");
|
||
} else {
|
||
it.printf(15, 5, id(icon_font_55), red, "\U000F087B");
|
||
}
|
||
if(id(wifi_connection) == true) {
|
||
it.printf(80, 5, id(icon_font_55), lime, "\U000F16BD");
|
||
} else {
|
||
it.printf(80, 5, id(icon_font_55), red, "\U000F16BC");
|
||
}
|
||
if(id(battery_voltage).has_state ()) {
|
||
if(id(battery_voltage).state <= 2.7) {
|
||
// Replace battery, less than 10% 420, 558 / 87
|
||
it.printf(135, 5, id(icon_font_55), "\U000F10CD");
|
||
} else if (id(battery_percent).state >= 98) {
|
||
// "\U000F0079" # mdi-battery
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F0079");
|
||
} else if (id(battery_percent).state >= 90) {
|
||
// "\U000F0082" # mdi-battery-90
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F0082");
|
||
} else if (id(battery_percent).state >= 80) {
|
||
// "\U000F0081" # mdi-battery-80
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F0081");
|
||
} else if (id(battery_percent).state >= 70) {
|
||
// "\U000F0080" # mdi-battery-70
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F0080");
|
||
} else if (id(battery_percent).state >= 60) {
|
||
// "\U000F007F" # mdi-battery-60
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F007F");
|
||
} else if (id(battery_percent).state >= 50) {
|
||
// "\U000F007E" # mdi-battery-50
|
||
it.printf(135, 5, id(icon_font_55), amber, "\U000F007E");
|
||
} else if (id(battery_percent).state >= 40) {
|
||
// "\U000F007D" # mdi-battery-40
|
||
it.printf(135, 5, id(icon_font_55), amber, "\U000F007D");
|
||
} else if (id(battery_percent).state >= 30) {
|
||
// "\U000F007C" # mdi-battery-30
|
||
it.printf(135, 5, id(icon_font_55), red, "\U000F007C");
|
||
} else if (id(battery_percent).state >= 20) {
|
||
// "\U000F007B" # mdi-battery-20
|
||
it.printf(135, 5, id(icon_font_55), red, "\U000F007B");
|
||
} else if (id(battery_percent).state >= 10) {
|
||
// "\U000F007A" # mdi-battery-10
|
||
it.printf(135, 5, id(icon_font_55), red, "\U000F007A");
|
||
}
|
||
}
|
||
|
||
|
||
if(id(mute_switch).state) {
|
||
it.printf(190, 5, id(icon_font_55), red, "\U000F0581");
|
||
} else {
|
||
it.printf(190, 5, id(icon_font_55), lime, "\U000F057E");
|
||
}
|
||
if(id(mute_switch).state) {
|
||
it.printf(190, 5, id(icon_font_55), red, "\U000F0581");
|
||
} else {
|
||
it.printf(190, 5, id(icon_font_55), lime, "\U000F057E");
|
||
}
|
||
|
||
it.printf(250, 5, id(icon_font_55), pink, "\U000F1C6F");
|
||
|
||
it.printf(20, 75, id(icon_font_80), light_blue,"\U000F06E8");
|
||
it.printf(120, 75, id(icon_font_80), light_blue,"\U000F06E8");
|
||
it.printf(220, 75, id(icon_font_80), light_blue, "\U000F06E8");
|
||
|
||
|
||
it.printf(20, 155, id(icon_font_80), light_blue,"\U000F06E8");
|
||
it.printf(120, 155, id(icon_font_80), light_blue,"\U000F06E8");
|
||
it.printf(220, 155, id(icon_font_80), light_blue, "\U000F06E8");
|
||
|
||
- id: info_page
|
||
lambda: |-
|
||
it.fill(id(black));
|
||
if(id(api_connection) == true) {
|
||
it.printf(15, 5, id(icon_font_55), blue, "\U000F07D0");
|
||
} else {
|
||
it.printf(15, 5, id(icon_font_55), red, "\U000F087B");
|
||
}
|
||
if(id(wifi_connection) == true) {
|
||
it.printf(80, 5, id(icon_font_55), lime, "\U000F16BD");
|
||
} else {
|
||
it.printf(80, 5, id(icon_font_55), red, "\U000F16BC");
|
||
}
|
||
if(id(battery_voltage).has_state ()) {
|
||
if(id(battery_voltage).state <= 2.7) {
|
||
// Replace battery, less than 10% 420, 558 / 87
|
||
it.printf(135, 5, id(icon_font_55), "\U000F10CD");
|
||
} else if (id(battery_percent).state >= 98) {
|
||
// "\U000F0079" # mdi-battery
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F0079");
|
||
} else if (id(battery_percent).state >= 90) {
|
||
// "\U000F0082" # mdi-battery-90
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F0082");
|
||
} else if (id(battery_percent).state >= 80) {
|
||
// "\U000F0081" # mdi-battery-80
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F0081");
|
||
} else if (id(battery_percent).state >= 70) {
|
||
// "\U000F0080" # mdi-battery-70
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F0080");
|
||
} else if (id(battery_percent).state >= 60) {
|
||
// "\U000F007F" # mdi-battery-60
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F007F");
|
||
} else if (id(battery_percent).state >= 50) {
|
||
// "\U000F007E" # mdi-battery-50
|
||
it.printf(135, 5, id(icon_font_55), amber, "\U000F007E");
|
||
} else if (id(battery_percent).state >= 40) {
|
||
// "\U000F007D" # mdi-battery-40
|
||
it.printf(135, 5, id(icon_font_55), amber, "\U000F007D");
|
||
} else if (id(battery_percent).state >= 30) {
|
||
// "\U000F007C" # mdi-battery-30
|
||
it.printf(135, 5, id(icon_font_55), red, "\U000F007C");
|
||
} else if (id(battery_percent).state >= 20) {
|
||
// "\U000F007B" # mdi-battery-20
|
||
it.printf(135, 5, id(icon_font_55), red, "\U000F007B");
|
||
} else if (id(battery_percent).state >= 10) {
|
||
// "\U000F007A" # mdi-battery-10
|
||
it.printf(135, 5, id(icon_font_55), red, "\U000F007A");
|
||
}
|
||
}
|
||
if(id(mute_switch).state) {
|
||
it.printf(190, 5, id(icon_font_55), red, "\U000F0581");
|
||
} else {
|
||
it.printf(190, 5, id(icon_font_55), lime, "\U000F057E");
|
||
}
|
||
if(id(mute_switch).state) {
|
||
it.printf(190, 5, id(icon_font_55), red, "\U000F0581");
|
||
} else {
|
||
it.printf(190, 5, id(icon_font_55), lime, "\U000F057E");
|
||
}
|
||
it.printf(250, 5, id(icon_font_55), pink, "\U000F1C6F");
|
||
it.printf(160, 66, id(my_font5), yellow, TextAlign::CENTER, "IP: %s", id(ipaddr).state.c_str());
|
||
it.printf(155, 90, id(my_font5), lime, TextAlign::CENTER, "tap to change");
|
||
it.printf(20, 105, id(my_font5), yellow, "WakeWord: ");
|
||
it.printf(220, 115, id(my_font5), light_blue, TextAlign::CENTER, "%s", id(wakeword_location).state.c_str());
|
||
it.printf(90, 145, id(my_font5), yellow, "screensaver :");
|
||
if(id(s_saver).state) {
|
||
it.printf(255, 135, id(icon_font_55), lime, "\U000F0521");
|
||
} else {
|
||
it.printf(255, 135, id(icon_font_55), blue_drk, "\U000F0A19");
|
||
}
|
||
it.printf(35, 205, id(my_font5), yellow, "Timeout to blank :");
|
||
if(id(s_saver_mode).state) {
|
||
it.printf(255, 195, id(icon_font_55), lime, "\U000F0521");
|
||
} else {
|
||
it.printf(255, 195, id(icon_font_55), blue_drk, "\U000F0A19");
|
||
}
|
||
it.printf(10, 175, id(my_font5), yellow, "wake on presence :");
|
||
if(id(s_saver_presc).state) {
|
||
it.printf(255, 165, id(icon_font_55), lime, "\U000F0521");
|
||
} else {
|
||
it.printf(255, 165, id(icon_font_55), blue_drk, "\U000F0A19");
|
||
}
|
||
|
||
- id: climate_page
|
||
lambda: |-
|
||
it.fill(id(black));
|
||
if(id(api_connection) == true) {
|
||
it.printf(15, 5, id(icon_font_55), blue, "\U000F07D0");
|
||
} else {
|
||
it.printf(15, 5, id(icon_font_55), red, "\U000F087B");
|
||
}
|
||
if(id(wifi_connection) == true) {
|
||
it.printf(80, 5, id(icon_font_55), lime, "\U000F16BD");
|
||
} else {
|
||
it.printf(80, 5, id(icon_font_55), red, "\U000F16BC");
|
||
}
|
||
if(id(battery_voltage).has_state ()) {
|
||
if(id(battery_voltage).state <= 2.7) {
|
||
// Replace battery, less than 10% 420, 558 / 87
|
||
it.printf(135, 5, id(icon_font_55), "\U000F10CD");
|
||
} else if (id(battery_percent).state >= 98) {
|
||
// "\U000F0079" # mdi-battery
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F0079");
|
||
} else if (id(battery_percent).state >= 90) {
|
||
// "\U000F0082" # mdi-battery-90
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F0082");
|
||
} else if (id(battery_percent).state >= 80) {
|
||
// "\U000F0081" # mdi-battery-80
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F0081");
|
||
} else if (id(battery_percent).state >= 70) {
|
||
// "\U000F0080" # mdi-battery-70
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F0080");
|
||
} else if (id(battery_percent).state >= 60) {
|
||
// "\U000F007F" # mdi-battery-60
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F007F");
|
||
} else if (id(battery_percent).state >= 50) {
|
||
// "\U000F007E" # mdi-battery-50
|
||
it.printf(135, 5, id(icon_font_55), amber, "\U000F007E");
|
||
} else if (id(battery_percent).state >= 40) {
|
||
// "\U000F007D" # mdi-battery-40
|
||
it.printf(135, 5, id(icon_font_55), amber, "\U000F007D");
|
||
} else if (id(battery_percent).state >= 30) {
|
||
// "\U000F007C" # mdi-battery-30
|
||
it.printf(135, 5, id(icon_font_55), red, "\U000F007C");
|
||
} else if (id(battery_percent).state >= 20) {
|
||
// "\U000F007B" # mdi-battery-20
|
||
it.printf(135, 5, id(icon_font_55), red, "\U000F007B");
|
||
} else if (id(battery_percent).state >= 10) {
|
||
// "\U000F007A" # mdi-battery-10
|
||
it.printf(135, 5, id(icon_font_55), red, "\U000F007A");
|
||
}
|
||
}
|
||
|
||
|
||
if(id(mute_switch).state) {
|
||
it.printf(190, 5, id(icon_font_55), red, "\U000F0581");
|
||
} else {
|
||
it.printf(190, 5, id(icon_font_55), lime, "\U000F057E");
|
||
}
|
||
if(id(mute_switch).state) {
|
||
it.printf(190, 5, id(icon_font_55), red, "\U000F0581");
|
||
} else {
|
||
it.printf(190, 5, id(icon_font_55), lime, "\U000F057E");
|
||
}
|
||
|
||
it.printf(250, 5, id(icon_font_55), pink, "\U000F1C6F");
|
||
|
||
|
||
it.printf(20, 75, id(icon_font_80), light_blue,"\U000F050F");
|
||
it.printf(120, 75, id(icon_font_80), light_blue,"\U000F050F");
|
||
it.printf(220, 75, id(icon_font_80), light_blue, "\U000F050F");
|
||
|
||
|
||
it.printf(20, 155, id(icon_font_80), light_blue,"\U000F050F");
|
||
it.printf(120, 155, id(icon_font_80), light_blue,"\U000F050F");
|
||
it.printf(220, 155, id(icon_font_80), light_blue, "\U000F050F");
|
||
|
||
- id: lights_page
|
||
lambda: |-
|
||
it.fill(id(black));
|
||
if(id(api_connection) == true) {
|
||
it.printf(15, 5, id(icon_font_55), blue, "\U000F07D0");
|
||
} else {
|
||
it.printf(15, 5, id(icon_font_55), red, "\U000F087B");
|
||
}
|
||
if(id(wifi_connection) == true) {
|
||
it.printf(80, 5, id(icon_font_55), lime, "\U000F16BD");
|
||
} else {
|
||
it.printf(80, 5, id(icon_font_55), red, "\U000F16BC");
|
||
}
|
||
if(id(battery_voltage).has_state ()) {
|
||
if(id(battery_voltage).state <= 2.7) {
|
||
// Replace battery, less than 10% 420, 558 / 87
|
||
it.printf(135, 5, id(icon_font_55), "\U000F10CD");
|
||
} else if (id(battery_percent).state >= 98) {
|
||
// "\U000F0079" # mdi-battery
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F0079");
|
||
} else if (id(battery_percent).state >= 90) {
|
||
// "\U000F0082" # mdi-battery-90
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F0082");
|
||
} else if (id(battery_percent).state >= 80) {
|
||
// "\U000F0081" # mdi-battery-80
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F0081");
|
||
} else if (id(battery_percent).state >= 70) {
|
||
// "\U000F0080" # mdi-battery-70
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F0080");
|
||
} else if (id(battery_percent).state >= 60) {
|
||
// "\U000F007F" # mdi-battery-60
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F007F");
|
||
} else if (id(battery_percent).state >= 50) {
|
||
// "\U000F007E" # mdi-battery-50
|
||
it.printf(135, 5, id(icon_font_55), amber, "\U000F007E");
|
||
} else if (id(battery_percent).state >= 40) {
|
||
// "\U000F007D" # mdi-battery-40
|
||
it.printf(135, 5, id(icon_font_55), amber, "\U000F007D");
|
||
} else if (id(battery_percent).state >= 30) {
|
||
// "\U000F007C" # mdi-battery-30
|
||
it.printf(135, 5, id(icon_font_55), red, "\U000F007C");
|
||
} else if (id(battery_percent).state >= 20) {
|
||
// "\U000F007B" # mdi-battery-20
|
||
it.printf(135, 5, id(icon_font_55), red, "\U000F007B");
|
||
} else if (id(battery_percent).state >= 10) {
|
||
// "\U000F007A" # mdi-battery-10
|
||
it.printf(135, 5, id(icon_font_55), red, "\U000F007A");
|
||
}
|
||
}
|
||
|
||
|
||
if(id(mute_switch).state) {
|
||
it.printf(190, 5, id(icon_font_55), red, "\U000F0581");
|
||
} else {
|
||
it.printf(190, 5, id(icon_font_55), lime, "\U000F057E");
|
||
}
|
||
if(id(mute_switch).state) {
|
||
it.printf(190, 5, id(icon_font_55), red, "\U000F0581");
|
||
} else {
|
||
it.printf(190, 5, id(icon_font_55), lime, "\U000F057E");
|
||
}
|
||
it.printf(250, 5, id(icon_font_55), pink, "\U000F1C6F");
|
||
|
||
it.printf(20, 75, id(icon_font_80), light_blue,"\U000F0335");
|
||
it.printf(120, 75, id(icon_font_80), light_blue,"\U000F0335");
|
||
it.printf(220, 75, id(icon_font_80), light_blue, "\U000F0335");
|
||
|
||
|
||
it.printf(20, 155, id(icon_font_80), light_blue,"\U000F0335");
|
||
it.printf(120, 155, id(icon_font_80), light_blue,"\U000F0335");
|
||
it.printf(220, 155, id(icon_font_80), light_blue, "\U000F0335");
|
||
|
||
- id: media_page
|
||
lambda: |-
|
||
it.fill(id(black));
|
||
if(id(api_connection) == true) {
|
||
it.printf(15, 5, id(icon_font_55), blue, "\U000F07D0");
|
||
} else {
|
||
it.printf(15, 5, id(icon_font_55), red, "\U000F087B");
|
||
}
|
||
if(id(wifi_connection) == true) {
|
||
it.printf(80, 5, id(icon_font_55), lime, "\U000F16BD");
|
||
} else {
|
||
it.printf(80, 5, id(icon_font_55), red, "\U000F16BC");
|
||
}
|
||
if(id(battery_voltage).has_state ()) {
|
||
if(id(battery_voltage).state <= 2.7) {
|
||
// Replace battery, less than 10% 420, 558 / 87
|
||
it.printf(135, 5, id(icon_font_55), "\U000F10CD");
|
||
} else if (id(battery_percent).state >= 98) {
|
||
// "\U000F0079" # mdi-battery
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F0079");
|
||
} else if (id(battery_percent).state >= 90) {
|
||
// "\U000F0082" # mdi-battery-90
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F0082");
|
||
} else if (id(battery_percent).state >= 80) {
|
||
// "\U000F0081" # mdi-battery-80
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F0081");
|
||
} else if (id(battery_percent).state >= 70) {
|
||
// "\U000F0080" # mdi-battery-70
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F0080");
|
||
} else if (id(battery_percent).state >= 60) {
|
||
// "\U000F007F" # mdi-battery-60
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F007F");
|
||
} else if (id(battery_percent).state >= 50) {
|
||
// "\U000F007E" # mdi-battery-50
|
||
it.printf(135, 5, id(icon_font_55), amber, "\U000F007E");
|
||
} else if (id(battery_percent).state >= 40) {
|
||
// "\U000F007D" # mdi-battery-40
|
||
it.printf(135, 5, id(icon_font_55), amber, "\U000F007D");
|
||
} else if (id(battery_percent).state >= 30) {
|
||
// "\U000F007C" # mdi-battery-30
|
||
it.printf(135, 5, id(icon_font_55), red, "\U000F007C");
|
||
} else if (id(battery_percent).state >= 20) {
|
||
// "\U000F007B" # mdi-battery-20
|
||
it.printf(135, 5, id(icon_font_55), red, "\U000F007B");
|
||
} else if (id(battery_percent).state >= 10) {
|
||
// "\U000F007A" # mdi-battery-10
|
||
it.printf(135, 5, id(icon_font_55), red, "\U000F007A");
|
||
}
|
||
}
|
||
|
||
|
||
if(id(mute_switch).state) {
|
||
it.printf(190, 5, id(icon_font_55), red, "\U000F0581");
|
||
} else {
|
||
it.printf(190, 5, id(icon_font_55), lime, "\U000F057E");
|
||
}
|
||
if(id(mute_switch).state) {
|
||
it.printf(190, 5, id(icon_font_55), red, "\U000F0581");
|
||
} else {
|
||
it.printf(190, 5, id(icon_font_55), lime, "\U000F057E");
|
||
}
|
||
|
||
it.printf(250, 5, id(icon_font_55), pink, "\U000F1C6F");
|
||
|
||
it.printf(20, 120, id(icon_font_80), blue,"\U000F075E");
|
||
it.printf(120, 120, id(icon_font_80), blue,"\U000F040E");
|
||
it.printf(220, 120, id(icon_font_80), blue,"\U000F075D");
|
||
|
||
- id: scenes_page
|
||
lambda: |-
|
||
it.fill(id(black));
|
||
if(id(api_connection) == true) {
|
||
it.printf(15, 5, id(icon_font_55), blue, "\U000F07D0");
|
||
} else {
|
||
it.printf(15, 5, id(icon_font_55), red, "\U000F087B");
|
||
}
|
||
if(id(wifi_connection) == true) {
|
||
it.printf(80, 5, id(icon_font_55), lime, "\U000F16BD");
|
||
} else {
|
||
it.printf(80, 5, id(icon_font_55), red, "\U000F16BC");
|
||
}
|
||
if(id(battery_voltage).has_state ()) {
|
||
if(id(battery_voltage).state <= 2.7) {
|
||
// Replace battery, less than 10% 420, 558 / 87
|
||
it.printf(135, 5, id(icon_font_55), "\U000F10CD");
|
||
} else if (id(battery_percent).state >= 98) {
|
||
// "\U000F0079" # mdi-battery
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F0079");
|
||
} else if (id(battery_percent).state >= 90) {
|
||
// "\U000F0082" # mdi-battery-90
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F0082");
|
||
} else if (id(battery_percent).state >= 80) {
|
||
// "\U000F0081" # mdi-battery-80
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F0081");
|
||
} else if (id(battery_percent).state >= 70) {
|
||
// "\U000F0080" # mdi-battery-70
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F0080");
|
||
} else if (id(battery_percent).state >= 60) {
|
||
// "\U000F007F" # mdi-battery-60
|
||
it.printf(135, 5, id(icon_font_55), green, "\U000F007F");
|
||
} else if (id(battery_percent).state >= 50) {
|
||
// "\U000F007E" # mdi-battery-50
|
||
it.printf(135, 5, id(icon_font_55), amber, "\U000F007E");
|
||
} else if (id(battery_percent).state >= 40) {
|
||
// "\U000F007D" # mdi-battery-40
|
||
it.printf(135, 5, id(icon_font_55), amber, "\U000F007D");
|
||
} else if (id(battery_percent).state >= 30) {
|
||
// "\U000F007C" # mdi-battery-30
|
||
it.printf(135, 5, id(icon_font_55), red, "\U000F007C");
|
||
} else if (id(battery_percent).state >= 20) {
|
||
// "\U000F007B" # mdi-battery-20
|
||
it.printf(135, 5, id(icon_font_55), red, "\U000F007B");
|
||
} else if (id(battery_percent).state >= 10) {
|
||
// "\U000F007A" # mdi-battery-10
|
||
it.printf(135, 5, id(icon_font_55), red, "\U000F007A");
|
||
}
|
||
}
|
||
|
||
|
||
if(id(mute_switch).state) {
|
||
it.printf(190, 5, id(icon_font_55), red, "\U000F0581");
|
||
} else {
|
||
it.printf(190, 5, id(icon_font_55), lime, "\U000F057E");
|
||
}
|
||
if(id(mute_switch).state) {
|
||
it.printf(190, 5, id(icon_font_55), red, "\U000F0581");
|
||
} else {
|
||
it.printf(190, 5, id(icon_font_55), lime, "\U000F057E");
|
||
}
|
||
it.printf(250, 5, id(icon_font_55), pink, "\U000F1C6F");
|
||
|
||
it.printf(20, 75, id(icon_font_80), light_blue,"\U000F0FCE");
|
||
it.printf(120, 75, id(icon_font_80), light_blue,"\U000F0FCE");
|
||
it.printf(220, 75, id(icon_font_80), light_blue, "\U000F0FCE");
|
||
|
||
|
||
it.printf(20, 155, id(icon_font_80), light_blue,"\U000F0FCE");
|
||
it.printf(120, 155, id(icon_font_80), light_blue,"\U000F0FCE");
|
||
it.printf(220, 155, id(icon_font_80), light_blue, "\U000F0FCE");
|
||
|
||
|
||
- id: loading_page
|
||
lambda: |-
|
||
it.fill(Color::BLACK);
|
||
it.image((it.get_width() / 2), (it.get_height() / 2), id(loading_img), ImageAlign::CENTER);
|
||
|
||
- id: listening_page
|
||
lambda: |-
|
||
it.fill(Color::BLACK);
|
||
it.image((it.get_width() / 2), (it.get_height() / 2), id(listening_img), ImageAlign::CENTER);
|
||
|
||
- id: thinking_page
|
||
lambda: |-
|
||
it.fill(Color::BLACK);
|
||
it.image((it.get_width() / 2), (it.get_height() / 2), id(thinking_img), ImageAlign::CENTER);
|
||
|
||
- id: replying_page
|
||
lambda: |-
|
||
it.fill(Color::BLACK);
|
||
it.image((it.get_width() / 2), (it.get_height() / 2), id(replying_img), ImageAlign::CENTER);
|
||
- id: error_page
|
||
lambda: |-
|
||
it.fill(Color::BLACK);
|
||
it.image((it.get_width() / 2), (it.get_height() / 2), id(error_img), ImageAlign::CENTER);
|
||
- id: muted_page
|
||
lambda: |-
|
||
it.fill(Color::BLACK);
|
||
it.printf(160, 120, id(my_font4), yellow, TextAlign::CENTER, "Mic & Speaker - Muted");
|
||
|
||
- id: saver_page
|
||
lambda: |-
|
||
it.fill(Color::BLACK);
|
||
|
||
const char *days[] {"${sunday}","${monday}","${tuesday}","${wednesday}","${thursday}","${friday}","${saturday}"};
|
||
it.printf(165, 10, id(my_font3), light_blue, TextAlign::RIGHT, days[id(homeassistant_time).now().day_of_week - 1]);
|
||
|
||
it.strftime(180, 10, id(my_font3), light_blue, "%d", id(homeassistant_time).now());
|
||
|
||
const char *months[] {"${jan}","${feb}","${mar}","${apr}","${may}","${jun}","${jul}","${aug}","${sept}","${oct}","${nov}","${dec}"};
|
||
it.printf(220, 10, id(my_font3), light_blue, TextAlign::LEFT, months[id(homeassistant_time).now().month - 1]);
|
||
|
||
it.strftime(160, 85, id(my_fontseg2), TextAlign::CENTER, "%H :%M", id(homeassistant_time).now());
|
||
it.printf(160, 180, id(my_fontseg2), light_blue, TextAlign::CENTER, "%.f°C", id(temp_local).state);
|
||
|
||
# i2c:
|
||
# - id: bus_a
|
||
# sda: ${pin_sda_a}
|
||
# scl: ${pin_scl_a}
|
||
# scan: false
|
||
# sda_pullup_enabled: true
|
||
# scl_pullup_enabled: true
|
||
# frequency: 100kHz
|
||
|
||
# - sda: ${pin_sda_b}
|
||
# scl: ${pin_scl_b}
|
||
# scan: false
|
||
# sda_pullup_enabled: true
|
||
# scl_pullup_enabled: true
|
||
# frequency: 50kHz
|
||
# id: bus_b
|
||
|
||
|
||
touchscreen:
|
||
platform: gt911
|
||
i2c_id: bus_a
|
||
id: gt911_touchscreen
|
||
interrupt_pin:
|
||
number: ${pin_touch_interrupt}
|
||
ignore_strapping_warning: true
|
||
|
||
on_update:
|
||
- script.execute: saver_enabled
|
||
|
||
binary_sensor:
|
||
|
||
###### top left hand physical button #######
|
||
|
||
- platform: gpio
|
||
pin:
|
||
number: ${pin_but_tl}
|
||
mode: INPUT_PULLUP
|
||
inverted: true
|
||
ignore_strapping_warning: true
|
||
name: Top Left Button
|
||
entity_category: diagnostic
|
||
on_press:
|
||
- light.toggle: led
|
||
|
||
|
||
####### red circle home button #####################
|
||
- platform: gt911
|
||
name: "Home"
|
||
index: 0
|
||
on_press:
|
||
if:
|
||
condition:
|
||
- display.is_displaying_page: idle_page
|
||
then:
|
||
- script.execute: saver_enabled_manual
|
||
else:
|
||
- light.turn_on:
|
||
id: led
|
||
brightness: 100%
|
||
- display.page.show: idle_page
|
||
- component.update: s3_box_lcd
|
||
|
||
###### radar sensor ########
|
||
- platform: gpio
|
||
pin:
|
||
number: ${pin_presence}
|
||
name: "Presence detect"
|
||
disabled_by_default: false
|
||
device_class: "occupancy"
|
||
on_state:
|
||
if:
|
||
condition:
|
||
- switch.is_on: s_saver_presc
|
||
- display.is_displaying_page: saver_page
|
||
then:
|
||
- display.page.show: idle_page
|
||
- component.update: s3_box_lcd
|
||
- light.turn_on:
|
||
id: led
|
||
brightness: 100%
|
||
- script.execute: saver_enabled
|
||
|
||
|
||
########## Top status bar buttons 1-5 ##########
|
||
- platform: touchscreen
|
||
id: status_bar_1
|
||
x_min: 5
|
||
x_max: 60
|
||
y_min: 0
|
||
y_max: 55
|
||
# on_click:
|
||
# min_length: 0ms
|
||
# max_length: 500ms
|
||
# then:
|
||
# - display.page.show: template_page
|
||
# - component.update: s3_box_lcd
|
||
|
||
- platform: touchscreen
|
||
id: status_bar_2
|
||
internal: true
|
||
x_min: 65
|
||
x_max: 125
|
||
y_min: 0
|
||
y_max: 55
|
||
# on_click:
|
||
# min_length: 10ms
|
||
# max_length: 500ms
|
||
# then:
|
||
# - display.page.show: template_page
|
||
# - component.update: s3_box_lcd
|
||
|
||
|
||
- platform: touchscreen
|
||
id: status_bar_3
|
||
internal: true
|
||
x_min: 130
|
||
x_max: 185
|
||
y_min: 0
|
||
y_max: 55
|
||
# on_click:
|
||
# min_length: 10ms
|
||
# max_length: 500ms
|
||
# then:
|
||
# - display.page.show: template_page
|
||
# - component.update: s3_box_lcd
|
||
|
||
- platform: touchscreen
|
||
id: status_bar_4
|
||
internal: true
|
||
x_min: 190
|
||
x_max: 245
|
||
y_min: 0
|
||
y_max: 55
|
||
on_click:
|
||
min_length: 10ms
|
||
max_length: 500ms
|
||
then:
|
||
- switch.toggle: mute_switch
|
||
- component.update: s3_box_lcd
|
||
|
||
- platform: touchscreen
|
||
name: status_bar_5
|
||
internal: true
|
||
x_min: 250
|
||
x_max: 305
|
||
y_min: 0
|
||
y_max: 55
|
||
on_click:
|
||
min_length: 10ms
|
||
max_length: 500ms
|
||
then:
|
||
- display.page.show: info_page
|
||
- component.update: s3_box_lcd
|
||
|
||
#########################################
|
||
########## control buttons 1 -6 ########
|
||
- platform: touchscreen
|
||
page_id: idle_page
|
||
id: control_1
|
||
internal: true
|
||
x_min: 5
|
||
x_max: 105
|
||
y_min: 90
|
||
y_max: 170
|
||
on_click:
|
||
min_length: 10ms
|
||
max_length: 500ms
|
||
then:
|
||
- display.page.show: climate_page
|
||
- component.update: s3_box_lcd
|
||
|
||
- platform: touchscreen
|
||
page_id: idle_page
|
||
id: control_2
|
||
internal: true
|
||
x_min: 110
|
||
x_max: 210
|
||
y_min: 90
|
||
y_max: 170
|
||
on_click:
|
||
min_length: 10ms
|
||
max_length: 500ms
|
||
then:
|
||
- display.page.show: lights_page
|
||
- component.update: s3_box_lcd
|
||
|
||
- platform: touchscreen
|
||
page_id: idle_page
|
||
id: control_3
|
||
internal: true
|
||
x_min: 215
|
||
x_max: 315
|
||
y_min: 90
|
||
y_max: 170
|
||
on_click:
|
||
min_length: 10ms
|
||
max_length: 500ms
|
||
then:
|
||
- display.page.show: template_page
|
||
- component.update: s3_box_lcd
|
||
|
||
- platform: touchscreen
|
||
page_id: idle_page
|
||
id: control_4
|
||
internal: true
|
||
x_min: 5
|
||
x_max: 105
|
||
y_min: 175
|
||
y_max: 240
|
||
on_click:
|
||
min_length: 10ms
|
||
max_length: 500ms
|
||
then:
|
||
- display.page.show: media_page
|
||
- component.update: s3_box_lcd
|
||
|
||
- platform: touchscreen
|
||
page_id: idle_page
|
||
id: control_5
|
||
internal: true
|
||
x_min: 110
|
||
x_max: 210
|
||
y_min: 175
|
||
y_max: 240
|
||
on_click:
|
||
min_length: 10ms
|
||
max_length: 500ms
|
||
then:
|
||
- display.page.show: scenes_page
|
||
- component.update: s3_box_lcd
|
||
|
||
- platform: touchscreen
|
||
page_id: idle_page
|
||
id: control_6
|
||
internal: true
|
||
x_min: 215
|
||
x_max: 315
|
||
y_min: 175
|
||
y_max: 240
|
||
on_press:
|
||
then:
|
||
- micro_wake_word.stop
|
||
- delay: 50ms
|
||
- lambda: id(va).set_use_wake_word(false);
|
||
- delay: 50ms
|
||
- voice_assistant.stop:
|
||
- delay: 50ms
|
||
- voice_assistant.start
|
||
- display.page.show: listening_page
|
||
- component.update: s3_box_lcd
|
||
on_release:
|
||
- delay: 100ms
|
||
- if:
|
||
condition:
|
||
lambda: return id(wake_word_engine_location).state == "In Home Assistant";
|
||
then:
|
||
- voice_assistant.stop:
|
||
- lambda: id(va).set_use_wake_word(true);
|
||
- delay: 10ms
|
||
- voice_assistant.start_continuous:
|
||
else:
|
||
- voice_assistant.stop:
|
||
- delay: 100ms
|
||
- micro_wake_word.start
|
||
|
||
|
||
########### end of control buttons #######################
|
||
########### set of 6 control buttons per page to get you started - just give each button an id: also uncomment the 3 lines below y_max: and add your automation #######################
|
||
#### climate page ###
|
||
- platform: touchscreen
|
||
page_id: climate_page
|
||
id: climate1
|
||
internal: true
|
||
x_min: 5
|
||
x_max: 105
|
||
y_min: 90
|
||
y_max: 170
|
||
# on_click:
|
||
# min_length: 10ms
|
||
# max_length: 500ms
|
||
|
||
#### make sure that the following 2 lines are uncommented and sit at the bottom of this block after your action ###
|
||
# - display.page.show: climate_page
|
||
# - component.update: s3_box_lcd
|
||
|
||
- platform: touchscreen
|
||
page_id: climate_page
|
||
id: climate2
|
||
internal: true
|
||
x_min: 110
|
||
x_max: 210
|
||
y_min: 90
|
||
y_max: 170
|
||
# on_click:
|
||
# min_length: 10ms
|
||
# max_length: 500ms
|
||
|
||
#### make sure that the following 2 lines are uncommented and sit at the bottom of this block after your action ###
|
||
# - display.page.show: climate_page
|
||
# - component.update: s3_box_lcd
|
||
|
||
- platform: touchscreen
|
||
page_id: climate_page
|
||
id: climate3
|
||
internal: true
|
||
x_min: 215
|
||
x_max: 315
|
||
y_min: 90
|
||
y_max: 170
|
||
# on_click:
|
||
# min_length: 10ms
|
||
# max_length: 500ms
|
||
|
||
#### make sure that the following 2 lines are uncommented and sit at the bottom of this block after your action ###
|
||
# - display.page.show: climate_page
|
||
# - component.update: s3_box_lcd
|
||
|
||
- platform: touchscreen
|
||
page_id: climate_page
|
||
id: climate4
|
||
internal: true
|
||
x_min: 5
|
||
x_max: 105
|
||
y_min: 175
|
||
y_max: 240
|
||
# on_click:
|
||
# min_length: 10ms
|
||
# max_length: 500ms
|
||
|
||
#### make sure that the following 2 lines are uncommented and sit at the bottom of this block after your action ###
|
||
# - display.page.show: climate_page
|
||
# - component.update: s3_box_lcd
|
||
|
||
- platform: touchscreen
|
||
page_id: climate_page
|
||
id: climate5
|
||
internal: true
|
||
x_min: 110
|
||
x_max: 210
|
||
y_min: 175
|
||
y_max: 240
|
||
# on_click:
|
||
# min_length: 10ms
|
||
# max_length: 500ms
|
||
|
||
#### make sure that the following 2 lines are uncommented and sit at the bottom of this block after your action ###
|
||
# - display.page.show: climate_page
|
||
# - component.update: s3_box_lcd
|
||
|
||
- platform: touchscreen
|
||
page_id: climate_page
|
||
id: climate6
|
||
internal: true
|
||
x_min: 215
|
||
x_max: 315
|
||
y_min: 175
|
||
y_max: 240
|
||
# on_click:
|
||
# min_length: 10ms
|
||
# max_length: 500ms
|
||
|
||
#### make sure that the following 2 lines are uncommented and sit at the bottom of this block after your action ###
|
||
# - display.page.show: climate_page
|
||
# - component.update: s3_box_lcd
|
||
|
||
- platform: touchscreen
|
||
page_id: lights_page
|
||
id: lights1
|
||
internal: true
|
||
x_min: 5
|
||
x_max: 105
|
||
y_min: 90
|
||
y_max: 170
|
||
# on_click:
|
||
# min_length: 10ms
|
||
# max_length: 500ms
|
||
|
||
#### make sure that the following 2 lines are uncommented and sit at the bottom of this block after your action ###
|
||
# - display.page.show: lights_page
|
||
# - component.update: s3_box_lcd
|
||
|
||
- platform: touchscreen
|
||
page_id: lights_page
|
||
id: lights2
|
||
internal: true
|
||
x_min: 110
|
||
x_max: 210
|
||
y_min: 90
|
||
y_max: 170
|
||
# on_click:
|
||
# min_length: 10ms
|
||
# max_length: 500ms
|
||
|
||
#### make sure that the following 2 lines are uncommented and sit at the bottom of this block after your action ###
|
||
# - display.page.show: lights_page
|
||
# - component.update: s3_box_lcd
|
||
|
||
- platform: touchscreen
|
||
page_id: lights_page
|
||
id: lights3
|
||
internal: true
|
||
x_min: 215
|
||
x_max: 315
|
||
y_min: 90
|
||
y_max: 170
|
||
# on_click:
|
||
# min_length: 10ms
|
||
# max_length: 500ms
|
||
|
||
#### make sure that the following 2 lines are uncommented and sit at the bottom of this block after your action ###
|
||
# - display.page.show: lights_page
|
||
# - component.update: s3_box_lcd
|
||
|
||
- platform: touchscreen
|
||
page_id: lights_page
|
||
id: lights4
|
||
internal: true
|
||
x_min: 5
|
||
x_max: 105
|
||
y_min: 175
|
||
y_max: 240
|
||
# on_click:
|
||
# min_length: 10ms
|
||
# max_length: 500ms
|
||
|
||
#### make sure that the following 2 lines are uncommented and sit at the bottom of this block after your action ###
|
||
# - display.page.show: lights_page
|
||
# - component.update: s3_box_lcd
|
||
|
||
- platform: touchscreen
|
||
page_id: lights_page
|
||
id: lights5
|
||
internal: true
|
||
x_min: 110
|
||
x_max: 210
|
||
y_min: 175
|
||
y_max: 240
|
||
# on_click:
|
||
# min_length: 10ms
|
||
# max_length: 500ms
|
||
|
||
#### make sure that the following 2 lines are uncommented and sit at the bottom of this block after your action ###
|
||
# - display.page.show: lights_page
|
||
# - component.update: s3_box_lcd
|
||
|
||
- platform: touchscreen
|
||
page_id: lights_page
|
||
id: lights6
|
||
internal: true
|
||
x_min: 215
|
||
x_max: 315
|
||
y_min: 175
|
||
y_max: 240
|
||
# on_click:
|
||
# min_length: 10ms
|
||
# max_length: 500ms
|
||
|
||
#### make sure that the following 2 lines are uncommented and sit at the bottom of this block after your action ###
|
||
# - display.page.show: lights_page
|
||
# - component.update: s3_box_lcd
|
||
|
||
###### media player ######
|
||
- platform: touchscreen
|
||
page_id: media_page
|
||
name: Volume Minus
|
||
x_min: 5
|
||
x_max: 105
|
||
y_min: 90
|
||
y_max: 170
|
||
on_click:
|
||
min_length: 0ms
|
||
max_length: 500ms
|
||
then:
|
||
- logger.log: "Volume Minus pressed"
|
||
- lambda: |-
|
||
if (id(speaker_volume) > 0) {
|
||
id(speaker_volume) -= 1;
|
||
}
|
||
- component.update: s3_box_lcd
|
||
- script.execute: set_volume
|
||
|
||
- platform: touchscreen
|
||
page_id: media_page
|
||
name: Volume Plus
|
||
x_min: 215
|
||
x_max: 315
|
||
y_min: 90
|
||
y_max: 170
|
||
on_click:
|
||
min_length: 0ms
|
||
max_length: 500ms
|
||
then:
|
||
- logger.log: "Volume Plus pressed"
|
||
- lambda: |-
|
||
if (id(speaker_volume) < 10) {
|
||
id(speaker_volume) += 1;
|
||
}
|
||
- component.update: s3_box_lcd
|
||
- script.execute: set_volume
|
||
|
||
- platform: touchscreen
|
||
page_id: media_page
|
||
name: Play Pause
|
||
x_min: 110
|
||
x_max: 210
|
||
y_min: 90
|
||
y_max: 170
|
||
on_click:
|
||
min_length: 0ms
|
||
max_length: 500ms
|
||
then:
|
||
- if:
|
||
condition:
|
||
media_player.is_idle:
|
||
then:
|
||
- media_player.play
|
||
else:
|
||
- media_player.stop
|
||
- logger.log: "Play Paused pressed"
|
||
|
||
#### scenes page ###
|
||
- platform: touchscreen
|
||
page_id: scenes_page
|
||
id: scenes1
|
||
internal: true
|
||
x_min: 5
|
||
x_max: 105
|
||
y_min: 90
|
||
y_max: 170
|
||
# on_click:
|
||
# min_length: 10ms
|
||
# max_length: 500ms
|
||
|
||
#### make sure that the following 2 lines are uncommented and sit at the bottom of this block after your action ###
|
||
# - display.page.show: scenes_page
|
||
# - component.update: s3_box_lcd
|
||
|
||
- platform: touchscreen
|
||
page_id: scenes_page
|
||
id: scenes2
|
||
internal: true
|
||
x_min: 110
|
||
x_max: 210
|
||
y_min: 90
|
||
y_max: 170
|
||
# on_click:
|
||
# min_length: 10ms
|
||
# max_length: 500ms
|
||
|
||
#### make sure that the following 2 lines are uncommented and sit at the bottom of this block after your action ###
|
||
# - display.page.show: scenes_page
|
||
# - component.update: s3_box_lcd
|
||
|
||
|
||
- platform: touchscreen
|
||
page_id: scenes_page
|
||
id: scenes3
|
||
internal: true
|
||
x_min: 215
|
||
x_max: 315
|
||
y_min: 90
|
||
y_max: 170
|
||
# on_click:
|
||
# min_length: 10ms
|
||
# max_length: 500ms
|
||
|
||
#### make sure that the following 2 lines are uncommented and sit at the bottom of this block after your action ###
|
||
# - display.page.show: scenes_page
|
||
# - component.update: s3_box_lcd
|
||
|
||
- platform: touchscreen
|
||
page_id: scenes_page
|
||
id: scenes4
|
||
internal: true
|
||
x_min: 5
|
||
x_max: 105
|
||
y_min: 175
|
||
y_max: 240
|
||
# on_click:
|
||
# min_length: 10ms
|
||
# max_length: 500ms
|
||
|
||
#### make sure that the following 2 lines are uncommented and sit at the bottom of this block after your action ###
|
||
# - display.page.show: scenes_page
|
||
# - component.update: s3_box_lcd
|
||
|
||
|
||
- platform: touchscreen
|
||
page_id: scenes_page
|
||
id: scenes5
|
||
internal: true
|
||
x_min: 110
|
||
x_max: 210
|
||
y_min: 175
|
||
y_max: 240
|
||
# on_click:
|
||
# min_length: 10ms
|
||
# max_length: 500ms
|
||
|
||
#### make sure that the following 2 lines are uncommented and sit at the bottom of this block after your action ###
|
||
# - display.page.show: scenes_page
|
||
# - component.update: s3_box_lcd
|
||
|
||
|
||
|
||
- platform: touchscreen
|
||
page_id: scenes_page
|
||
id: scenes6
|
||
internal: true
|
||
x_min: 215
|
||
x_max: 315
|
||
y_min: 175
|
||
y_max: 240
|
||
# on_click:
|
||
# min_length: 10ms
|
||
# max_length: 500ms
|
||
|
||
#### make sure that the following 2 lines are uncommented and sit at the bottom of this block after your action ###
|
||
# - display.page.show: scenes_page
|
||
# - component.update: s3_box_lcd
|
||
|
||
- platform: touchscreen
|
||
page_id: info_page
|
||
id: ss_toggle
|
||
internal: true
|
||
x_min: 250
|
||
x_max: 315
|
||
y_min: 105
|
||
y_max: 150
|
||
on_click:
|
||
min_length: 10ms
|
||
max_length: 500ms
|
||
then:
|
||
- switch.toggle: s_saver
|
||
- component.update: s3_box_lcd
|
||
- script.execute: saver_enabled
|
||
|
||
- platform: touchscreen
|
||
page_id: info_page
|
||
id: ss_wake_presc
|
||
internal: true
|
||
x_min: 250
|
||
x_max: 315
|
||
y_min: 155
|
||
y_max: 190
|
||
on_click:
|
||
min_length: 10ms
|
||
max_length: 500ms
|
||
then:
|
||
- switch.toggle: s_saver_presc
|
||
- component.update: s3_box_lcd
|
||
- script.execute: saver_enabled
|
||
|
||
- platform: touchscreen
|
||
page_id: info_page
|
||
id: ss_toggle_blank
|
||
internal: true
|
||
x_min: 250
|
||
x_max: 315
|
||
y_min: 195
|
||
y_max: 235
|
||
on_click:
|
||
min_length: 10ms
|
||
max_length: 500ms
|
||
then:
|
||
- switch.toggle: s_saver_mode
|
||
- component.update: s3_box_lcd
|
||
- script.execute: saver_enabled
|
||
|
||
|
||
- platform: touchscreen
|
||
page_id: info_page
|
||
id: ww_chang_hass
|
||
internal: true
|
||
x_min: 10
|
||
x_max: 315
|
||
y_min: 100
|
||
y_max: 140
|
||
on_click:
|
||
min_length: 10ms
|
||
max_length: 500ms
|
||
then:
|
||
- select.operation:
|
||
id: wake_word_engine_location
|
||
operation: Next
|
||
cycle: true
|
||
- component.update: s3_box_lcd
|
||
|
||
- platform: touchscreen
|
||
page_id: saver_page
|
||
id: ss_wake
|
||
internal: true
|
||
x_min: 0
|
||
x_max: 320
|
||
y_min: 0
|
||
y_max: 240
|
||
on_click:
|
||
min_length: 10ms
|
||
max_length: 500ms
|
||
then:
|
||
- display.page.show: idle_page
|
||
- component.update: s3_box_lcd
|
||
- script.execute: saver_enabled
|
||
#### make sure that the following 2 lines are uncommented and sit at the bottom of this block after your action ###
|
||
# - display.page.show: scenes_page
|
||
# - component.update: s3_box_lcd
|
||
|
||
|
||
#### make sure that the following 2 lines are uncommented and sit at the bottom of this block after your action ###
|
||
# - display.page.show: scenes_page
|
||
# - component.update: s3_box_lcd
|
||
################## config end ############################ |