Compare commits

...

4 Commits

Author SHA1 Message Date
5f3185894d licht keller flur 3
All checks were successful
ci/woodpecker/tag/namespace Pipeline was successful
ci/woodpecker/tag/config Pipeline was successful
2025-12-10 20:58:45 +01:00
fb828c9a2c licht keller flur 2
All checks were successful
ci/woodpecker/tag/namespace Pipeline was successful
ci/woodpecker/tag/config Pipeline was successful
2025-12-10 20:50:34 +01:00
064ee6bbed licht keller flur
All checks were successful
ci/woodpecker/tag/namespace Pipeline was successful
ci/woodpecker/tag/config Pipeline was successful
2025-12-10 20:47:40 +01:00
d39bcfce26 excluded 2
All checks were successful
ci/woodpecker/tag/build/5 Pipeline was successful
ci/woodpecker/tag/build/6 Pipeline was successful
ci/woodpecker/tag/namespace Pipeline was successful
ci/woodpecker/tag/build/1 Pipeline was successful
ci/woodpecker/tag/build/4 Pipeline was successful
ci/woodpecker/tag/config Pipeline was successful
ci/woodpecker/tag/build/3 Pipeline was successful
ci/woodpecker/tag/build/7 Pipeline was successful
ci/woodpecker/tag/build/2 Pipeline was successful
ci/woodpecker/tag/deploy/5 Pipeline was successful
ci/woodpecker/tag/deploy/2 Pipeline was successful
ci/woodpecker/tag/deploy/4 Pipeline was successful
ci/woodpecker/tag/deploy/1 Pipeline was successful
ci/woodpecker/tag/deploy/6 Pipeline was successful
ci/woodpecker/tag/deploy/3 Pipeline was successful
ci/woodpecker/tag/ingress Pipeline was successful
2025-12-09 17:38:46 +01:00
3 changed files with 110 additions and 33 deletions

View File

