initial
This commit is contained in:
49
.woodpecker.yml
Normal file
49
.woodpecker.yml
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
matrix:
|
||||||
|
APP:
|
||||||
|
- ui
|
||||||
|
- api
|
||||||
|
- abstraction
|
||||||
|
- rules
|
||||||
|
|
||||||
|
env:
|
||||||
|
NAMESPACE: "homea2"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
build:
|
||||||
|
image: plugins/kaniko
|
||||||
|
settings:
|
||||||
|
repo: ${FORGE_NAME}/${CI_REPO}/${APP}
|
||||||
|
registry:
|
||||||
|
from_secret: container_registry
|
||||||
|
auto_tag: true
|
||||||
|
username:
|
||||||
|
from_secret: container_registry_username
|
||||||
|
password:
|
||||||
|
from_secret: container_registry_password
|
||||||
|
dockerfile: apps/${APP}/Dockerfile
|
||||||
|
when:
|
||||||
|
event: [push, tag]
|
||||||
|
ref:
|
||||||
|
exclude:
|
||||||
|
- refs/tags/*-configchange
|
||||||
|
|
||||||
|
create_namespace:
|
||||||
|
image: quay.io/wollud1969/k8s-admin-helper:0.3.4
|
||||||
|
environment:
|
||||||
|
KUBE_CONFIG_CONTENT:
|
||||||
|
from_secret: kube_config
|
||||||
|
commands:
|
||||||
|
- kubectl create namespace ${NAMESPACE} || echo "Namespace ${NAMESPACE} already exists"
|
||||||
|
when:
|
||||||
|
- event: [tag]
|
||||||
|
|
||||||
|
configuration:
|
||||||
|
image: quay.io/wollud1969/k8s-admin-helper:0.3.4
|
||||||
|
environment:
|
||||||
|
KUBE_CONFIG_CONTENT:
|
||||||
|
from_secret: kube_config
|
||||||
|
commands:
|
||||||
|
|
||||||
|
when:
|
||||||
|
- event: [tag]
|
||||||
|
|
||||||
@@ -783,6 +783,23 @@ devices:
|
|||||||
set: "shellies/lichtterasse/relay/0/command"
|
set: "shellies/lichtterasse/relay/0/command"
|
||||||
state: "shellies/lichtterasse/relay/0"
|
state: "shellies/lichtterasse/relay/0"
|
||||||
|
|
||||||
|
- device_id: power_relay_caroutlet
|
||||||
|
name: Car Outlet
|
||||||
|
type: relay
|
||||||
|
cap_version: "relay@1.0.0"
|
||||||
|
technology: hottis_modbus
|
||||||
|
features:
|
||||||
|
power: true
|
||||||
|
topics:
|
||||||
|
set: "caroutlet/cmd"
|
||||||
|
state: "caroutlet/state"
|
||||||
|
|
||||||
|
- device_id: powermeter_caroutlet
|
||||||
|
name: Car Outlet
|
||||||
|
type: threephase_powermeter
|
||||||
|
cap_version: "threephase_powermeter@1.0.0"
|
||||||
|
technology: hottis_modbus
|
||||||
|
topics:
|
||||||
|
state: "caroutlet/powermeter"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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.temp_humidity_sensor import TempHumidityState
|
||||||
from packages.home_capabilities.relay import CAP_VERSION as RELAY_VERSION
|
from packages.home_capabilities.relay import CAP_VERSION as RELAY_VERSION
|
||||||
from packages.home_capabilities.relay import RelayState
|
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 (
|
from packages.home_capabilities.layout import (
|
||||||
DeviceTile,
|
DeviceTile,
|
||||||
Room,
|
Room,
|
||||||
@@ -56,4 +59,5 @@ __all__ = [
|
|||||||
"get_scene_by_id",
|
"get_scene_by_id",
|
||||||
"load_groups",
|
"load_groups",
|
||||||
"load_scenes",
|
"load_scenes",
|
||||||
|
"ThreePhasePowerState",
|
||||||
]
|
]
|
||||||
|
|||||||
29
packages/home_capabilities/three_phase_powermeter.py
Normal file
29
packages/home_capabilities/three_phase_powermeter.py
Normal 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"
|
||||||
Reference in New Issue
Block a user