Compare commits
6 Commits
0.10.3-con
...
0.10.8
| Author | SHA1 | Date | |
|---|---|---|---|
|
b471ab5edc
|
|||
|
3e0a1b49ab
|
|||
|
befdc8a46c
|
|||
|
da16c59238
|
|||
|
5f3185894d
|
|||
|
fb828c9a2c
|
@@ -19,6 +19,7 @@ from apps.abstraction.vendors import (
|
|||||||
tasmota,
|
tasmota,
|
||||||
hottis_pv_modbus,
|
hottis_pv_modbus,
|
||||||
hottis_wago_modbus,
|
hottis_wago_modbus,
|
||||||
|
hottis_wifi_relay,
|
||||||
)
|
)
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@@ -42,6 +43,7 @@ for vendor_name, vendor_module in [
|
|||||||
("tasmota", tasmota),
|
("tasmota", tasmota),
|
||||||
("hottis_pv_modbus", hottis_pv_modbus),
|
("hottis_pv_modbus", hottis_pv_modbus),
|
||||||
("hottis_wago_modbus", hottis_wago_modbus),
|
("hottis_wago_modbus", hottis_wago_modbus),
|
||||||
|
("hottis_wifi_relay", hottis_wifi_relay),
|
||||||
]:
|
]:
|
||||||
for (device_type, direction), handler in vendor_module.HANDLERS.items():
|
for (device_type, direction), handler in vendor_module.HANDLERS.items():
|
||||||
key = (device_type, vendor_name, direction)
|
key = (device_type, vendor_name, direction)
|
||||||
|
|||||||
38
apps/abstraction/vendors/hottis_wifi_relay.py
vendored
Normal file
38
apps/abstraction/vendors/hottis_wifi_relay.py
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
"""Hottis WiFi Relay vendor transformations."""
|
||||||
|
|
||||||
|
import logging
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
def transform_relay_to_vendor(payload: dict[str, Any]) -> str:
|
||||||
|
"""Transform abstract relay payload to Hottis WiFi Relay format.
|
||||||
|
|
||||||
|
Hottis WiFi Relay expects plain text 'on' or 'off' (not JSON).
|
||||||
|
|
||||||
|
Example:
|
||||||
|
- Abstract: {'power': 'on'}
|
||||||
|
- Hottis WiFi Relay: 'ON'
|
||||||
|
"""
|
||||||
|
power = payload.get("power", "off").upper()
|
||||||
|
return power
|
||||||
|
|
||||||
|
|
||||||
|
def transform_relay_to_abstract(payload: str) -> dict[str, Any]:
|
||||||
|
"""Transform Hottis WiFi Relay relay payload to abstract format.
|
||||||
|
|
||||||
|
Hottis WiFi Relay sends plain text 'on' or 'off'.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
- Hottis WiFi Relay: 'ON'
|
||||||
|
- Abstract: {'power': 'on'}
|
||||||
|
"""
|
||||||
|
return {"power": payload.strip().lower()}
|
||||||
|
|
||||||
|
|
||||||
|
# Registry of handlers for this vendor
|
||||||
|
HANDLERS = {
|
||||||
|
("relay", "to_vendor"): transform_relay_to_vendor,
|
||||||
|
("relay", "to_abstract"): transform_relay_to_abstract,
|
||||||
|
}
|
||||||
@@ -907,4 +907,54 @@ devices:
|
|||||||
power: true
|
power: true
|
||||||
topics:
|
topics:
|
||||||
set: "pulsegen/command/10/21"
|
set: "pulsegen/command/10/21"
|
||||||
state: "pulsegen/state/10"
|
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"
|
||||||
|
- device_id: regallampe_esszimmer
|
||||||
|
name: Regallampe Esszimmer
|
||||||
|
type: relay
|
||||||
|
cap_version: "relay@1.0.0"
|
||||||
|
technology: hottis_wifi_relay
|
||||||
|
features:
|
||||||
|
power: true
|
||||||
|
topics:
|
||||||
|
set: "IoT/WifiRelay1/State"
|
||||||
|
state: "IoT/WifiRelay1/State"
|
||||||
@@ -61,10 +61,10 @@ rooms:
|
|||||||
title: Stehlampe Esszimmer Schrank
|
title: Stehlampe Esszimmer Schrank
|
||||||
icon: 💡
|
icon: 💡
|
||||||
rank: 82
|
rank: 82
|
||||||
# - device_id: kleine_lampe_rechts_esszimmer
|
- device_id: regallampe_esszimmer
|
||||||
# title: kleine Lampe rechts Esszimmer
|
title: Regallampe Esszimmer
|
||||||
# icon: 💡
|
icon: 💡
|
||||||
# rank: 90
|
rank: 90
|
||||||
- device_id: licht_schrank_esszimmer
|
- device_id: licht_schrank_esszimmer
|
||||||
title: Schranklicht Esszimmer
|
title: Schranklicht Esszimmer
|
||||||
icon: 💡
|
icon: 💡
|
||||||
@@ -176,23 +176,27 @@ rooms:
|
|||||||
icon: 💡
|
icon: 💡
|
||||||
rank: 160
|
rank: 160
|
||||||
- device_id: schranklicht_hinten_patty
|
- device_id: schranklicht_hinten_patty
|
||||||
title: Schranklicht hinten Patty
|
title: Schranklicht hinten
|
||||||
icon: 💡
|
icon: 💡
|
||||||
rank: 170
|
rank: 170
|
||||||
- device_id: schranklicht_vorne_patty
|
- device_id: schranklicht_vorne_patty
|
||||||
title: Schranklicht vorne Patty
|
title: Schranklicht vorne
|
||||||
icon: 💡
|
icon: 💡
|
||||||
rank: 180
|
rank: 180
|
||||||
- device_id: kugellampe_patty
|
- device_id: kugellampe_patty
|
||||||
title: Kugellampe Patty
|
title: Kugellampe
|
||||||
icon: 💡
|
icon: 💡
|
||||||
rank: 181
|
rank: 181
|
||||||
- device_id: licht_schreibtisch_patty
|
- device_id: licht_schreibtisch_patty
|
||||||
title: Licht Schreibtisch Patty
|
title: Licht Schreibtisch
|
||||||
icon: 💡
|
icon: 💡
|
||||||
rank: 182
|
rank: 182
|
||||||
|
- device_id: deckenlampe_patty
|
||||||
|
title: Deckenlampe
|
||||||
|
icon: 💡
|
||||||
|
rank: 183
|
||||||
- device_id: thermostat_patty
|
- device_id: thermostat_patty
|
||||||
title: Thermostat Patty
|
title: Thermostat
|
||||||
icon: 🌡️
|
icon: 🌡️
|
||||||
rank: 185
|
rank: 185
|
||||||
- device_id: kontakt_patty_garten_rechts
|
- device_id: kontakt_patty_garten_rechts
|
||||||
@@ -272,6 +276,10 @@ rooms:
|
|||||||
title: Sportlicht am Fernseher, Studierzimmer
|
title: Sportlicht am Fernseher, Studierzimmer
|
||||||
icon: 🏃
|
icon: 🏃
|
||||||
rank: 260
|
rank: 260
|
||||||
|
- device_id: sportzimmer_licht
|
||||||
|
title: Deckenlampe
|
||||||
|
icon: 💡
|
||||||
|
rank: 262
|
||||||
- device_id: sensor_sportzimmer
|
- device_id: sensor_sportzimmer
|
||||||
title: Temperatur & Luftfeuchte
|
title: Temperatur & Luftfeuchte
|
||||||
icon: 🌡️
|
icon: 🌡️
|
||||||
@@ -313,6 +321,11 @@ rooms:
|
|||||||
title: Temperatur & Luftfeuchte
|
title: Temperatur & Luftfeuchte
|
||||||
icon: 🌡️
|
icon: 🌡️
|
||||||
rank: 290
|
rank: 290
|
||||||
|
- device_id: waschkueche_licht
|
||||||
|
title: Waschküche Licht
|
||||||
|
icon: 💡
|
||||||
|
rank: 340
|
||||||
|
|
||||||
- id: outdoor
|
- id: outdoor
|
||||||
name: Outdoor
|
name: Outdoor
|
||||||
devices:
|
devices:
|
||||||
@@ -346,6 +359,11 @@ rooms:
|
|||||||
title: Keller Flur Licht
|
title: Keller Flur Licht
|
||||||
icon: 💡
|
icon: 💡
|
||||||
rank: 330
|
rank: 330
|
||||||
|
- device_id: werkstatt_licht
|
||||||
|
title: Werkstatt Licht
|
||||||
|
icon: 💡
|
||||||
|
rank: 350
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user