mirror of
https://github.com/randybb/esphome-configs.git
synced 2026-10-14 08:35:12 +02:00
Switch all NSPanels from the MQTT + AppDaemon based esphome-nspanel-lovelace-ui to the native component (randybb/esphome-nspanel-lovelace-native, ref: devices). Cards and screensaver are now configured directly in ESPHome, removing the dependency on MQTT and AppDaemon.
306 lines
7.4 KiB
YAML
306 lines
7.4 KiB
YAML
---
|
|
substitutions:
|
|
device: nspanel-fireplace
|
|
name: Fireplace NSPanel
|
|
area: Living Room & Kitchen
|
|
comment: NSPanel
|
|
|
|
esphome:
|
|
name: mcu-${device}
|
|
friendly_name: ${name}
|
|
area: ${area}
|
|
comment: ${comment}
|
|
on_boot:
|
|
then:
|
|
- switch.turn_off: screen_power
|
|
- delay: 1s
|
|
- switch.turn_on: screen_power
|
|
- delay: 2s
|
|
- lambda: 'id(nspanel_id).set_display_dim(5, 80);'
|
|
|
|
esp32:
|
|
variant: esp32
|
|
toolchain: esp-idf
|
|
framework:
|
|
type: esp-idf
|
|
advanced:
|
|
minimum_chip_revision: 3.0
|
|
sram1_as_iram: true
|
|
|
|
external_components:
|
|
- source:
|
|
type: git
|
|
url: https://github.com/randybb/esphome-nspanel-lovelace-native
|
|
ref: devices
|
|
refresh: 0s
|
|
components: [nspanel_lovelace]
|
|
|
|
packages:
|
|
common: !include common/common.yaml
|
|
|
|
api:
|
|
homeassistant_services: true
|
|
homeassistant_states: true
|
|
actions:
|
|
- action: play_rtttl
|
|
variables:
|
|
song: string
|
|
then:
|
|
- rtttl.play:
|
|
rtttl: !lambda 'return song;'
|
|
|
|
- action: notify
|
|
variables:
|
|
heading: string
|
|
message: string
|
|
song: string
|
|
then:
|
|
- lambda: 'id(nspanel_id).notify_on_screensaver(heading, message, 10000);'
|
|
- rtttl.play:
|
|
rtttl: !lambda 'return song;'
|
|
|
|
- action: notify_fullscreen
|
|
variables:
|
|
title: string
|
|
description: string
|
|
button1: string
|
|
button2: string
|
|
timeout: int
|
|
icon: string
|
|
then:
|
|
- lambda: 'id(nspanel_id).notify_on_screensaver(title, description, timeout);'
|
|
- rtttl.play: "scale_up:d=32,o=5,b=100:c,c#,d#,e,f#,g#,a#,b"
|
|
|
|
uart:
|
|
id: display_uart
|
|
tx_pin: 16
|
|
rx_pin: 17
|
|
baud_rate: 115200
|
|
|
|
nspanel_lovelace:
|
|
id: nspanel_id
|
|
sleep_timeout: 10
|
|
experimental_vertical_ui: true
|
|
locale:
|
|
language: sk
|
|
temperature_unit: celcius
|
|
screensaver:
|
|
time_id: ha_time
|
|
time_format: '%H:%M'
|
|
date_format: '%A, %d. %b. %Y'
|
|
weather:
|
|
entity_id: sensor.weather_forecast_daily
|
|
icon_color: [255, 255, 255]
|
|
entities:
|
|
- entity_id: sensor.zigbee_living_room_kitchen_temperature
|
|
icon:
|
|
value: home-thermometer-outline
|
|
color: [255, 255, 255]
|
|
precision: 1
|
|
cards:
|
|
- type: cardGrid
|
|
title: Kuchyňa / Obývačka
|
|
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
|
|
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
|
|
|
|
time:
|
|
- platform: homeassistant
|
|
id: ha_time
|
|
timezone: Europe/Bratislava
|
|
|
|
binary_sensor:
|
|
- platform: gpio
|
|
name: Left Button
|
|
pin:
|
|
number: 14
|
|
inverted: true
|
|
on_click:
|
|
# - switch.toggle: relay_1
|
|
- min_length: 50ms
|
|
max_length: 350ms
|
|
then:
|
|
- homeassistant.action:
|
|
action: light.toggle
|
|
data:
|
|
entity_id: light.living_room
|
|
- lambda: 'id(nspanel_id).render_default_page();'
|
|
- min_length: 500ms
|
|
max_length: 2000ms
|
|
then:
|
|
- homeassistant.action:
|
|
action: light.toggle
|
|
data:
|
|
entity_id: light.worktop_lights
|
|
- lambda: 'id(nspanel_id).render_default_page();'
|
|
- lambda: 'id(nspanel_id).render_next_page();'
|
|
|
|
- platform: gpio
|
|
name: Right Button
|
|
pin:
|
|
number: 27
|
|
inverted: true
|
|
on_click:
|
|
# - switch.toggle: relay_2
|
|
- min_length: 50ms
|
|
max_length: 350ms
|
|
then:
|
|
- homeassistant.action:
|
|
action: light.toggle
|
|
data:
|
|
entity_id: light.dining_table
|
|
- lambda: 'id(nspanel_id).render_default_page();'
|
|
- min_length: 500ms
|
|
max_length: 2000ms
|
|
then:
|
|
- homeassistant.action:
|
|
action: light.toggle
|
|
data:
|
|
entity_id: light.mcu_kitchen_stove
|
|
- lambda: 'id(nspanel_id).render_default_page();'
|
|
- lambda: 'id(nspanel_id).render_next_page();'
|
|
output:
|
|
- platform: ledc
|
|
id: buzzer_out
|
|
pin:
|
|
number: 21
|
|
|
|
switch:
|
|
- platform: gpio
|
|
name: Kitchen Worktop Light
|
|
id: relay_1
|
|
pin:
|
|
number: 22
|
|
|
|
- platform: gpio
|
|
name: Dining Table Light MAIN
|
|
id: relay_2
|
|
entity_category: config
|
|
pin:
|
|
number: 19
|
|
|
|
- platform: gpio
|
|
name: Screen Power
|
|
id: screen_power
|
|
entity_category: config
|
|
pin:
|
|
number: 4
|
|
inverted: true
|
|
restore_mode: ALWAYS_ON
|
|
|
|
rtttl:
|
|
id: buzzer
|
|
output: buzzer_out
|
|
|
|
sensor:
|
|
- platform: adc
|
|
id: ntc_source
|
|
pin: 38
|
|
update_interval: 5min
|
|
attenuation: 12db
|
|
|
|
- platform: resistance
|
|
id: resistance_sensor
|
|
sensor: ntc_source
|
|
configuration: DOWNSTREAM
|
|
resistor: 11.2kOhm
|
|
|
|
- platform: ntc
|
|
name: "Living Room Temperature"
|
|
id: temperature
|
|
sensor: resistance_sensor
|
|
calibration:
|
|
b_constant: 3950
|
|
reference_temperature: 25°C
|
|
reference_resistance: 10kOhm
|
|
|
|
text_sensor:
|
|
- platform: homeassistant
|
|
id: name_day
|
|
entity_id: sensor.nameday_sk
|
|
on_value:
|
|
- lambda: |-
|
|
id(nspanel_id).set_time_format("%H:%M~" + x);
|
|
id(nspanel_id).update_time();
|