From 29b375df681915b134fc16cf459df45929232b4f Mon Sep 17 00:00:00 2001 From: Roman Priesol Date: Mon, 28 Sep 2026 20:51:05 +0200 Subject: [PATCH] nspanel: move shared config to common/nspanel.yaml, add TFT version sensor --- common/nspanel.yaml | 162 +++++++++++++++++++++++++++++++ common/nspanel_sleep_dim.yaml | 42 ++++++++ mcu-nspanel-bedroom.yaml | 174 ++------------------------------- mcu-nspanel-fireplace.yaml | 136 +------------------------- mcu-nspanel-office-j.yaml | 176 ++-------------------------------- mcu-nspanel-office-r.yaml | 136 ++------------------------ mcu-nspanel-patio.yaml | 137 +------------------------- 7 files changed, 237 insertions(+), 726 deletions(-) create mode 100644 common/nspanel.yaml create mode 100644 common/nspanel_sleep_dim.yaml diff --git a/common/nspanel.yaml b/common/nspanel.yaml new file mode 100644 index 0000000..33847cf --- /dev/null +++ b/common/nspanel.yaml @@ -0,0 +1,162 @@ +--- +# Sonoff NSPanel with the native Lovelace UI (randybb/esphome-nspanel-lovelace-native). +# The device file adds the cards, buttons and relays: +# packages: +# common: !include common/common.yaml +# nspanel: !include +# file: common/nspanel.yaml +# vars: +# temperature_entity: sensor.zigbee_bedroom_temperature +# nspanel_lovelace: +# cards: [...] +defaults: + temperature_name: Temperature + ntc_reference_temperature: 25°C + +esphome: + 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] + +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: ${temperature_entity} + icon: + value: home-thermometer-outline + color: [255, 255, 255] + precision: 1 + +output: + - platform: ledc + id: buzzer_out + pin: + number: 21 + +switch: + - 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: ${temperature_name} + id: temperature + sensor: resistance_sensor + calibration: + b_constant: 3950 + reference_temperature: ${ntc_reference_temperature} + 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(); + + # HMI protocol version reported by the TFT on startup (52/53 for this UI) + - platform: template + name: TFT Version + entity_category: diagnostic + update_interval: 60s + lambda: |- + using esphome::nspanel_lovelace::Configuration; + const auto ver = Configuration::get_version(); + if (ver == 0) return {"unknown"}; + return {std::to_string(ver) + " (" + Configuration::get_model_str() + ")"}; diff --git a/common/nspanel_sleep_dim.yaml b/common/nspanel_sleep_dim.yaml new file mode 100644 index 0000000..0d3dfb8 --- /dev/null +++ b/common/nspanel_sleep_dim.yaml @@ -0,0 +1,42 @@ +--- +# NSPanel screensaver dims to 0 at night (sun below -6°), unless the room lights are on. +# packages: +# sleep_dim: !include +# file: common/nspanel_sleep_dim.yaml +# vars: +# sleep_override_entity: light.bedroom_lights +script: + - id: apply_sleep_dim + then: + - lambda: |- + uint8_t dim; + if (id(sleep_override).state) dim = 5; // sleepOverride + else if (id(sun_id).is_above_horizon(-6)) dim = 5; // day + else dim = 0; // night + id(nspanel_id).set_display_inactive_dim(dim); + +time: + - id: !extend ha_time + on_time_sync: + - script.execute: apply_sleep_dim + +binary_sensor: + - platform: homeassistant # sleepOverride + id: sleep_override + entity_id: ${sleep_override_entity} + on_state: + - script.execute: apply_sleep_dim + +sun: + id: sun_id + time_id: ha_time + latitude: 48.15° + longitude: 17.11° + on_sunrise: + - elevation: -6° + then: + - script.execute: apply_sleep_dim + on_sunset: + - elevation: -6° + then: + - script.execute: apply_sleep_dim diff --git a/mcu-nspanel-bedroom.yaml b/mcu-nspanel-bedroom.yaml index 950758b..8126d1f 100644 --- a/mcu-nspanel-bedroom.yaml +++ b/mcu-nspanel-bedroom.yaml @@ -11,103 +11,19 @@ esphome: 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 - -script: - - id: apply_sleep_dim - then: - - lambda: |- - uint8_t dim; - if (id(bedroom_lights).state) dim = 5; // sleepOverride - else if (id(sun_id).is_above_horizon(-6)) dim = 5; // day - else dim = 0; // night - id(nspanel_id).set_display_inactive_dim(dim); - -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: !include + file: common/nspanel.yaml + vars: + temperature_entity: sensor.zigbee_bedroom_temperature + sleep_dim: !include + file: common/nspanel_sleep_dim.yaml + vars: + sleep_override_entity: light.bedroom_lights 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_bedroom_temperature - icon: - value: home-thermometer-outline - color: [255, 255, 255] - precision: 1 cards: - type: cardGrid title: Spálňa @@ -135,11 +51,6 @@ nspanel_lovelace: title: Kúrenie thermo_entity_id: climate.bt_trv_bedroom -time: - - id: !extend ha_time - on_time_sync: - - script.execute: apply_sleep_dim - binary_sensor: - platform: gpio name: Left Button @@ -164,12 +75,6 @@ binary_sensor: entity_id: light.bedroom_lamps - lambda: 'id(nspanel_id).render_default_page();' - - platform: homeassistant # sleepOverride - id: bedroom_lights - entity_id: light.bedroom_lights - on_state: - - script.execute: apply_sleep_dim - light: - platform: binary name: Light @@ -177,10 +82,6 @@ light: output: relay_1 output: - - platform: ledc - id: buzzer_out - pin: - number: 21 - id: relay_1 platform: gpio pin: @@ -189,62 +90,3 @@ output: # platform: gpio # pin: # number: 19 - -sun: - id: sun_id - time_id: ha_time - latitude: 48.15° - longitude: 17.11° - on_sunrise: - - elevation: -6° - then: - - script.execute: apply_sleep_dim - on_sunset: - - elevation: -6° - then: - - script.execute: apply_sleep_dim - -switch: - - 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: 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(); diff --git a/mcu-nspanel-fireplace.yaml b/mcu-nspanel-fireplace.yaml index 8693faf..34e4abb 100644 --- a/mcu-nspanel-fireplace.yaml +++ b/mcu-nspanel-fireplace.yaml @@ -10,93 +10,16 @@ esphome: 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: !include + file: common/nspanel.yaml + vars: + temperature_entity: sensor.zigbee_living_room_kitchen_temperature + temperature_name: Living Room Temperature 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 @@ -235,11 +158,6 @@ binary_sensor: 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 @@ -254,47 +172,3 @@ switch: 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(); diff --git a/mcu-nspanel-office-j.yaml b/mcu-nspanel-office-j.yaml index 9dbfbda..fbfe216 100644 --- a/mcu-nspanel-office-j.yaml +++ b/mcu-nspanel-office-j.yaml @@ -10,103 +10,20 @@ esphome: 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 - -script: - - id: apply_sleep_dim - then: - - lambda: |- - uint8_t dim; - if (id(bedroom_lights).state) dim = 5; // sleepOverride - else if (id(sun_id).is_above_horizon(-6)) dim = 5; // day - else dim = 0; // night - id(nspanel_id).set_display_inactive_dim(dim); - -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: !include + file: common/nspanel.yaml + vars: + temperature_entity: sensor.zigbee_office_j_temperature + ntc_reference_temperature: 22°C + sleep_dim: !include + file: common/nspanel_sleep_dim.yaml + vars: + sleep_override_entity: light.office_j_lights 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_office_j_temperature - icon: - value: home-thermometer-outline - color: [255, 255, 255] - precision: 1 cards: - type: cardGrid title: Janko @@ -144,11 +61,6 @@ nspanel_lovelace: - name: Auto-zatváranie entity_id: switch.gate_auto_close -time: - - id: !extend ha_time - on_time_sync: - - script.execute: apply_sleep_dim - binary_sensor: - platform: gpio name: Left Button @@ -171,18 +83,7 @@ binary_sensor: entity_id: light.bedside_left - lambda: 'id(nspanel_id).render_default_page();' - - platform: homeassistant # sleepOverride - id: bedroom_lights - entity_id: light.office_j_lights - on_state: - - script.execute: apply_sleep_dim - output: - - platform: ledc - id: buzzer_out - pin: - number: 21 - - id: relay_1 platform: gpio pin: @@ -201,62 +102,3 @@ light: # # - platform: binary # # name: Relay 2 # # output: relay_2 - -sun: - id: sun_id - time_id: ha_time - latitude: 48.15° - longitude: 17.11° - on_sunrise: - - elevation: -6° - then: - - script.execute: apply_sleep_dim - on_sunset: - - elevation: -6° - then: - - script.execute: apply_sleep_dim - -switch: - - 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: Temperature - id: temperature - sensor: resistance_sensor - calibration: - b_constant: 3950 - reference_temperature: 22°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(); diff --git a/mcu-nspanel-office-r.yaml b/mcu-nspanel-office-r.yaml index 71b44fc..9cdecdd 100644 --- a/mcu-nspanel-office-r.yaml +++ b/mcu-nspanel-office-r.yaml @@ -10,34 +10,15 @@ esphome: 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 ipv6_only: !include common/ipv6_only.yaml + nspanel: !include + file: common/nspanel.yaml + vars: + temperature_entity: sensor.zigbee_office_r_temperature + ntc_reference_temperature: 22°C script: - id: geiger_click @@ -56,65 +37,7 @@ script: return esphome::random_uint32() % 450 + 50; - script.execute: geiger_click -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_office_r_temperature - icon: - value: home-thermometer-outline - color: [255, 255, 255] - precision: 1 cards: - type: cardGrid title: Romanko @@ -171,7 +94,7 @@ binary_sensor: data: entity_id: light.office_r_desk_strip - lambda: 'id(nspanel_id).render_default_page();' - + - platform: gpio name: Right Button pin: @@ -182,10 +105,6 @@ binary_sensor: - lambda: 'id(nspanel_id).render_default_page();' output: - - platform: ledc - id: buzzer_out - pin: - number: 21 - id: relay_1 platform: gpio pin: @@ -225,14 +144,6 @@ switch: id: relay_2 pin: number: 19 - - platform: gpio - name: Screen Power - id: screen_power - entity_category: config - pin: - number: 4 - inverted: true - restore_mode: ALWAYS_ON - platform: template name: "Geiger Counter" optimistic: True @@ -240,38 +151,3 @@ switch: - script.execute: geiger_click turn_off_action: - script.stop: geiger_click - -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: Temperature - id: temperature - sensor: resistance_sensor - calibration: - b_constant: 3950 - reference_temperature: 22°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(); diff --git a/mcu-nspanel-patio.yaml b/mcu-nspanel-patio.yaml index 893e3df..ca72f19 100644 --- a/mcu-nspanel-patio.yaml +++ b/mcu-nspanel-patio.yaml @@ -10,93 +10,16 @@ esphome: 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: !include + file: common/nspanel.yaml + vars: + temperature_entity: sensor.zigbee_living_room_kitchen_temperature + temperature_name: Living Room Temperature 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 @@ -246,12 +169,6 @@ binary_sensor: else: - switch.toggle: relay_2 -output: - - platform: ledc - id: buzzer_out - pin: - number: 21 - switch: - platform: gpio name: Outside Light Back @@ -266,47 +183,3 @@ switch: 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();