feat: discover Symcon room utility meters and sum floor consumption
This commit is contained in:
1 parent
18e73194e0
commit
a804fc8e15
27 files changed
+2504
-1874
No files matched your search
@@ -10,6 +10,8 @@ import { pluginRoomSections } from "../plugins/registry.ts";
|
||||
import { canAnnounce, roomHasSpeaker } from "../live/announce.ts";
|
||||
import { isSymcon, nativeText } from "../entities/symcon-values.ts";
|
||||
import "./room-hvac.ts";
|
||||
import "./utility-report.ts";
|
||||
import { roomUtilityReadings } from "../utilities.ts";
|
||||
import type { Building, Floor, LightMood, LightSetting, Room } from "../model.ts";
|
||||
import { roomPower, roomPowerSensors } from "../heatmap.ts";
|
||||
import { energyCost, loadRoomEnergy, type RoomEnergy } from "../live/room-energy.ts";
|
||||
@@ -209,6 +211,7 @@ export class NfRoomPanel extends LitElement {
|
||||
|
||||
private async loadEnergy(room: Room): Promise<void> {
|
||||
if (!this.floor || !this.building) return;
|
||||
if (isSymcon(this.hass)) { this._energy = null; return; }
|
||||
const ids = roomPowerSensors(this.hass, this.building, this.floor, room);
|
||||
try {
|
||||
const energy = await loadRoomEnergy(this.hass, ids);
|
||||
@@ -482,6 +485,7 @@ export class NfRoomPanel extends LitElement {
|
||||
</button>
|
||||
</header>
|
||||
<div class="nf-rp-body" ?hidden=${this._folded}>
|
||||
<nf-utility-report .hass=${this.hass} .readings=${roomUtilityReadings(this.hass, room, this.building?.floors.flatMap((f) => f.rooms))}></nf-utility-report>
|
||||
${this.renderAllOff([...lights, ...media, ...switches])}
|
||||
${this.renderClean(room)}
|
||||
${!room.area_id && !outside && !(isSymcon(this.hass) && hvacRefs.length)
|
||||
|
||||
Reference in new issue
Block a user