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:
randy committed 2026-10-30 18:20:45 +01:00
1 parent 5976d81d1c
commit 9b5229323f
9 files changed
+1609 -1751

No files matched your search

File diff suppressed because it is too large. Load diff
+1 -7
View File
@@ -1,17 +1,11 @@
--- ---
# nspanel-terminal version of common/nspanel_sleep_dim.yaml: the idle (dimmed) brightness drops to 0 at night # nspanel-terminal version of common/nspanel_sleep_dim.yaml: the idle (dimmed) brightness drops to 0 at night
# (sun below -6°), unless the room light is on. Uses the dimmed global, the panel display and ${dim_brightness}. # (sun below -6°), unless the room light is on. Sets the idle_brightness global of panel.yaml (${dim_brightness} or 0).
# packages: # packages:
# sleep_dim: !include # sleep_dim: !include
# file: common/nspanel_terminal/sleep_dim.yaml # file: common/nspanel_terminal/sleep_dim.yaml
# vars: # vars:
# sleep_override_entity: light.bedroom_lights # sleep_override_entity: light.bedroom_lights
globals:
# brightness the on_idle dim goes to
- id: idle_brightness
type: int
initial_value: ${dim_brightness}
script: script:
- id: apply_sleep_dim - id: apply_sleep_dim
then: then:
+269 -35
View File
@@ -1,76 +1,303 @@
# Home Assistant state and target sending for the thermostat page (page_5). # Package: thermostat page (arc with target temperature, -/+, heat/off, boiler switch, presets) and its HA state.
# Package vars: entity (climate entity with heat/off and the Better Thermostat presets), boiler (switch enabling heating) # vars: id (prefix of its ids, unique per thermostat page), page, title, prev, next (page ids for the arrows),
# entity (climate with heat/off and presets),
# boiler (switch that lets the boiler fire, the same in every room)
defaults:
boiler: switch.heating_enabled
globals:
# preset_modes of the thermostat, in dropdown order
- id: ${id}_preset_list
type: std::vector<std::string>
lvgl:
pages:
- id: ${page}
styles: page_style
widgets:
- label:
text: "${title}"
text_font: font_s
text_color: 0xB4B4BA
width: 100%
text_align: CENTER
- <<: !include
file: page_arrow.yaml
vars: {icon: "\U000F0141", align: TOP_LEFT, x: -16, to: "${prev}", hidden: false}
- <<: !include
file: page_arrow.yaml
vars: {icon: "\U000F0142", align: TOP_RIGHT, x: 16, to: "${next}", hidden: false}
# target temperature in half degrees, 10..30 °C
- arc:
id: ${id}_arc
disabled:
arc_color: 0x161618
align: BOTTOM_LEFT
y: -20
width: 220
height: 220
min_value: 20
max_value: 60
arc_width: 16
arc_color: 0x2C2C2E
indicator:
arc_width: 16
arc_color: 0x8E8E93
knob:
bg_color: 0xFFFFFF
pad_all: 2
on_value:
- lambda: 'lv_label_set_text_fmt(id(${id}_target_label), "%.1f", x / 2.0f);'
on_release:
- script.execute: ${id}_send_target
widgets:
- obj:
clickable: false
align: CENTER
y: -8
width: SIZE_CONTENT
height: SIZE_CONTENT
bg_opa: TRANSP
border_width: 0
pad_all: 0
text_color: 0xFFFFFF
layout:
type: FLEX
flex_flow: ROW
flex_align_cross: START
pad_column: 2
widgets:
- label:
id: ${id}_target_label
text: "-"
text_font: font_big
text_color: 0xFFFFFF
- label:
text: "°C"
y: 6
text_color: 0xB4B4BA
- label:
id: ${id}_current_label
text: ""
text_font: font_s
text_color: 0xB4B4BA
align: CENTER
y: 34
- label:
id: ${id}_action_label
text: ""
text_font: font_s
text_color: 0x8E8E93
align: CENTER
y: -50
- button:
id: ${id}_minus
align: BOTTOM_LEFT
x: 46
width: 56
height: 44
styles: tile_style
disabled:
bg_color: 0x161618
text_color: 0x48484A
pad_all: 0
on_click:
- lambda: |-
lv_arc_set_value(id(${id}_arc), lv_arc_get_value(id(${id}_arc)) - 1);
lv_label_set_text_fmt(id(${id}_target_label), "%.1f", lv_arc_get_value(id(${id}_arc)) / 2.0f);
- script.execute: ${id}_send_target
widgets:
- label:
text: "\U000F0374"
text_font: icon_s
align: CENTER
- button:
id: ${id}_plus
align: BOTTOM_LEFT
x: 118
width: 56
height: 44
styles: tile_style
disabled:
bg_color: 0x161618
text_color: 0x48484A
pad_all: 0
on_click:
- lambda: |-
lv_arc_set_value(id(${id}_arc), lv_arc_get_value(id(${id}_arc)) + 1);
lv_label_set_text_fmt(id(${id}_target_label), "%.1f", lv_arc_get_value(id(${id}_arc)) / 2.0f);
- script.execute: ${id}_send_target
widgets:
- label:
text: "\U000F0415"
text_font: icon_s
align: CENTER
- button:
id: ${id}_power
align: TOP_RIGHT
x: -90
y: 36
width: 82
height: 44
styles: tile_style
disabled:
bg_color: 0x161618
text_color: 0x48484A
pad_all: 0
checked:
bg_color: 0xF5B342
text_color: 0x000000
on_click:
- homeassistant.action:
action: climate.set_hvac_mode
data:
entity_id: ${entity}
hvac_mode: !lambda 'return id(${id}_mode).state == "heat" ? "off" : "heat";'
widgets:
- label:
text: "\U000F0438"
text_font: icon_s
align: LEFT_MID
x: 6
- label:
text: "Izba"
text_font: font_s
align: RIGHT_MID
x: -8
# the boiler only fires with this switch on
- button:
id: ${id}_boiler_button
align: TOP_RIGHT
x: 0
y: 36
width: 82
height: 44
styles: tile_style
disabled:
bg_color: 0x161618
text_color: 0x48484A
pad_all: 0
checked:
bg_color: 0xF5B342
text_color: 0x000000
on_click:
- homeassistant.action:
action: switch.toggle
data:
entity_id: ${boiler}
widgets:
- label:
text: "\U000F0238"
text_font: icon_s
align: LEFT_MID
x: 6
- label:
text: "Kotol"
text_font: font_s
align: RIGHT_MID
x: -8
# options come from the preset_modes attribute (thermostat.yaml)
- dropdown:
id: ${id}_preset_dropdown
disabled:
text_color: 0x48484A
align: TOP_RIGHT
y: 92
width: 172
options: ["-"]
styles: tile_style
pad_all: 10
symbol: "\U000F0140"
indicator:
text_font: icon_s
dropdown_list:
bg_color: 0x2C2C2E
text_color: 0xFFFFFF
text_font: font_m
border_width: 0
radius: 14
selected:
checked:
bg_color: 0xF5B342
text_color: 0x000000
on_value:
- homeassistant.action:
action: climate.set_preset_mode
data:
entity_id: ${entity}
preset_mode: !lambda 'return x < id(${id}_preset_list).size() ? id(${id}_preset_list)[x] : std::string();'
sensor: sensor:
- platform: homeassistant - platform: homeassistant
id: thermo_target id: ${id}_target
entity_id: ${entity} entity_id: ${entity}
attribute: temperature attribute: temperature
internal: true internal: true
on_value: on_value:
- lambda: |- - lambda: |-
if (std::isnan(x)) return; if (std::isnan(x)) return;
lv_arc_set_value(id(thermo_arc), std::lround(x * 2)); lv_arc_set_value(id(${id}_arc), std::lround(x * 2));
lv_label_set_text_fmt(id(thermo_target_label), "%.1f", x); lv_label_set_text_fmt(id(${id}_target_label), "%.1f", x);
- platform: homeassistant - platform: homeassistant
id: thermo_current id: ${id}_current
entity_id: ${entity} entity_id: ${entity}
attribute: current_temperature attribute: current_temperature
internal: true internal: true
on_value: on_value:
- lambda: 'lv_label_set_text_fmt(id(thermo_current_label), "teraz %.1f°C", x);' - lambda: 'lv_label_set_text_fmt(id(${id}_current_label), "teraz %.1f°C", x);'
text_sensor: text_sensor:
# text, not binary: a binary sensor drops "unavailable" # text, not binary: a binary sensor drops "unavailable"
- platform: homeassistant - platform: homeassistant
id: heating_enabled id: ${id}_boiler
entity_id: ${boiler} entity_id: ${boiler}
internal: true internal: true
on_value: on_value:
- lambda: |- - lambda: |-
lv_obj_set_state(id(heating_enabled_button), LV_STATE_CHECKED, x == "on"); lv_obj_set_state(id(${id}_boiler_button), LV_STATE_CHECKED, x == "on");
lv_obj_set_state(id(heating_enabled_button), LV_STATE_DISABLED, ha_unavailable(x)); lv_obj_set_state(id(${id}_boiler_button), LV_STATE_DISABLED, ha_unavailable(x));
- platform: homeassistant - platform: homeassistant
id: thermo_mode id: ${id}_mode
entity_id: ${entity} entity_id: ${entity}
internal: true internal: true
on_value: on_value:
- lambda: |- - lambda: |-
lv_obj_set_state(id(thermo_power), LV_STATE_CHECKED, x == "heat"); lv_obj_set_state(id(${id}_power), LV_STATE_CHECKED, x == "heat");
// thermostat unavailable: grey out its controls // thermostat unavailable: grey out its controls
for (lv_obj_t *o : {(lv_obj_t *) id(thermo_power), (lv_obj_t *) id(thermo_arc), id(thermo_minus), id(thermo_plus), for (lv_obj_t *o : {(lv_obj_t *) id(${id}_power), (lv_obj_t *) id(${id}_arc), id(${id}_minus), id(${id}_plus),
id(thermo_preset_dropdown)->obj}) id(${id}_preset_dropdown)->obj})
lv_obj_set_state(o, LV_STATE_DISABLED, ha_unavailable(x)); lv_obj_set_state(o, LV_STATE_DISABLED, ha_unavailable(x));
- script.execute: thermo_update_action - script.execute: ${id}_update_action
- platform: homeassistant - platform: homeassistant
id: thermo_action id: ${id}_action
entity_id: ${entity} entity_id: ${entity}
attribute: hvac_action attribute: hvac_action
internal: true internal: true
on_value: on_value:
- script.execute: thermo_update_action - script.execute: ${id}_update_action
- platform: homeassistant - platform: homeassistant
id: thermo_presets id: ${id}_presets
entity_id: ${entity} entity_id: ${entity}
attribute: preset_modes attribute: preset_modes
internal: true internal: true
on_value: on_value:
- lambda: |- - lambda: |-
id(preset_list) = parse_list(x); id(${id}_preset_list) = parse_list(x);
std::string options; std::string options;
for (auto &p : id(preset_list)) options += (options.empty() ? "" : "\n") + preset_name(p); for (auto &p : id(${id}_preset_list)) options += (options.empty() ? "" : "\n") + preset_name(p);
lv_dropdown_set_options(id(thermo_preset_dropdown)->obj, options.c_str()); lv_dropdown_set_options(id(${id}_preset_dropdown)->obj, options.c_str());
- script.execute: thermo_select_preset - script.execute: ${id}_select_preset
- platform: homeassistant - platform: homeassistant
id: thermo_preset id: ${id}_preset
entity_id: ${entity} entity_id: ${entity}
attribute: preset_mode attribute: preset_mode
internal: true internal: true
on_value: on_value:
- script.execute: thermo_select_preset - script.execute: ${id}_select_preset
script: script:
# Arc and -/+ change the target locally; send once the user stops for a moment # Arc and -/+ change the target locally; send once the user stops for a moment
- id: thermo_send_target - id: ${id}_send_target
mode: restart mode: restart
then: then:
- delay: 800ms - delay: 800ms
@@ -78,17 +305,24 @@ script:
action: climate.set_temperature action: climate.set_temperature
data: data:
entity_id: ${entity} entity_id: ${entity}
temperature: !lambda return lv_arc_get_value(id(thermo_arc)) / 2.0f; temperature: !lambda return lv_arc_get_value(id(${id}_arc)) / 2.0f;
- id: thermo_update_action # back to what HA has, in case it did not take the change (e.g. actions not allowed for this device)
- delay: 5s
- lambda: |-
float target = id(${id}_target).state;
if (std::isnan(target)) return;
lv_arc_set_value(id(${id}_arc), std::lround(target * 2));
lv_label_set_text_fmt(id(${id}_target_label), "%.1f", target);
- id: ${id}_update_action
then: then:
- lambda: |- - lambda: |-
bool off = id(thermo_mode).state == "off"; bool off = id(${id}_mode).state == "off";
bool heating = id(thermo_action).state == "heating"; bool heating = id(${id}_action).state == "heating";
lv_label_set_text(id(thermo_action_label), off ? "vypnuté" : heating ? "kúri" : "nekúri"); lv_label_set_text(id(${id}_action_label), off ? "vypnuté" : heating ? "kúri" : "nekúri");
lv_obj_set_style_arc_color(id(thermo_arc), lv_color_hex(heating ? 0xF5B342 : 0x8E8E93), LV_PART_INDICATOR); lv_obj_set_style_arc_color(id(${id}_arc), lv_color_hex(heating ? 0xF5B342 : 0x8E8E93), LV_PART_INDICATOR);
- id: thermo_select_preset - id: ${id}_select_preset
then: then:
- lambda: |- - lambda: |-
auto &list = id(preset_list); auto &list = id(${id}_preset_list);
auto it = std::find(list.begin(), list.end(), id(thermo_preset).state); auto it = std::find(list.begin(), list.end(), id(${id}_preset).state);
if (it != list.end()) lv_dropdown_set_selected(id(thermo_preset_dropdown)->obj, it - list.begin()); if (it != list.end()) lv_dropdown_set_selected(id(${id}_preset_dropdown)->obj, it - list.begin());
+28 -40
View File
@@ -18,7 +18,10 @@ substitutions:
name: Bedroom NSPanel name: Bedroom NSPanel
name_short: Bedroom name_short: Bedroom
area: Bedroom area: Bedroom
comment: NSPanel comment: NSPanel (nspanel-terminal)
brightness: "80"
# backlight after 15 s idle
dim_brightness: "20"
esphome: esphome:
name: mcu-${device} name: mcu-${device}
@@ -29,51 +32,34 @@ esphome:
packages: packages:
common: !include common/common.yaml common: !include common/common.yaml
ipv6_only: !include common/ipv6_only.yaml ipv6_only: !include common/ipv6_only.yaml
nspanel: !include panel: !include
file: common/nspanel.yaml file: common/nspanel_terminal/panel.yaml
vars: vars:
temperature_entity: sensor.zigbee_bedroom_temperature temperature_entity: sensor.zigbee_bedroom_temperature
first_page: page_bedroom
last_page: page_thermostat
sleep_dim: !include sleep_dim: !include
file: common/nspanel_sleep_dim.yaml file: common/nspanel_terminal/sleep_dim.yaml
vars: vars:
sleep_override_entity: light.bedroom_lights sleep_override_entity: light.bedroom_lights
# Grid page tiles: each package adds its tile to the page and fills it in this order
# Spálňa
s_tv: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_bedroom, id: s_tv, name: "TV", entity: switch.mcu_socket_01_relay, icon: "\U000F07F4", domain: switch}}
s_raid: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_bedroom, id: s_raid, name: "Raid", entity: switch.mcu_socket_02_relay, icon: "\U000F0C6E", domain: switch}}
s_socket_3: !include {file: common/nspanel_terminal/switch_tile.yaml, vars: {page: page_bedroom, id: s_socket_3, name: "", entity: switch.mcu_socket_03_relay, icon: "\U000F1108", domain: switch}}
l_bedroom: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_bedroom, id: l_bedroom, name: "Svetlo", entity: light.mcu_nspanel_bedroom_light, icon: "\U000F091D", dim: false, kmin: 0, hs: false}}
l_lamp_right: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_bedroom, id: l_lamp_right, name: "Nočná lampa J", entity: light.mcu_bedroom_lamp_right_light, icon: "\U000F06B5", dim: true, kmin: 1701, hs: true}}
l_lamp_left: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_bedroom, id: l_lamp_left, name: "Nočná lampa R", entity: light.mcu_bedroom_lamp_left_light, icon: "\U000F06B5", dim: true, kmin: 1701, hs: true}}
# Kúrenie
thermo: !include {file: common/nspanel_terminal/thermostat.yaml, vars: {id: thermo, page: page_thermostat, title: "Kúrenie - Spálňa", prev: page_bedroom, next: page_status, entity: climate.bt_trv_bedroom}}
nspanel_lovelace: # the grid pages; home, status and light detail come from panel.yaml, thermostat pages from thermostat.yaml
cards: lvgl:
- type: cardGrid pages:
title: Spálňa - <<: !include {file: common/nspanel_terminal/grid_page.yaml, vars: {id: page_bedroom, title: "Spálňa", prev: page_home, next: page_thermostat, skip: false}}
entities:
- name: TV
entity_id: switch.mcu_socket_01_relay
icon: television-classic
- name: Raid
entity_id: switch.mcu_socket_02_relay
icon: emoticon-dead
- name: ""
entity_id: switch.mcu_socket_03_relay
icon: power-socket-fr
- name: Svetlo
entity_id: light.mcu_nspanel_bedroom_light
icon: wall-sconce-flat
- name: Nočná lampa J
entity_id: light.mcu_bedroom_lamp_right_light
icon: lamp
- name: Nočná lampa R
entity_id: light.mcu_bedroom_lamp_left_light
icon: lamp
- type: cardThermo
title: Kúrenie
thermo_entity_id: climate.bt_trv_bedroom
- type: cardEntities
title: Info
entities:
- name: Zariadenie
entity_id: button.bedroom_nspanel_info
icon: information-outline
binary_sensor: binary_sensor:
# both buttons show the Spálňa page, where the change is visible
- platform: gpio - platform: gpio
name: Left Button name: Left Button
pin: pin:
@@ -81,7 +67,8 @@ binary_sensor:
inverted: true inverted: true
on_click: on_click:
- light.toggle: light_1 - light.toggle: light_1
- lambda: 'id(nspanel_id).render_default_page();' - lvgl.page.show: page_bedroom
- script.execute: wake_screen
- platform: gpio - platform: gpio
name: Right Button name: Right Button
@@ -95,7 +82,8 @@ binary_sensor:
action: light.toggle action: light.toggle
data: data:
entity_id: light.bedroom_lamps entity_id: light.bedroom_lamps
- lambda: 'id(nspanel_id).render_default_page();' - lvgl.page.show: page_bedroom
- script.execute: wake_screen
light: light:
- platform: binary - platform: binary
+51 -1310
View File
File diff suppressed because it is too large. Load diff
+54 -104
View File
@@ -17,7 +17,10 @@ substitutions:
device: nspanel-fireplace device: nspanel-fireplace
name: Fireplace NSPanel name: Fireplace NSPanel
area: Living Room & Kitchen area: Living Room & Kitchen
comment: NSPanel comment: NSPanel (nspanel-terminal)
brightness: "80"
# backlight after 15 s idle
dim_brightness: "20"
esphome: esphome:
name: mcu-${device} name: mcu-${device}
@@ -28,109 +31,54 @@ esphome:
packages: packages:
common: !include common/common.yaml common: !include common/common.yaml
ipv6_only: !include common/ipv6_only.yaml ipv6_only: !include common/ipv6_only.yaml
nspanel: !include panel: !include
file: common/nspanel.yaml file: common/nspanel_terminal/panel.yaml
vars: vars:
temperature_entity: sensor.zigbee_living_room_kitchen_temperature temperature_entity: sensor.zigbee_living_room_kitchen_temperature
temperature_name: Living Room Temperature temperature_name: Living Room Temperature
first_page: page_kitchen_living
last_page: page_thermostat_room
# 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}}
# 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_thermostat_room, entity: climate.bt_trv_living_room_kitchen}}
thermo_room: !include {file: common/nspanel_terminal/thermostat.yaml, vars: {id: thermo_room, page: page_thermostat_room, title: "Kúrenie - Izba", prev: page_thermostat, next: page_status, entity: climate.bt_trv_room}}
nspanel_lovelace: # the grid pages; home, status and light detail come from panel.yaml, thermostat pages from thermostat.yaml
cards: lvgl:
- type: cardGrid pages:
title: Kuchyňa / Obývačka - <<: !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}}
entities: - <<: !include {file: common/nspanel_terminal/grid_page.yaml, vars: {id: page_kitchen, title: "Kuchyňa", prev: page_kitchen_living, next: page_outside, skip: false}}
- name: Kuchyňa / Obývačka - <<: !include {file: common/nspanel_terminal/grid_page.yaml, vars: {id: page_outside, title: "Von", prev: page_kitchen, next: page_gate, skip: false}}
entity_id: light.kitchen - <<: !include {file: common/nspanel_terminal/grid_page.yaml, vars: {id: page_gate, title: "Brána", prev: page_outside, next: page_thermostat, skip: false}}
icon: ceiling-light - <<: !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}}
- 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
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: 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: cardThermo
title: Kúrenie - Izba
thermo_entity_id: climate.bt_trv_room
- 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: Info
entities:
- name: Zariadenie
entity_id: button.fireplace_nspanel_info
icon: information-outline
binary_sensor: binary_sensor:
# short click: living room / dining table (Kuchyňa / Obývačka page), long click: worktop / stove (Kuchyňa page)
- platform: gpio - platform: gpio
name: Left Button name: Left Button
pin: pin:
@@ -145,7 +93,8 @@ binary_sensor:
action: light.toggle action: light.toggle
data: data:
entity_id: light.living_room entity_id: light.living_room
- lambda: 'id(nspanel_id).render_default_page();' - lvgl.page.show: page_kitchen_living
- script.execute: wake_screen
- min_length: 500ms - min_length: 500ms
max_length: 2000ms max_length: 2000ms
then: then:
@@ -153,8 +102,8 @@ binary_sensor:
action: light.toggle action: light.toggle
data: data:
entity_id: light.worktop_lights entity_id: light.worktop_lights
- lambda: 'id(nspanel_id).render_default_page();' - lvgl.page.show: page_kitchen
- lambda: 'id(nspanel_id).render_next_page();' - script.execute: wake_screen
- platform: gpio - platform: gpio
name: Right Button name: Right Button
@@ -170,7 +119,8 @@ binary_sensor:
action: light.toggle action: light.toggle
data: data:
entity_id: light.dining_table entity_id: light.dining_table
- lambda: 'id(nspanel_id).render_default_page();' - lvgl.page.show: page_kitchen_living
- script.execute: wake_screen
- min_length: 500ms - min_length: 500ms
max_length: 2000ms max_length: 2000ms
then: then:
@@ -178,8 +128,8 @@ binary_sensor:
action: light.toggle action: light.toggle
data: data:
entity_id: light.mcu_kitchen_stove entity_id: light.mcu_kitchen_stove
- lambda: 'id(nspanel_id).render_default_page();' - lvgl.page.show: page_kitchen
- lambda: 'id(nspanel_id).render_next_page();' - script.execute: wake_screen
switch: switch:
- platform: gpio - platform: gpio
+34 -53
View File
@@ -17,7 +17,10 @@ substitutions:
device: nspanel-office-j device: nspanel-office-j
name: Office J NSPanel name: Office J NSPanel
area: Office J area: Office J
comment: NSPanel comment: NSPanel (nspanel-terminal)
brightness: "80"
# backlight after 15 s idle
dim_brightness: "20"
esphome: esphome:
name: mcu-${device} name: mcu-${device}
@@ -28,62 +31,41 @@ esphome:
packages: packages:
common: !include common/common.yaml common: !include common/common.yaml
ipv6_only: !include common/ipv6_only.yaml ipv6_only: !include common/ipv6_only.yaml
nspanel: !include panel: !include
file: common/nspanel.yaml file: common/nspanel_terminal/panel.yaml
vars: vars:
temperature_entity: sensor.zigbee_office_j_temperature temperature_entity: sensor.zigbee_office_j_temperature
ntc_reference_temperature: 22°C ntc_reference_temperature: 22°C
first_page: page_office
last_page: page_thermostat
sleep_dim: !include sleep_dim: !include
file: common/nspanel_sleep_dim.yaml file: common/nspanel_terminal/sleep_dim.yaml
vars: vars:
sleep_override_entity: light.office_j_lights sleep_override_entity: light.office_j_lights
# Grid page tiles: each package adds its tile to the page and fills it in this order
# Janko
l_office: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_office, id: l_office, name: "Svetlo", entity: light.mcu_nspanel_office_j_light, icon: "\U000F091D", dim: false, kmin: 0, hs: false}}
l_bedside: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_office, id: l_bedside, name: "Nočná lampa", entity: light.bedside_left, icon: "\U000F06B5", dim: true, kmin: 1700, hs: true}}
# 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 - Janko", prev: page_gate, next: page_status, entity: climate.bt_trv_office_j}}
nspanel_lovelace: # the grid pages; home, status and light detail come from panel.yaml, thermostat pages from thermostat.yaml
cards: lvgl:
- type: cardGrid pages:
title: Janko - <<: !include {file: common/nspanel_terminal/grid_page.yaml, vars: {id: page_office, title: "Janko", prev: page_home, next: page_gate, skip: false}}
entities: - <<: !include {file: common/nspanel_terminal/grid_page.yaml, vars: {id: page_gate, title: "Brána", prev: page_office, next: page_thermostat, skip: false}}
- name: Svetlo - <<: !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}}
entity_id: light.mcu_nspanel_office_j_light
icon: wall-sconce-flat
- name: Nočná lampa
entity_id: light.bedside_left
icon: lamp
- 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_office_j
- 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: Info
entities:
- name: Zariadenie
entity_id: button.office_j_nspanel_info
icon: information-outline
binary_sensor: binary_sensor:
# both buttons show the Janko page, where the change is visible
- platform: gpio - platform: gpio
name: Left Button name: Left Button
pin: pin:
@@ -91,7 +73,8 @@ binary_sensor:
inverted: true inverted: true
on_click: on_click:
- light.toggle: light_1 - light.toggle: light_1
- lambda: 'id(nspanel_id).render_default_page();' - lvgl.page.show: page_office
- script.execute: wake_screen
- platform: gpio - platform: gpio
name: Right Button name: Right Button
@@ -103,7 +86,8 @@ binary_sensor:
action: light.toggle action: light.toggle
data: data:
entity_id: light.bedside_left entity_id: light.bedside_left
- lambda: 'id(nspanel_id).render_default_page();' - lvgl.page.show: page_office
- script.execute: wake_screen
output: output:
- id: relay_1 - id: relay_1
@@ -121,6 +105,3 @@ light:
id: light_1 id: light_1
output: relay_1 output: relay_1
restore_mode: RESTORE_DEFAULT_OFF restore_mode: RESTORE_DEFAULT_OFF
# # - platform: binary
# # name: Relay 2
# # output: relay_2
+37 -61
View File
@@ -17,7 +17,10 @@ substitutions:
device: nspanel-office-r device: nspanel-office-r
name: Office R NSPanel name: Office R NSPanel
area: Office R area: Office R
comment: NSPanel comment: NSPanel (nspanel-terminal)
brightness: "80"
# backlight after 15 s idle
dim_brightness: "20"
esphome: esphome:
name: mcu-${device} name: mcu-${device}
@@ -28,11 +31,37 @@ esphome:
packages: packages:
common: !include common/common.yaml common: !include common/common.yaml
ipv6_only: !include common/ipv6_only.yaml ipv6_only: !include common/ipv6_only.yaml
nspanel: !include panel: !include
file: common/nspanel.yaml file: common/nspanel_terminal/panel.yaml
vars: vars:
temperature_entity: sensor.zigbee_office_r_temperature temperature_entity: sensor.zigbee_office_r_temperature
ntc_reference_temperature: 22°C ntc_reference_temperature: 22°C
first_page: page_office
last_page: page_thermostat
# Grid page tiles: each package adds its tile to the page and fills it in this order
# Romanko
l_office: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_office, id: l_office, name: "Svetlo", entity: light.mcu_nspanel_office_r_light, icon: "\U000F0769", dim: false, kmin: 0, hs: false}}
l_strip: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_office, id: l_strip, name: "LED pásik", entity: light.office_r_desk_strip, icon: "\U000F1051", dim: true, kmin: 1700, hs: true}}
office_spacer: !include {file: common/nspanel_terminal/spacer_tile.yaml, vars: {page: page_office}}
l_monitor: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_office, id: l_monitor, name: "Monitor", entity: light.office_r_display_lamp, icon: "\U000F0379", dim: true, kmin: 2700, hs: false}}
l_monitor_amb: !include {file: common/nspanel_terminal/light_tile.yaml, vars: {page: page_office, id: l_monitor_amb, name: "(Monitor)", entity: light.office_r_display_lamp_ambilight, icon: "\U000F1051", dim: true, kmin: 1700, hs: true}}
# 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
thermostat: !include {file: common/nspanel_terminal/thermostat.yaml, vars: {id: thermo, page: page_thermostat, title: "Kúrenie - Romanko", prev: page_gate, next: page_status, entity: climate.bt_trv_office_r}}
# the grid pages; home, status and light detail come from panel.yaml, the thermostat page from thermostat.yaml
lvgl:
pages:
- <<: !include {file: common/nspanel_terminal/grid_page.yaml, vars: {id: page_office, title: "Romanko", prev: page_home, next: page_gate, skip: false}}
- <<: !include {file: common/nspanel_terminal/grid_page.yaml, vars: {id: page_gate, title: "Brána", prev: page_office, 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}}
script: script:
- id: geiger_click - id: geiger_click
@@ -51,59 +80,8 @@ script:
return esphome::random_uint32() % 450 + 50; return esphome::random_uint32() % 450 + 50;
- script.execute: geiger_click - script.execute: geiger_click
nspanel_lovelace:
cards:
- type: cardGrid
title: Romanko
entities:
- name: Svetlo
entity_id: light.mcu_nspanel_office_r_light
icon: wall-sconce-flat
- name: LED pásik
entity_id: light.office_r_desk_strip
icon: led-strip-variant
- entity_id: delete
- name: Monitor
entity_id: light.office_r_display_lamp
icon: monitor-star
- name: (Monitor)
entity_id: light.office_r_display_lamp_ambilight
icon: monitor-star
- 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_office_r
- 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: Info
entities:
- name: Zariadenie
entity_id: button.office_r_nspanel_info
icon: information-outline
binary_sensor: binary_sensor:
# both buttons show the Romanko page, where the change is visible
- platform: gpio - platform: gpio
name: Left Button name: Left Button
pin: pin:
@@ -114,7 +92,8 @@ binary_sensor:
action: light.toggle action: light.toggle
data: data:
entity_id: light.office_r_desk_strip entity_id: light.office_r_desk_strip
- lambda: 'id(nspanel_id).render_default_page();' - lvgl.page.show: page_office
- script.execute: wake_screen
- platform: gpio - platform: gpio
name: Right Button name: Right Button
@@ -123,17 +102,14 @@ binary_sensor:
inverted: true inverted: true
on_click: on_click:
- light.toggle: light_1 - light.toggle: light_1
- lambda: 'id(nspanel_id).render_default_page();' - lvgl.page.show: page_office
- script.execute: wake_screen
output: output:
- id: relay_1 - id: relay_1
platform: gpio platform: gpio
pin: pin:
number: 22 number: 22
# - id: relay_2
# platform: gpio
# pin:
# number: 19
light: light:
- platform: esp32_rmt_led_strip - platform: esp32_rmt_led_strip
+61 -141
View File
@@ -17,7 +17,10 @@ substitutions:
device: nspanel-patio device: nspanel-patio
name: Patio NSPanel name: Patio NSPanel
area: Living Room & Kitchen 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: esphome:
name: mcu-${device} name: mcu-${device}
@@ -28,140 +31,65 @@ esphome:
packages: packages:
common: !include common/common.yaml common: !include common/common.yaml
ipv6_only: !include common/ipv6_only.yaml ipv6_only: !include common/ipv6_only.yaml
nspanel: !include panel: !include
file: common/nspanel.yaml file: common/nspanel_terminal/panel.yaml
vars: vars:
temperature_entity: sensor.zigbee_living_room_kitchen_temperature temperature_entity: sensor.zigbee_living_room_kitchen_temperature
temperature_name: Living Room 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: # the grid pages; home, status and light detail come from panel.yaml, thermostat pages from thermostat.yaml
cards: lvgl:
- type: cardGrid pages:
title: Kuchyňa / Obývačka - <<: !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}}
id: card_home - <<: !include {file: common/nspanel_terminal/grid_page.yaml, vars: {id: page_kitchen, title: "Kuchyňa", prev: page_kitchen_living, next: page_outside, skip: false}}
entities: - <<: !include {file: common/nspanel_terminal/grid_page.yaml, vars: {id: page_outside, title: "Von", prev: page_kitchen, next: page_irrigation, skip: false}}
- name: Kuchyňa / Obývačka - <<: !include {file: common/nspanel_terminal/grid_page.yaml, vars: {id: page_irrigation, title: "Závlaha", prev: page_outside, next: page_gate, skip: false}}
entity_id: light.kitchen - <<: !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}}
icon: ceiling-light - <<: !include {file: common/nspanel_terminal/grid_page.yaml, vars: {id: page_gate, title: "Brána", prev: page_irrigation, next: page_thermostat, skip: false}}
- name: Stôl - <<: !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}}
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
binary_sensor: binary_sensor:
# both buttons show the Von page, where the change is visible
- platform: gpio - platform: gpio
name: Left Button name: Left Button
pin: pin:
@@ -169,7 +97,8 @@ binary_sensor:
inverted: true inverted: true
on_click: on_click:
- switch.toggle: relay_1 - switch.toggle: relay_1
- script.execute: show_outside_card - lvgl.page.show: page_outside
- script.execute: wake_screen
- platform: gpio - platform: gpio
name: Right Button name: Right Button
@@ -188,7 +117,8 @@ binary_sensor:
action: light.toggle action: light.toggle
data: data:
entity_id: light.patio_lights entity_id: light.patio_lights
- script.execute: show_outside_card - lvgl.page.show: page_outside
- script.execute: wake_screen
else: else:
- switch.toggle: relay_2 - switch.toggle: relay_2
@@ -210,13 +140,3 @@ switch:
entity_category: config entity_category: config
pin: pin:
number: 19 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");