hottis modbus relay 6

This commit is contained in:
2025-11-27 17:34:08 +01:00
parent 3d759bd3ff
commit db43854156
3 changed files with 111 additions and 0 deletions

View File

@@ -393,6 +393,9 @@
case 'temp_humidity_sensor': case 'temp_humidity_sensor':
renderTempHumidityDisplay(container); renderTempHumidityDisplay(container);
break; break;
case 'three_phase_powermeter':
renderThreePhasePowerDisplay(container);
break;
case 'cover': case 'cover':
renderCoverControls(container); renderCoverControls(container);
break; break;
@@ -565,6 +568,93 @@
container.appendChild(card); container.appendChild(card);
} }
function renderThreePhasePowerDisplay(container) {
const card = document.createElement('div');
card.className = 'card';
card.innerHTML = '<div class="card-title">Leistungsmessung</div>';
// Übersicht
const overviewGrid = document.createElement('div');
overviewGrid.className = 'state-grid';
overviewGrid.innerHTML = `
<div class="state-item">
<div class="state-value" id="total-power">${deviceState.total_power?.toFixed(0) || '--'} W</div>
<div class="state-label">Gesamtleistung</div>
</div>
<div class="state-item">
<div class="state-value" id="energy">${deviceState.energy?.toFixed(2) || '--'} kWh</div>
<div class="state-label">Energie</div>
</div>
`;
card.appendChild(overviewGrid);
// Phasen Details
const phaseCard = document.createElement('div');
phaseCard.className = 'card';
phaseCard.innerHTML = '<div class="card-title">Phasen</div>';
phaseCard.style.marginTop = '20px';
const phaseGrid = document.createElement('div');
phaseGrid.className = 'phase-grid';
phaseGrid.innerHTML = `
<div class="phase-section">
<h4>Phase 1</h4>
<div class="phase-values">
<div class="phase-value">
<span class="value" id="phase1-power">${deviceState.phase1_power?.toFixed(0) || '--'}</span>
<span class="unit">W</span>
</div>
<div class="phase-value">
<span class="value" id="phase1-voltage">${deviceState.phase1_voltage?.toFixed(1) || '--'}</span>
<span class="unit">V</span>
</div>
<div class="phase-value">
<span class="value" id="phase1-current">${deviceState.phase1_current?.toFixed(2) || '--'}</span>
<span class="unit">A</span>
</div>
</div>
</div>
<div class="phase-section">
<h4>Phase 2</h4>
<div class="phase-values">
<div class="phase-value">
<span class="value" id="phase2-power">${deviceState.phase2_power?.toFixed(0) || '--'}</span>
<span class="unit">W</span>
</div>
<div class="phase-value">
<span class="value" id="phase2-voltage">${deviceState.phase2_voltage?.toFixed(1) || '--'}</span>
<span class="unit">V</span>
</div>
<div class="phase-value">
<span class="value" id="phase2-current">${deviceState.phase2_current?.toFixed(2) || '--'}</span>
<span class="unit">A</span>
</div>
</div>
</div>
<div class="phase-section">
<h4>Phase 3</h4>
<div class="phase-values">
<div class="phase-value">
<span class="value" id="phase3-power">${deviceState.phase3_power?.toFixed(0) || '--'}</span>
<span class="unit">W</span>
</div>
<div class="phase-value">
<span class="value" id="phase3-voltage">${deviceState.phase3_voltage?.toFixed(1) || '--'}</span>
<span class="unit">V</span>
</div>
<div class="phase-value">
<span class="value" id="phase3-current">${deviceState.phase3_current?.toFixed(2) || '--'}</span>
<span class="unit">A</span>
</div>
</div>
</div>
`;
phaseCard.appendChild(phaseGrid);
container.appendChild(card);
container.appendChild(phaseCard);
}
function renderCoverControls(container) { function renderCoverControls(container) {
const card = document.createElement('div'); const card = document.createElement('div');
card.className = 'card'; card.className = 'card';

View File

@@ -231,6 +231,7 @@
'thermostat': '🌡️', 'thermostat': '🌡️',
'contact': '🚪', 'contact': '🚪',
'temp_humidity_sensor': '🌡️', 'temp_humidity_sensor': '🌡️',
'three_phase_powermeter': '📊',
'relay': '💡', 'relay': '💡',
'outlet': '💡', 'outlet': '💡',
'cover': '🪟' 'cover': '🪟'
@@ -403,6 +404,15 @@
} }
break; break;
case 'three_phase_powermeter':
if (state.total_power != null) {
html = `<div class="state-primary">${state.total_power.toFixed(0)} W</div>`;
if (state.energy != null) {
html += `<div class="state-secondary">${state.energy.toFixed(2)} kWh</div>`;
}
}
break;
case 'relay': case 'relay':
case 'outlet': case 'outlet':
if (state.power) { if (state.power) {

View File

@@ -279,4 +279,15 @@ rooms:
title: Licht Terasse title: Licht Terasse
icon: 💡 icon: 💡
rank: 290 rank: 290
- name: Garage
devices:
- device_id: power_relay_caroutlet
title: Ladestrom
icon:
rank: 310
- device_id: powermeter_caroutlet
title: Ladestrom
icon: 📊
rank: 320