nspanel_terminal: heating icons on the home page

A row of state icons above today's weather, filled by packages (the first
one on the right):
- fireplace_icon.yaml: the fireplace burning or out.
- radiator_icon.yaml: per thermostat; disabled while it does not call for
  heat, off while it does but the off-peak tariff has the boiler hard off and
  the fireplace is out, on while it heats.
Both hide outside the heating season (boiler switch off, fireplace out).
This commit is contained in:
randy committed 2026-10-31 23:33:27 +01:00
1 parent 697af24f47
commit 203fc5e26d
9 files changed
+152

No files matched your search

@@ -0,0 +1,44 @@
# Package: fireplace icon in the home page icon row (white while it burns, grey while not, dark grey unavailable).
# Hidden outside the heating season: fire out and the boiler switch off.
# defaults: entity (fire binary_sensor), boiler (switch that lets the boiler fire)
defaults:
entity: binary_sensor.heating_fireplace_fire
boiler: switch.heating_enabled
lvgl:
pages:
- id: !extend page_home
widgets:
- obj:
id: !extend home_icons
widgets:
- label:
id: fireplace_icon
text: "\U000F0E2F"
text_font: icon_s
text_color: 0x48484A
script:
- id: fireplace_icon_update
then:
- lambda: |-
const std::string &fire = id(fireplace_fire).state;
const bool on = fire == "on";
lv_label_set_text(id(fireplace_icon), on ? "\U000F0E2E" : "\U000F0E2F");
lv_obj_set_style_text_color(id(fireplace_icon), lv_color_hex(on ? 0xFFFFFF : ha_unavailable(fire) ? 0x48484A : 0x8E8E93), 0);
lv_obj_set_hidden(id(fireplace_icon), fire == "off" && id(fireplace_boiler).state == "off");
text_sensor:
# text, not binary: a binary sensor drops "unavailable"
- platform: homeassistant
id: fireplace_fire
entity_id: ${entity}
internal: true
on_value:
- script.execute: fireplace_icon_update
- platform: homeassistant
id: fireplace_boiler
entity_id: ${boiler}
internal: true
on_value:
- script.execute: fireplace_icon_update
+19
View File
@@ -291,6 +291,10 @@ font:
- "\U000F07F4"
- "\U000F0C6E"
- "\U000F0DDC"
- "\U000F0E2E"
- "\U000F0E2F"
- "\U000F0AD7"
- "\U000F0AD8"
- file:
type: web
url: https://github.com/Templarian/MaterialDesign-Webfont/raw/v7.4.47/fonts/materialdesignicons-webfont.ttf
@@ -744,6 +748,21 @@ lvgl:
id: today_low
text: ""
text_color: 0x8E8E93
# state icons above today's weather; *_icon.yaml packages add them, the first one on the right
- obj:
id: home_icons
clickable: false
align: BOTTOM_RIGHT
y: -90
width: SIZE_CONTENT
height: SIZE_CONTENT
bg_opa: TRANSP
border_width: 0
pad_all: 0
layout:
type: FLEX
flex_flow: ROW_REVERSE
pad_column: 14
# Status: boot screen until Home Assistant connects, then the last (diagnostic) page
- id: page_status
styles: page_style
@@ -0,0 +1,70 @@
# Package: radiator icon in the home page icon row:
# disabled (grey) while the thermostat does not call for heat, off (grey) while it does but the off-peak tariff
# is off (the boiler is then hard off) and the fireplace is out, on (white) while it heats.
# Hidden outside the heating season: boiler switch off and the fireplace out.
# vars: id (prefix of its ids, unique per icon), entity (climate);
# defaults: boiler (switch that lets the boiler fire), fire (fireplace binary_sensor), off_peak (tariff binary_sensor)
defaults:
boiler: switch.heating_enabled
fire: binary_sensor.heating_fireplace_fire
off_peak: binary_sensor.heater_off_peak
lvgl:
pages:
- id: !extend page_home
widgets:
- obj:
id: !extend home_icons
widgets:
- label:
id: ${id}_icon
text: "\U000F0AD8"
text_font: icon_s
text_color: 0x48484A
script:
- id: ${id}_update
then:
- lambda: |-
const std::string &boiler = id(${id}_boiler).state, &fire = id(${id}_fire).state;
const bool demand = id(${id}_action).state == "heating";
// the burning fireplace heats the water without the boiler
const bool heating = demand && (id(${id}_off_peak).state != "off" || fire == "on");
lv_label_set_text(id(${id}_icon), !demand ? "\U000F0AD7" : heating ? "\U000F0438" : "\U000F0AD8");
const bool unavailable = ha_unavailable(id(${id}_mode).state);
lv_obj_set_style_text_color(id(${id}_icon), lv_color_hex(heating ? 0xFFFFFF : unavailable ? 0x48484A : 0x8E8E93), 0);
lv_obj_set_hidden(id(${id}_icon), boiler == "off" && fire == "off");
text_sensor:
- platform: homeassistant
id: ${id}_boiler
entity_id: ${boiler}
internal: true
on_value:
- script.execute: ${id}_update
- platform: homeassistant
id: ${id}_fire
entity_id: ${fire}
internal: true
on_value:
- script.execute: ${id}_update
- platform: homeassistant
id: ${id}_off_peak
entity_id: ${off_peak}
internal: true
on_value:
- script.execute: ${id}_update
# the climate state only tells whether the thermostat is reachable
- platform: homeassistant
id: ${id}_mode
entity_id: ${entity}
internal: true
on_value:
- script.execute: ${id}_update
- platform: homeassistant
id: ${id}_action
entity_id: ${entity}
attribute: hvac_action
internal: true
on_value:
- script.execute: ${id}_update