This commit is contained in:
2025-11-27 16:40:09 +01:00
parent 84e401778e
commit 84fe6eea96
4 changed files with 100 additions and 1 deletions

View File

@@ -10,6 +10,9 @@ from packages.home_capabilities.temp_humidity_sensor import CAP_VERSION as TEMP_
from packages.home_capabilities.temp_humidity_sensor import TempHumidityState
from packages.home_capabilities.relay import CAP_VERSION as RELAY_VERSION
from packages.home_capabilities.relay import RelayState
from packages.home_capabilities.three_phase_powermeter import CAP_VERSION as THREE_PHASE_POWERMETER_VERSION
from packages.home_capabilities.three_phase_powermeter import ThreePhasePowerState
from packages.home_capabilities.layout import (
DeviceTile,
Room,
@@ -56,4 +59,5 @@ __all__ = [
"get_scene_by_id",
"load_groups",
"load_scenes",
"ThreePhasePowerState",
]

View File

@@ -0,0 +1,29 @@
from pydantic import BaseModel, Field
class ThreePhasePowerState(BaseModel):
"""
State model for a three-phase power meter.
Required fields:
- energy: Total energy in kWh
- total_power: Total power in W
- phase1_power, phase2_power, phase3_power: Power per phase in W
- phase1_voltage, phase2_voltage, phase3_voltage: Voltage per phase in V
- phase1_current, phase2_current, phase3_current: Current per phase in A
"""
energy: float = Field(..., description="Total energy in kWh")
total_power: float = Field(..., description="Total power in W")
phase1_power: float = Field(..., description="Power for phase 1 in W")
phase2_power: float = Field(..., description="Power for phase 2 in W")
phase3_power: float = Field(..., description="Power for phase 3 in W")
phase1_voltage: float = Field(..., description="Voltage for phase 1 in V")
phase2_voltage: float = Field(..., description="Voltage for phase 2 in V")
phase3_voltage: float = Field(..., description="Voltage for phase 3 in V")
phase1_current: float = Field(..., description="Current for phase 1 in A")
phase2_current: float = Field(..., description="Current for phase 2 in A")
phase3_current: float = Field(..., description="Current for phase 3 in A")
# Capability metadata
CAP_VERSION = "three_phase_powermeter@1.0.0"
DISPLAY_NAME = "Three-Phase Power Meter"