mirror of
https://github.com/randybb/esphome-configs.git
synced 2026-12-06 09:06:52 +01:00
nspanel: all panels on nspanel-terminal with the LVGL UI
The shared UI (home, light detail, status/boot page, notifications, OTA progress, display hardware) moves from mcu-nspanel-dev.yaml into common/nspanel_terminal/panel.yaml. office-r, patio, fireplace, office-j and bedroom move from nspanel_lovelace to it with the pages, tiles and buttons of their former cards. thermostat.yaml carries its page and takes an id prefix, so a panel can have more than one (fireplace). The thermostat returns to the HA target 5 s after sending, in case HA rejects the change. Idle timeout 15 s.
This commit is contained in:
1 parent
5976d81d1c
commit
9b5229323f
9 files changed
+1609
-1751
No files matched your search
+61
-141
@@ -17,7 +17,10 @@ substitutions:
|
||||
device: nspanel-patio
|
||||
name: Patio NSPanel
|
||||
area: Living Room & Kitchen
|
||||
comment: ${area}, Patio | NSPanel
|
||||
comment: ${area}, Patio | NSPanel (nspanel-terminal)
|
||||
brightness: "80"
|
||||
# backlight after 15 s idle
|
||||
dim_brightness: "20"
|
||||
|
||||
esphome:
|
||||
name: mcu-${device}
|
||||
@@ -28,140 +31,65 @@ esphome:
|
||||
packages:
|
||||
common: !include common/common.yaml
|
||||
ipv6_only: !include common/ipv6_only.yaml
|
||||
nspanel: !include
|
||||
file: common/nspanel.yaml
|
||||
panel: !include
|
||||
file: common/nspanel_terminal/panel.yaml
|
||||
vars:
|
||||
temperature_entity: sensor.zigbee_living_room_kitchen_temperature
|
||||
temperature_name: Living Room Temperature
|
||||
first_page: page_kitchen_living
|
||||
last_page: page_thermostat
|
||||
# Grid page tiles: each package adds its tile to the page and fills it in this order
|
||||
# Kuchyňa / Obývačka
|
||||
l_kitchen: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_kitchen_living, id: l_kitchen, name: "Kuchyňa", entity: light.kitchen, icon: "\U000F0769", dim: true, kmin: 2700, hs: false}}
|
||||
l_dining: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_kitchen_living, id: l_dining, name: "Stôl", entity: light.dining_table, icon: "\U000F0769", dim: true, kmin: 2700, hs: false}}
|
||||
l_living: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_kitchen_living, id: l_living, name: "Gauč", entity: light.living_room, icon: "\U000F0769", dim: true, kmin: 2700, hs: false}}
|
||||
l_tv: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_kitchen_living, id: l_tv, name: "TV", entity: light.mcu_tv_light_strip, icon: "\U000F1051", dim: true, kmin: 0, hs: false}}
|
||||
l_dining_amb: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_kitchen_living, id: l_dining_amb, name: "(Stôl)", entity: light.dining_table_ambilight, icon: "\U000F18DE", dim: true, kmin: 1700, hs: true}}
|
||||
l_living_amb: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_kitchen_living, id: l_living_amb, name: "(Gauč)", entity: light.living_room_ambilight, icon: "\U000F18DE", dim: true, kmin: 1700, hs: true}}
|
||||
# Kuchyňa
|
||||
l_worktop: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_kitchen, id: l_worktop, name: "Linka", entity: light.worktop_lights, icon: "\U000F181C", dim: true, kmin: 2000, hs: false}}
|
||||
l_stove: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_kitchen, id: l_stove, name: "Sporák", entity: light.mcu_kitchen_stove, icon: "\U000F04DE", dim: true, kmin: 2000, hs: false}}
|
||||
# Von
|
||||
l_patio: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_outside, id: l_patio, name: "Terasa", entity: light.patio_lights, icon: "\U000F1253", dim: true, kmin: 2000, hs: false}}
|
||||
s_patio_socket: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_outside, id: s_patio_socket, name: "Terasa", entity: switch.mcu_patio_relay, icon: "\U000F1108", domain: switch}}
|
||||
s_patio_back: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_outside, id: s_patio_back, name: "Vzadu", entity: switch.mcu_nspanel_patio_outside_light_back, icon: "\U000F1987", domain: switch}}
|
||||
s_shed_light: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_outside, id: s_shed_light, name: "Z. domček", entity: switch.mcu_shed_light, icon: "\U000F091D", domain: switch}}
|
||||
s_shed_socket: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_outside, id: s_shed_socket, name: "Z. domček", entity: switch.mcu_shed_socket, icon: "\U000F1108", domain: switch}}
|
||||
s_garden: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_outside, id: s_garden, name: "Záhrada", entity: switch.mcu_shed_garden_light, icon: "\U000F1987", domain: switch}}
|
||||
# Závlaha, robot -> page_irrigation_auto
|
||||
v_a1: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_irrigation, id: v_a1, name: "A1", entity: switch.mcu_well_irrigation_valve_a1, icon: "\U000F1066", domain: switch}}
|
||||
v_a2: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_irrigation, id: v_a2, name: "A2", entity: switch.mcu_well_irrigation_valve_a2, icon: "\U000F1066", domain: switch}}
|
||||
v_a3: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_irrigation, id: v_a3, name: "A3", entity: switch.mcu_well_irrigation_valve_a3, icon: "\U000F1066", domain: switch}}
|
||||
v_a4: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_irrigation, id: v_a4, name: "A4", entity: switch.mcu_well_irrigation_valve_a4, icon: "\U000F1066", domain: switch}}
|
||||
v_a5: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_irrigation, id: v_a5, name: "A5", entity: switch.mcu_well_irrigation_valve_a5, icon: "\U000F1066", domain: switch}}
|
||||
irrigation_auto: !include {file: common/nspanel_terminal/nav_tile.yaml, vars: {page: page_irrigation, to: page_irrigation_auto, icon: "\U000F06A9"}}
|
||||
ir_morning: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_irrigation_auto, id: ir_morning, name: "Ráno", entity: automation.irrigation_morning, icon: "\U000F059C", domain: automation}}
|
||||
ir_patio: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_irrigation_auto, id: ir_patio, name: "Terasa", entity: automation.irrigation_patio, icon: "\U000F024A", domain: automation}}
|
||||
ir_grass: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_irrigation_auto, id: ir_grass, name: "Rast trávy", entity: automation.irrigation_grow_grass, icon: "\U000F1510", domain: automation}}
|
||||
# Brána, robot -> page_gate_auto
|
||||
gate_open: !include {file: common/nspanel_terminal/action_tile.yaml, vars: {page: page_gate, id: gate_open, name: "Otvoriť", icon: "\U000F116A", action: button.press, entity: button.mcu_gate_open}}
|
||||
gate_close: !include {file: common/nspanel_terminal/action_tile.yaml, vars: {page: page_gate, id: gate_close, name: "Zatvoriť", icon: "\U000F0299", action: button.press, entity: button.mcu_gate_close}}
|
||||
gate_spacer: !include {file: common/nspanel_terminal/spacer_tile.yaml, vars: {page: page_gate}}
|
||||
gate: !include {file: common/nspanel_terminal/gate.yaml, vars: {page: page_gate, state: select.mcu_gate_state}}
|
||||
gate_auto: !include {file: common/nspanel_terminal/nav_tile.yaml, vars: {page: page_gate, to: page_gate_auto, icon: "\U000F06A9"}}
|
||||
gate_auto_open: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_gate_auto, id: gate_auto_open, name: "Auto-otváranie", entity: switch.mcu_gate_auto_open, icon: "\U000F1169", domain: switch}}
|
||||
gate_auto_close: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_gate_auto, id: gate_auto_close, name: "Auto-zatváranie", entity: switch.mcu_gate_auto_close, icon: "\U000F17F7", domain: switch}}
|
||||
# Kúrenie
|
||||
thermo: !include {file: common/nspanel_terminal/thermostat.yaml, vars: {id: thermo, page: page_thermostat, title: "Kúrenie - Obývačka", prev: page_gate, next: page_status, entity: climate.bt_trv_living_room_kitchen}}
|
||||
|
||||
nspanel_lovelace:
|
||||
cards:
|
||||
- type: cardGrid
|
||||
title: Kuchyňa / Obývačka
|
||||
id: card_home
|
||||
entities:
|
||||
- name: Kuchyňa / Obývačka
|
||||
entity_id: light.kitchen
|
||||
icon: ceiling-light
|
||||
- name: Stôl
|
||||
entity_id: light.dining_table
|
||||
icon: ceiling-light
|
||||
- name: Gauč
|
||||
entity_id: light.living_room
|
||||
icon: ceiling-light
|
||||
- name: TV
|
||||
entity_id: light.mcu_tv_light_strip
|
||||
icon: led-strip-variant
|
||||
- name: (Stôl)
|
||||
entity_id: light.dining_table_ambilight
|
||||
icon: ceiling-light-multiple-outline
|
||||
- name: (Gauč)
|
||||
entity_id: light.living_room_ambilight
|
||||
icon: ceiling-light-multiple-outline
|
||||
|
||||
- type: cardGrid
|
||||
title: Kuchyňa
|
||||
entities:
|
||||
- name: Linka
|
||||
entity_id: light.worktop_lights
|
||||
icon: countertop
|
||||
- name: Sporák
|
||||
entity_id: light.mcu_kitchen_stove
|
||||
icon: stove
|
||||
|
||||
- type: cardGrid
|
||||
title: Von
|
||||
id: card_outside
|
||||
entities:
|
||||
- name: Terasa
|
||||
entity_id: light.patio_lights
|
||||
icon: lightbulb-group
|
||||
- name: Terasa
|
||||
entity_id: switch.mcu_patio_relay
|
||||
icon: power-socket-fr
|
||||
- name: Vzadu
|
||||
entity_id: switch.mcu_nspanel_patio_outside_light_back
|
||||
icon: light-flood-down
|
||||
- name: Z. domček
|
||||
entity_id: switch.mcu_shed_light
|
||||
icon: wall-sconce-flat
|
||||
# state_template: '{{ is_state("binary_sensor.shed_status", "off") }}'
|
||||
- name: Z. domček
|
||||
entity_id: switch.mcu_shed_socket
|
||||
icon: power-socket-fr
|
||||
# state_template: '{{ is_state("binary_sensor.shed_status", "off") }}'
|
||||
- name: Záhrada
|
||||
entity_id: switch.mcu_shed_garden_light
|
||||
icon: light-flood-down
|
||||
# state_template: '{{ is_state("binary_sensor.shed_status", "off") }}'
|
||||
|
||||
- type: cardGrid
|
||||
title: Závlaha
|
||||
entities:
|
||||
- name: A1
|
||||
entity_id: switch.mcu_well_irrigation_valve_a1
|
||||
icon: valve
|
||||
- name: A2
|
||||
entity_id: switch.mcu_well_irrigation_valve_a2
|
||||
icon: valve
|
||||
- name: A3
|
||||
entity_id: switch.mcu_well_irrigation_valve_a3
|
||||
icon: valve
|
||||
- name: A4
|
||||
entity_id: switch.mcu_well_irrigation_valve_a4
|
||||
icon: valve
|
||||
- name: A5
|
||||
entity_id: switch.mcu_well_irrigation_valve_a5
|
||||
icon: valve
|
||||
- name: Automatizácia
|
||||
entity_id: navigate.card_irrigation_automation
|
||||
|
||||
- type: cardGrid
|
||||
title: Brána
|
||||
entities:
|
||||
- name: Otvoriť
|
||||
entity_id: button.mcu_gate_open
|
||||
icon: gate-open
|
||||
- name: Zatvoriť
|
||||
entity_id: button.mcu_gate_close
|
||||
icon: gate
|
||||
- name: Automatizácia
|
||||
entity_id: navigate.card_gate_automation
|
||||
|
||||
- type: cardThermo
|
||||
title: Kúrenie
|
||||
thermo_entity_id: climate.bt_trv_living_room_kitchen
|
||||
|
||||
- type: cardEntities
|
||||
title: Automatizácia
|
||||
id: card_gate_automation
|
||||
hidden: true
|
||||
entities:
|
||||
- name: Auto-otváranie
|
||||
entity_id: switch.gate_auto_open
|
||||
- name: Auto-zatváranie
|
||||
entity_id: switch.gate_auto_close
|
||||
|
||||
- type: cardEntities
|
||||
title: Automatizácia
|
||||
id: card_irrigation_automation
|
||||
hidden: true
|
||||
entities:
|
||||
- name: Ráno
|
||||
entity_id: automation.irrigation_morning
|
||||
- name: Terasa
|
||||
entity_id: automation.irrigation_patio
|
||||
- name: Rast trávy
|
||||
entity_id: automation.irrigation_grow_grass
|
||||
|
||||
- type: cardEntities
|
||||
title: Info
|
||||
entities:
|
||||
- name: Zariadenie
|
||||
entity_id: button.patio_nspanel_info
|
||||
icon: information-outline
|
||||
# the grid pages; home, status and light detail come from panel.yaml, thermostat pages from thermostat.yaml
|
||||
lvgl:
|
||||
pages:
|
||||
- <<: !include {file: common/nspanel_terminal/grid_page.yaml, vars: {id: page_kitchen_living, title: "Kuchyňa / Obývačka", prev: page_home, next: page_kitchen, skip: false}}
|
||||
- <<: !include {file: common/nspanel_terminal/grid_page.yaml, vars: {id: page_kitchen, title: "Kuchyňa", prev: page_kitchen_living, next: page_outside, skip: false}}
|
||||
- <<: !include {file: common/nspanel_terminal/grid_page.yaml, vars: {id: page_outside, title: "Von", prev: page_kitchen, next: page_irrigation, skip: false}}
|
||||
- <<: !include {file: common/nspanel_terminal/grid_page.yaml, vars: {id: page_irrigation, title: "Závlaha", prev: page_outside, next: page_gate, skip: false}}
|
||||
- <<: !include {file: common/nspanel_terminal/grid_page.yaml, vars: {id: page_irrigation_auto, title: "Automatizácia závlahy", prev: page_irrigation, next: page_irrigation, skip: true}}
|
||||
- <<: !include {file: common/nspanel_terminal/grid_page.yaml, vars: {id: page_gate, title: "Brána", prev: page_irrigation, next: page_thermostat, skip: false}}
|
||||
- <<: !include {file: common/nspanel_terminal/grid_page.yaml, vars: {id: page_gate_auto, title: "Automatizácia brány", prev: page_gate, next: page_gate, skip: true}}
|
||||
|
||||
binary_sensor:
|
||||
# both buttons show the Von page, where the change is visible
|
||||
- platform: gpio
|
||||
name: Left Button
|
||||
pin:
|
||||
@@ -169,7 +97,8 @@ binary_sensor:
|
||||
inverted: true
|
||||
on_click:
|
||||
- switch.toggle: relay_1
|
||||
- script.execute: show_outside_card
|
||||
- lvgl.page.show: page_outside
|
||||
- script.execute: wake_screen
|
||||
|
||||
- platform: gpio
|
||||
name: Right Button
|
||||
@@ -188,7 +117,8 @@ binary_sensor:
|
||||
action: light.toggle
|
||||
data:
|
||||
entity_id: light.patio_lights
|
||||
- script.execute: show_outside_card
|
||||
- lvgl.page.show: page_outside
|
||||
- script.execute: wake_screen
|
||||
else:
|
||||
- switch.toggle: relay_2
|
||||
|
||||
@@ -210,13 +140,3 @@ switch:
|
||||
entity_category: config
|
||||
pin:
|
||||
number: 19
|
||||
|
||||
script:
|
||||
# jump straight to the "Von" card (one render instead of home + next + next):
|
||||
# make it the default page for a moment, render it, restore the home card
|
||||
- id: show_outside_card
|
||||
then:
|
||||
- lambda: |-
|
||||
id(nspanel_id).set_default_page("card_outside");
|
||||
id(nspanel_id).render_default_page();
|
||||
id(nspanel_id).set_default_page("card_home");
|
||||
Reference in new issue
Block a user