@@ -48,11 +48,11 @@ class HeatingControlRequest(BaseModel):
target: float # Target temperature
def get_room_devices(room_name: str) -> list[dict[str, Any]]:
def get_room_devices(room_id: str) -> list[dict[str, Any]]:
"""Get all devices in a specific room from layout.
Args:
room_name: Name of the room
room_id: ID of the room
Returns:
List of device dicts with device_id, title, icon, rank, excluded
@@ -63,7 +63,7 @@ def get_room_devices(room_name: str) -> list[dict[str, Any]]:
layout = load_layout()
for room in layout.rooms:
if room.name == room_name:
if room.id == room_id:
return [
{
"device_id": device.device_id,
@@ -77,16 +77,16 @@ def get_room_devices(room_name: str) -> list[dict[str, Any]]:
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND,
detail=f"Room '{room_name}' not found"
detail=f"Room '{room_id}' not found"
)
@router.post("/rooms/{room_name}/lights", status_code=status.HTTP_202_ACCEPTED)
async def control_room_lights(room_name: str, request: LightsControlRequest) -> dict[str, Any]:
@router.post("/rooms/{room_id}/lights", status_code=status.HTTP_202_ACCEPTED)
async def control_room_lights(room_id: str, request: LightsControlRequest) -> dict[str, Any]:
"""Control all lights (light and relay devices) in a room.
Args:
room_name: Name of the room
room_id: ID of the room
request: Light control parameters
Returns:
@@ -95,7 +95,7 @@ async def control_room_lights(room_name: str, request: LightsControlRequest) ->
from apps.api.main import load_devices, publish_abstract_set
# Get all devices in room
room_devices = get_room_devices(room_name)
room_devices = get_room_devices(room_id)
# Filter out excluded devices
room_device_ids = {d["device_id"] for d in room_devices if not d.get("excluded", False)}
@@ -112,7 +112,7 @@ async def control_room_lights(room_name: str, request: LightsControlRequest) ->
if not light_devices:
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND,
detail=f"No light devices found in room '{room_name}'"
detail=f"No light devices found in room '{room_id}'"
)
# Build payload
@@ -141,7 +141,7 @@ async def control_room_lights(room_name: str, request: LightsControlRequest) ->
})
return {
"room": room_name,
"room": room_id,
"command": "lights",
"payload": payload,
"affected_devices": affected_ids,
@@ -151,12 +151,12 @@ async def control_room_lights(room_name: str, request: LightsControlRequest) ->
}
@router.post("/rooms/{room_name}/heating", status_code=status.HTTP_202_ACCEPTED)
async def control_room_heating(room_name: str, request: HeatingControlRequest) -> dict[str, Any]:
@router.post("/rooms/{room_id}/heating", status_code=status.HTTP_202_ACCEPTED)
async def control_room_heating(room_id: str, request: HeatingControlRequest) -> dict[str, Any]:
"""Control all thermostats in a room.
Args:
room_name: Name of the room
room_id: ID of the room
request: Heating control parameters
Returns:
@@ -165,7 +165,7 @@ async def control_room_heating(room_name: str, request: HeatingControlRequest) -
from apps.api.main import load_devices, publish_abstract_set
# Get all devices in room
room_devices = get_room_devices(room_name)
room_devices = get_room_devices(room_id)
# Filter out excluded devices
room_device_ids = {d["device_id"] for d in room_devices if not d.get("excluded", False)}
@@ -209,7 +209,7 @@ async def control_room_heating(room_name: str, request: HeatingControlRequest) -
})
return {
"room": room_name,
"room": room_id,
"command": "heating",
"payload": payload,
"affected_devices": affected_ids,

View File

@@ -898,3 +898,54 @@ devices:
set: "zigbee2mqtt/0x842e14fffea72027/set"
- device_id: keller_flur_licht
name: Keller Flur Licht
type: relay
cap_version: "relay@1.0.0"
technology: hottis_wago_modbus
features:
power: true
topics:
set: "pulsegen/command/10/21"
state: "pulsegen/status/10"
- device_id: waschkueche_licht
name: Waschküche Licht
type: relay
cap_version: "relay@1.0.0"
technology: hottis_wago_modbus
features:
power: true
topics:
set: "pulsegen/command/8/22"
state: "pulsegen/status/8"
- device_id: werkstatt_licht
name: Werkstatt Licht
type: relay
cap_version: "relay@1.0.0"
technology: hottis_wago_modbus
features:
power: true
topics:
set: "pulsegen/command/7/19"
state: "pulsegen/status/7"
- device_id: sportzimmer_licht
name: Sportzimmer Licht
type: relay
cap_version: "relay@1.0.0"
technology: hottis_wago_modbus
features:
power: true
topics:
set: "pulsegen/command/9/20"
state: "pulsegen/status/9"
- device_id: deckenlampe_patty
name: Deckenlampe Patty
type: relay
cap_version: "relay@1.0.0"
technology: hottis_wago_modbus
features:
power: true
topics:
set: "pulsegen/command/4/16"
state: "pulsegen/status/4"

View File

@@ -1,5 +1,5 @@
rooms:
- id: Schlafzimmer
- id: schlafzimmer
name: Schlafzimmer
devices:
- device_id: bettlicht_patty
@@ -34,7 +34,7 @@ rooms:
title: Temperatur & Luftfeuchte
icon: 🌡️
rank: 47
- id: Esszimmer
- id: esszimmer
name: Esszimmer
devices:
- device_id: deckenlampe_esszimmer
@@ -81,7 +81,7 @@ rooms:
title: Kontakt Straße links
icon: 🪟
rank: 97
- id: Wohnzimmer
- id: wohnzimmer
name: Wohnzimmer
devices:
- device_id: lampe_naehtischchen_wohnzimmer
@@ -124,7 +124,7 @@ rooms:
title: Temperatur & Luftfeuchte
icon: 🌡️
rank: 138
- id: che
- id: kueche
name: Küche
devices:
- device_id: kueche_deckenlampe
@@ -168,7 +168,7 @@ rooms:
title: Temperatur & Luftfeuchte
icon: 🌡️
rank: 155
- id: Arbeitszimmer Patty
- id: arbeitszimmer_patty
name: Arbeitszimmer Patty
devices:
- device_id: leselampe_patty
@@ -176,23 +176,27 @@ rooms:
icon: 💡
rank: 160
- device_id: schranklicht_hinten_patty
title: Schranklicht hinten Patty
title: Schranklicht hinten
icon: 💡
rank: 170
- device_id: schranklicht_vorne_patty
title: Schranklicht vorne Patty
title: Schranklicht vorne
icon: 💡
rank: 180
- device_id: kugellampe_patty
title: Kugellampe Patty
title: Kugellampe
icon: 💡
rank: 181
- device_id: licht_schreibtisch_patty
title: Licht Schreibtisch Patty
title: Licht Schreibtisch
icon: 💡
rank: 182
- device_id: deckenlampe_patty
title: Deckenlampe
icon: 💡
rank: 183
- device_id: thermostat_patty
title: Thermostat Patty
title: Thermostat
icon: 🌡️
rank: 185
- device_id: kontakt_patty_garten_rechts
@@ -211,7 +215,7 @@ rooms:
title: Temperatur & Luftfeuchte
icon: 🌡️
rank: 189
- id: Arbeitszimmer Wolfgang
- id: arbeitszimmer_wolfgang
name: Arbeitszimmer Wolfgang
devices:
- device_id: thermostat_wolfgang
@@ -230,7 +234,7 @@ rooms:
title: Temperatur & Luftfeuchte
icon: 🌡️
rank: 202
- id: Flur
- id: flur
name: Flur
devices:
- device_id: deckenlampe_flur_oben
@@ -257,7 +261,7 @@ rooms:
title: Temperatur & Luftfeuchte
icon: 🌡️
rank: 235
- id: Sportzimmer
- id: sportzimmer
name: Sportzimmer
devices:
- device_id: sportlicht_regal
@@ -272,11 +276,15 @@ rooms:
title: Sportlicht am Fernseher, Studierzimmer
icon: 🏃
rank: 260
- device_id: sportzimmer_licht
title: Deckenlampe
icon: 💡
rank: 262
- device_id: sensor_sportzimmer
title: Temperatur & Luftfeuchte
icon: 🌡️
rank: 265
- id: Bad Oben
- id: bad_oben
name: Bad Oben
devices:
- device_id: thermostat_bad_oben
@@ -291,7 +299,7 @@ rooms:
title: Temperatur & Luftfeuchte
icon: 🌡️
rank: 272
- id: Bad Unten
- id: bad_unten
name: Bad Unten
devices:
- device_id: thermostat_bad_unten
@@ -306,14 +314,19 @@ rooms:
title: Temperatur & Luftfeuchte
icon: 🌡️
rank: 282
- id: Waschküche
- id: waschkueche
name: Waschküche
devices:
- device_id: sensor_waschkueche
title: Temperatur & Luftfeuchte
icon: 🌡️
rank: 290
- id: Outdoor
- device_id: waschkueche_licht
title: Waschküche Licht
icon: 💡
rank: 340
- id: outdoor
name: Outdoor
devices:
- device_id: licht_terasse
@@ -324,7 +337,7 @@ rooms:
title: Gartenlicht vorne
icon: 💡
rank: 291
- id: Garage
- id: garage
name: Garage
devices:
- device_id: power_relay_caroutlet
@@ -339,5 +352,18 @@ rooms:
title: Messwerte
icon: 📊
rank: 320
- id: keller
name: Keller
devices:
- device_id: keller_flur_licht
title: Keller Flur Licht
icon: 💡
rank: 330
- device_id: werkstatt_licht
title: Werkstatt Licht
icon: 💡
rank: 350