mirror of
https://github.com/adrianjagielak/home-assistant-futurehome.git
synced 2025-09-13 07:37:09 +00:00
Add support for 'alarm_*' services
This commit is contained in:
parent
dc4e676d38
commit
5d8ce20bff
39
README.md
39
README.md
@ -38,29 +38,26 @@ Some services are more common than others; some are deprecated entirely.
|
||||
|
||||
<!--
|
||||
todo: links to the .ts service implementations below
|
||||
todo: service names and not just raw service identifiers?
|
||||
-->
|
||||
|
||||
<!--
|
||||
| alarm_appliance | | |
|
||||
| alarm_burglar | | |
|
||||
| alarm_emergency | | |
|
||||
| alarm_fire | | |
|
||||
| alarm_gas | | |
|
||||
| alarm_health | | |
|
||||
| alarm_heat | | |
|
||||
| alarm_lock | | |
|
||||
| alarm_power | | |
|
||||
| alarm_siren | | |
|
||||
| alarm_system | | |
|
||||
| alarm_time | | |
|
||||
| alarm_water | | |
|
||||
| alarm_water_valve | | |
|
||||
| alarm_weather | | |
|
||||
-->
|
||||
|
||||
| Service | Example device | Implementation status |
|
||||
| --- | --- | --- |
|
||||
| _alarms_ services | [Brannvarsler](https://www.futurehome.io/en_no/shop/brannvarsler-230v) | |
|
||||
| alarm_appliance | | ✅ |
|
||||
| alarm_burglar | [Brannvarsler](https://www.futurehome.io/en_no/shop/brannvarsler-230v) | ✅ |
|
||||
| alarm_emergency | | ✅ |
|
||||
| alarm_fire | [Brannvarsler](https://www.futurehome.io/en_no/shop/brannvarsler-230v) | ✅ |
|
||||
| alarm_gas | [Brannvarsler](https://www.futurehome.io/en_no/shop/brannvarsler-230v) | ✅ |
|
||||
| alarm_health | | ✅ |
|
||||
| alarm_heat | [Brannvarsler](https://www.futurehome.io/en_no/shop/brannvarsler-230v) | ✅ |
|
||||
| alarm_lock | | ✅ |
|
||||
| alarm_power | | ✅ |
|
||||
| alarm_siren | | ✅ |
|
||||
| alarm_system | | ✅ |
|
||||
| alarm_time | | ✅ |
|
||||
| alarm_water | | ✅ |
|
||||
| alarm_water_valve | | ✅ |
|
||||
| alarm_weather | | ✅ |
|
||||
| barrier_ctrl | | ✅ |
|
||||
| basic | | ✅ |
|
||||
| battery | | ✅ |
|
||||
@ -96,7 +93,7 @@ todo: links to the .ts service implementations below
|
||||
| sensor_freq | | ✅ |
|
||||
| sensor_gp | | ✅ |
|
||||
| sensor_gust | | ✅ |
|
||||
| sensor_humid | | ✅ |
|
||||
| sensor_humid | [Brannvarsler](https://www.futurehome.io/en_no/shop/brannvarsler-230v) | ✅ |
|
||||
| sensor_lumin | | ✅ |
|
||||
| sensor_moist | | ✅ |
|
||||
| sensor_noise | | ✅ |
|
||||
@ -108,7 +105,7 @@ todo: links to the .ts service implementations below
|
||||
| sensor_seismicmag | | ✅ |
|
||||
| sensor_solarrad | | ✅ |
|
||||
| sensor_tank | | ✅ |
|
||||
| sensor_temp | | ✅ |
|
||||
| sensor_temp | [Brannvarsler](https://www.futurehome.io/en_no/shop/brannvarsler-230v) | ✅ |
|
||||
| sensor_tidelvl | | ✅ |
|
||||
| sensor_uv | | ✅ |
|
||||
| sensor_veloc | | ✅ |
|
||||
|
@ -1,6 +1,10 @@
|
||||
<!-- https://developers.home-assistant.io/docs/add-ons/presentation#keeping-a-changelog -->
|
||||
|
||||
|
||||
## 0.1.5 (25.07.2025)
|
||||
|
||||
- Added support for 'alarm_*' services (alarms).
|
||||
|
||||
## 0.1.4 (25.07.2025)
|
||||
|
||||
- Added support for 'media_player' service.
|
||||
|
@ -37,29 +37,26 @@ Some services are more common than others; some are deprecated entirely.
|
||||
|
||||
<!--
|
||||
todo: links to the .ts service implementations below
|
||||
todo: service names and not just raw service identifiers?
|
||||
-->
|
||||
|
||||
<!--
|
||||
| alarm_appliance | | |
|
||||
| alarm_burglar | | |
|
||||
| alarm_emergency | | |
|
||||
| alarm_fire | | |
|
||||
| alarm_gas | | |
|
||||
| alarm_health | | |
|
||||
| alarm_heat | | |
|
||||
| alarm_lock | | |
|
||||
| alarm_power | | |
|
||||
| alarm_siren | | |
|
||||
| alarm_system | | |
|
||||
| alarm_time | | |
|
||||
| alarm_water | | |
|
||||
| alarm_water_valve | | |
|
||||
| alarm_weather | | |
|
||||
-->
|
||||
|
||||
| Service | Example device | Implementation status |
|
||||
| --- | --- | --- |
|
||||
| _alarms_ services | [Brannvarsler](https://www.futurehome.io/en_no/shop/brannvarsler-230v) | |
|
||||
| alarm_appliance | | ✅ |
|
||||
| alarm_burglar | [Brannvarsler](https://www.futurehome.io/en_no/shop/brannvarsler-230v) | ✅ |
|
||||
| alarm_emergency | | ✅ |
|
||||
| alarm_fire | [Brannvarsler](https://www.futurehome.io/en_no/shop/brannvarsler-230v) | ✅ |
|
||||
| alarm_gas | [Brannvarsler](https://www.futurehome.io/en_no/shop/brannvarsler-230v) | ✅ |
|
||||
| alarm_health | | ✅ |
|
||||
| alarm_heat | [Brannvarsler](https://www.futurehome.io/en_no/shop/brannvarsler-230v) | ✅ |
|
||||
| alarm_lock | | ✅ |
|
||||
| alarm_power | | ✅ |
|
||||
| alarm_siren | | ✅ |
|
||||
| alarm_system | | ✅ |
|
||||
| alarm_time | | ✅ |
|
||||
| alarm_water | | ✅ |
|
||||
| alarm_water_valve | | ✅ |
|
||||
| alarm_weather | | ✅ |
|
||||
| barrier_ctrl | | ✅ |
|
||||
| basic | | ✅ |
|
||||
| battery | | ✅ |
|
||||
@ -95,7 +92,7 @@ todo: links to the .ts service implementations below
|
||||
| sensor_freq | | ✅ |
|
||||
| sensor_gp | | ✅ |
|
||||
| sensor_gust | | ✅ |
|
||||
| sensor_humid | | ✅ |
|
||||
| sensor_humid | [Brannvarsler](https://www.futurehome.io/en_no/shop/brannvarsler-230v) | ✅ |
|
||||
| sensor_lumin | | ✅ |
|
||||
| sensor_moist | | ✅ |
|
||||
| sensor_noise | | ✅ |
|
||||
@ -107,7 +104,7 @@ todo: links to the .ts service implementations below
|
||||
| sensor_seismicmag | | ✅ |
|
||||
| sensor_solarrad | | ✅ |
|
||||
| sensor_tank | | ✅ |
|
||||
| sensor_temp | | ✅ |
|
||||
| sensor_temp | [Brannvarsler](https://www.futurehome.io/en_no/shop/brannvarsler-230v) | ✅ |
|
||||
| sensor_tidelvl | | ✅ |
|
||||
| sensor_uv | | ✅ |
|
||||
| sensor_veloc | | ✅ |
|
||||
|
@ -1,6 +1,6 @@
|
||||
# https://developers.home-assistant.io/docs/add-ons/configuration#add-on-config
|
||||
name: Futurehome
|
||||
version: "0.1.4"
|
||||
version: "0.1.5"
|
||||
slug: futurehome
|
||||
description: Local Futurehome Smarthub integration
|
||||
url: "https://github.com/adrianjagielak/home-assistant-futurehome"
|
||||
|
@ -1,5 +1,36 @@
|
||||
export type EntityCategory = undefined | 'config' | 'diagnostic';
|
||||
|
||||
export type BinarySensorDeviceClass =
|
||||
| 'battery'
|
||||
| 'battery_charging'
|
||||
| 'carbon_monoxide'
|
||||
| 'cold'
|
||||
| 'connectivity'
|
||||
| 'door'
|
||||
| 'garage_door'
|
||||
| 'gas'
|
||||
| 'heat'
|
||||
| 'light'
|
||||
| 'lock'
|
||||
| 'moisture'
|
||||
| 'motion'
|
||||
| 'moving'
|
||||
| 'occupancy'
|
||||
| 'opening'
|
||||
| 'plug'
|
||||
| 'power'
|
||||
| 'presence'
|
||||
| 'problem'
|
||||
| 'running'
|
||||
| 'safety'
|
||||
| 'smoke'
|
||||
| 'sound'
|
||||
| 'tamper'
|
||||
| 'update'
|
||||
| 'vibration'
|
||||
| 'window'
|
||||
| null;
|
||||
|
||||
export type CoverDeviceClass =
|
||||
| 'awning'
|
||||
| 'blind'
|
||||
|
@ -1,3 +1,5 @@
|
||||
import { BinarySensorDeviceClass } from "./_enums";
|
||||
|
||||
/**
|
||||
* Represents a MQTT Binary Sensor component for Home Assistant MQTT Discovery.
|
||||
*
|
||||
@ -41,9 +43,9 @@ export interface BinarySensorComponent {
|
||||
/**
|
||||
* Sets the [class of the device](https://www.home-assistant.io/integrations/binary_sensor/#device-class),
|
||||
* changing the device state and icon that is displayed on the frontend.
|
||||
* The `device_class` defaults to `null`.
|
||||
* The `device_class` defaults to `null` (generic binary sensor).
|
||||
*/
|
||||
device_class?: string | null;
|
||||
device_class?: BinarySensorDeviceClass;
|
||||
|
||||
/**
|
||||
* The string that represents the `on` state.
|
||||
|
@ -4,6 +4,7 @@ import {
|
||||
VinculumPd7Service,
|
||||
} from '../fimp/vinculum_pd7_device';
|
||||
import { log } from '../logger';
|
||||
import { _alarm__components } from '../services/_alarm';
|
||||
import { barrier_ctrl__components } from '../services/barrier_ctrl';
|
||||
import { basic__components } from '../services/basic';
|
||||
import { battery__components } from '../services/battery';
|
||||
@ -162,8 +163,24 @@ const serviceHandlers: {
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
svcName: string,
|
||||
) => ServiceComponentsCreationResult | undefined;
|
||||
} = {
|
||||
alarm_appliance: _alarm__components,
|
||||
alarm_burglar: _alarm__components,
|
||||
alarm_emergency: _alarm__components,
|
||||
alarm_fire: _alarm__components,
|
||||
alarm_gas: _alarm__components,
|
||||
alarm_health: _alarm__components,
|
||||
alarm_heat: _alarm__components,
|
||||
alarm_lock: _alarm__components,
|
||||
alarm_power: _alarm__components,
|
||||
alarm_siren: _alarm__components,
|
||||
alarm_system: _alarm__components,
|
||||
alarm_time: _alarm__components,
|
||||
alarm_water_valve: _alarm__components,
|
||||
alarm_water: _alarm__components,
|
||||
alarm_weather: _alarm__components,
|
||||
barrier_ctrl: barrier_ctrl__components,
|
||||
basic: basic__components,
|
||||
battery: battery__components,
|
||||
@ -296,7 +313,12 @@ export function haPublishDevice(parameters: {
|
||||
continue;
|
||||
}
|
||||
|
||||
const result = handler(topicPrefix, parameters.vinculumDeviceData, svc);
|
||||
const result = handler(
|
||||
topicPrefix,
|
||||
parameters.vinculumDeviceData,
|
||||
svc,
|
||||
svcName,
|
||||
);
|
||||
if (!result) {
|
||||
log.error(
|
||||
`Invalid service data prevented component creation: ${parameters.vinculumDeviceData} ${svc}`,
|
||||
|
@ -175,10 +175,19 @@ const haStateCache: Record<
|
||||
Record<string, Record<string, any>> // payload (addr → { attr → value })
|
||||
> = {};
|
||||
|
||||
const attributeTypeKeyMap: Record<string, string> = {
|
||||
alarm: 'event',
|
||||
};
|
||||
|
||||
function getTypeKey(attrName: string): string {
|
||||
// Default key is 'type', but override for certain attributes
|
||||
return attributeTypeKeyMap[attrName] || 'type';
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to process multiple values for an attribute, handling typed values
|
||||
*/
|
||||
function processAttributeValues(values: any[]): any {
|
||||
function processAttributeValues(values: any[], attrName?: string): any {
|
||||
if (!values || values.length === 0) {
|
||||
return undefined;
|
||||
}
|
||||
@ -190,9 +199,10 @@ function processAttributeValues(values: any[]): any {
|
||||
return tsB - tsA; // Latest first
|
||||
});
|
||||
|
||||
// Check if any value has a 'type' property in its val object
|
||||
const typeKey = getTypeKey(attrName || '');
|
||||
|
||||
const hasTypedValues = sortedValues.some(
|
||||
(v) => v.val && typeof v.val === 'object' && v.val.type,
|
||||
(v) => v.val && typeof v.val === 'object' && v.val[typeKey],
|
||||
);
|
||||
|
||||
if (!hasTypedValues) {
|
||||
@ -204,12 +214,11 @@ function processAttributeValues(values: any[]): any {
|
||||
const typeMap: Record<string, any> = {};
|
||||
|
||||
for (const value of sortedValues) {
|
||||
if (value.val && typeof value.val === 'object' && value.val.type) {
|
||||
const type = value.val.type;
|
||||
if (!typeMap[type]) {
|
||||
// Create a copy without the 'type' property
|
||||
const { type: _, ...valueWithoutType } = value.val;
|
||||
typeMap[type] = valueWithoutType;
|
||||
if (value.val && typeof value.val === 'object' && value.val[typeKey]) {
|
||||
const key = value.val[typeKey];
|
||||
if (!typeMap[key]) {
|
||||
const { [typeKey]: _, ...valueWithoutType } = value.val;
|
||||
typeMap[key] = valueWithoutType;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -238,7 +247,10 @@ export function haUpdateState(parameters: {
|
||||
const serviceState: Record<string, any> = {};
|
||||
|
||||
for (const attr of service.attributes || []) {
|
||||
const processedValue = processAttributeValues(attr.values || []);
|
||||
const processedValue = processAttributeValues(
|
||||
attr.values || [],
|
||||
attr.name,
|
||||
);
|
||||
if (processedValue !== undefined) {
|
||||
serviceState[attr.name] = processedValue;
|
||||
}
|
||||
@ -274,6 +286,7 @@ export function haUpdateStateValueReport(parameters: {
|
||||
}) {
|
||||
// Strip the FIMP envelope so we end up with "/rt:dev/…/ad:x_y"
|
||||
const addr = parameters.topic.replace(/^pt:j1\/mt:evt/, '');
|
||||
const typeKey = getTypeKey(parameters.attrName);
|
||||
|
||||
for (const [stateTopic, payload] of Object.entries(haStateCache)) {
|
||||
if (!payload[addr]) continue;
|
||||
@ -282,11 +295,11 @@ export function haUpdateStateValueReport(parameters: {
|
||||
if (
|
||||
parameters.value &&
|
||||
typeof parameters.value === 'object' &&
|
||||
parameters.value.type
|
||||
parameters.value[typeKey]
|
||||
) {
|
||||
// Handle typed value update
|
||||
const type = parameters.value.type;
|
||||
const { type: _, ...valueWithoutType } = parameters.value;
|
||||
const key = parameters.value[typeKey];
|
||||
const { [typeKey]: _, ...valueWithoutType } = parameters.value;
|
||||
|
||||
// Get current attribute value
|
||||
const currentAttrValue = payload[addr][parameters.attrName];
|
||||
@ -299,12 +312,12 @@ export function haUpdateStateValueReport(parameters: {
|
||||
// Current value is already a type map, update the specific type
|
||||
payload[addr][parameters.attrName] = {
|
||||
...currentAttrValue,
|
||||
[type]: valueWithoutType,
|
||||
[key]: valueWithoutType,
|
||||
};
|
||||
} else {
|
||||
// Current value is not a type map, convert it to one
|
||||
payload[addr][parameters.attrName] = {
|
||||
[type]: valueWithoutType,
|
||||
[key]: valueWithoutType,
|
||||
};
|
||||
}
|
||||
} else {
|
||||
|
@ -2054,7 +2054,7 @@
|
||||
"alarm_gas": {
|
||||
"addr": "/rt:dev/rn:zw/ad:1/sv:alarm_gas/ad:86_0",
|
||||
"enabled": true,
|
||||
"intf": ["cmd.alarm.get_report", "evt.alarm.report"],
|
||||
"intf": ["cmd.alarm.get_report", "evt.alarm.report", "cmd.alarm.clear"],
|
||||
"props": {
|
||||
"is_secure": true,
|
||||
"is_unsecure": false,
|
||||
|
@ -1303,8 +1303,7 @@
|
||||
"val": {
|
||||
"album": "The Dark Side of the Moon",
|
||||
"track": "Money",
|
||||
"artist": "Pink Floyd",
|
||||
"image_url": "https://upload.wikimedia.org/wikipedia/en/3/3b/Dark_Side_of_the_Moon.png"
|
||||
"artist": "Pink Floyd"
|
||||
},
|
||||
"val_t": "str_map"
|
||||
}
|
||||
|
317
futurehome/src/services/_alarm.ts
Normal file
317
futurehome/src/services/_alarm.ts
Normal file
@ -0,0 +1,317 @@
|
||||
import { sendFimpMsg } from '../fimp/fimp';
|
||||
import {
|
||||
VinculumPd7Device,
|
||||
VinculumPd7Service,
|
||||
} from '../fimp/vinculum_pd7_device';
|
||||
import { HaMqttComponent } from '../ha/mqtt_components/_component';
|
||||
import { BinarySensorDeviceClass } from '../ha/mqtt_components/_enums';
|
||||
import {
|
||||
CommandHandlers,
|
||||
ServiceComponentsCreationResult,
|
||||
} from '../ha/publish_device';
|
||||
|
||||
export function _alarm__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const components: Record<string, HaMqttComponent> = {};
|
||||
const commandHandlers: CommandHandlers = {};
|
||||
|
||||
for (const event of svc.props?.sup_events ?? []) {
|
||||
const device_class =
|
||||
(
|
||||
{
|
||||
// --- alarm_appliance ---
|
||||
program_started: 'running',
|
||||
program_inprogress: 'running',
|
||||
program_completed: 'update',
|
||||
replace_filter: 'problem',
|
||||
set_temp_error: 'problem',
|
||||
supplying_water: 'power',
|
||||
water_supply_err: 'problem',
|
||||
boiling: 'heat',
|
||||
boiling_err: 'problem',
|
||||
washing: 'running',
|
||||
washing_err: 'problem',
|
||||
rinsing: 'running',
|
||||
rinsing_err: 'problem',
|
||||
draining: 'running',
|
||||
draining_err: 'problem',
|
||||
spinning: 'running',
|
||||
spinning_err: 'problem',
|
||||
drying: 'running',
|
||||
drying_err: 'problem',
|
||||
fan_err: 'problem',
|
||||
compressor_err: 'problem',
|
||||
|
||||
// --- alarm_burglar ---
|
||||
intrusion: 'motion',
|
||||
tamper_removed_cover: 'tamper',
|
||||
tamper_invalid_code: 'tamper',
|
||||
tamper_force_open: 'tamper',
|
||||
alarm_burglar: 'motion',
|
||||
glass_breakage: 'problem',
|
||||
|
||||
// --- alarm_emergency ---
|
||||
police: 'safety',
|
||||
fire: 'smoke',
|
||||
medical: 'safety',
|
||||
|
||||
// --- alarm_fire ---
|
||||
smoke: 'smoke',
|
||||
smoke_test: 'smoke',
|
||||
|
||||
// --- alarm_gas ---
|
||||
CO: 'carbon_monoxide',
|
||||
CO2: 'gas',
|
||||
combust_gas_detected: 'gas',
|
||||
toxic_gas_detected: 'gas',
|
||||
test: 'safety',
|
||||
replace: 'update',
|
||||
|
||||
// --- alarm_health ---
|
||||
leaving_bed: 'occupancy',
|
||||
sitting_on_bed: 'occupancy',
|
||||
lying_on_bed: 'occupancy',
|
||||
posture_change: 'occupancy',
|
||||
sitting_on_bed_edge: 'occupancy',
|
||||
alarm_health: 'safety',
|
||||
volatile_organic_compound: 'gas',
|
||||
|
||||
// --- alarm_heat ---
|
||||
overheat: 'heat',
|
||||
temp_rise: 'heat',
|
||||
underheat: 'cold',
|
||||
window_opened: 'window',
|
||||
|
||||
// --- alarm_lock ---
|
||||
manual_lock: 'lock',
|
||||
manual_unlock: 'lock',
|
||||
rf_lock: 'lock',
|
||||
rf_unlock: 'lock',
|
||||
keypad_lock: 'lock',
|
||||
keypad_unlock: 'lock',
|
||||
tag_lock: 'lock',
|
||||
tag_unlock: 'lock',
|
||||
manual_not_locked: 'lock',
|
||||
rf_not_locked: 'lock',
|
||||
auto_locked: 'lock',
|
||||
jammed: 'lock',
|
||||
door_opened: 'door',
|
||||
door_closed: 'door',
|
||||
lock_failed: 'lock',
|
||||
|
||||
// --- alarm_power ---
|
||||
on: 'power',
|
||||
ac_on: 'power',
|
||||
ac_off: 'power',
|
||||
surge: 'power',
|
||||
voltage_drop: 'power',
|
||||
over_current: 'power',
|
||||
over_voltage: 'power',
|
||||
replace_soon: 'battery',
|
||||
replace_now: 'battery',
|
||||
charging: 'battery_charging',
|
||||
charged: 'battery',
|
||||
charge_soon: 'battery',
|
||||
charge_now: 'battery',
|
||||
|
||||
// --- alarm_siren ---
|
||||
inactive: 'problem',
|
||||
siren_active: 'sound',
|
||||
|
||||
// --- alarm_system ---
|
||||
hw_failure: 'problem',
|
||||
sw_failure: 'problem',
|
||||
hw_failure_with_code: 'problem',
|
||||
sw_failure_with_code: 'problem',
|
||||
|
||||
// --- alarm_time ---
|
||||
wakeup: 'safety',
|
||||
timer_ended: 'update',
|
||||
time_remaining: 'update',
|
||||
|
||||
// --- alarm_water_valve ---
|
||||
valve_op: 'opening',
|
||||
master_valve_op: 'opening',
|
||||
valve_short_circuit: 'problem',
|
||||
current_alarm: 'problem',
|
||||
alarm_water_valve: 'problem',
|
||||
master_valve_current_alarm: 'problem',
|
||||
|
||||
// --- alarm_water ---
|
||||
leak: 'moisture',
|
||||
level_drop: 'moisture',
|
||||
|
||||
// --- alarm_weather ---
|
||||
moisture: 'moisture',
|
||||
} as { [key: string]: BinarySensorDeviceClass }
|
||||
)[event] ?? 'safety';
|
||||
|
||||
const name = (
|
||||
{
|
||||
// --- alarm_appliance ---
|
||||
program_started: 'Program Started',
|
||||
program_inprogress: 'Program In Progress',
|
||||
program_completed: 'Program Completed',
|
||||
replace_filter: 'Filter Replacement Needed',
|
||||
set_temp_error: 'Temperature Setting Error',
|
||||
supplying_water: 'Supplying Water',
|
||||
water_supply_err: 'Water Supply Error',
|
||||
boiling: 'Boiling',
|
||||
boiling_err: 'Boiling Error',
|
||||
washing: 'Washing',
|
||||
washing_err: 'Washing Error',
|
||||
rinsing: 'Rinsing',
|
||||
rinsing_err: 'Rinsing Error',
|
||||
draining: 'Draining',
|
||||
draining_err: 'Draining Error',
|
||||
spinning: 'Spinning',
|
||||
spinning_err: 'Spinning Error',
|
||||
drying: 'Drying',
|
||||
drying_err: 'Drying Error',
|
||||
fan_err: 'Fan Error',
|
||||
compressor_err: 'Compressor Error',
|
||||
|
||||
// --- alarm_burglar ---
|
||||
intrusion: 'Intrusion Alarm',
|
||||
tamper_removed_cover: 'Tamper Alarm',
|
||||
tamper_invalid_code: 'Tamper Alarm',
|
||||
tamper_force_open: 'Tamper Alarm',
|
||||
alarm_burglar: 'Burglar Alarm',
|
||||
glass_breakage: 'Glass Breakage Alarm',
|
||||
|
||||
// --- alarm_emergency ---
|
||||
police: 'Police Alarm',
|
||||
fire: 'Fire Alarm',
|
||||
medical: 'Medical Alarm',
|
||||
|
||||
// --- alarm_fire ---
|
||||
smoke: undefined, // maps 1:1 to device_class smoke
|
||||
smoke_test: 'Smoke Test Alarm',
|
||||
|
||||
// --- alarm_gas ---
|
||||
CO: undefined, // maps 1:1 to carbon_monoxide
|
||||
CO2: 'CO₂ Alarm',
|
||||
combust_gas_detected: 'Combustible Gas Alarm',
|
||||
toxic_gas_detected: 'Toxic Gas Alarm',
|
||||
test: 'Gas Test Alarm',
|
||||
replace: 'Gas Sensor Replace',
|
||||
|
||||
// --- alarm_health ---
|
||||
leaving_bed: 'Leaving Bed',
|
||||
sitting_on_bed: 'Sitting on Bed',
|
||||
lying_on_bed: 'Lying on Bed',
|
||||
posture_change: 'Posture Change',
|
||||
sitting_on_bed_edge: 'Sitting on Bed Edge',
|
||||
alarm_health: 'Health Alarm',
|
||||
volatile_organic_compound: 'VOC Alarm',
|
||||
|
||||
// --- alarm_heat ---
|
||||
overheat: 'Overheat Alarm',
|
||||
temp_rise: 'Temperature Rise Alarm',
|
||||
underheat: 'Underheat Alarm',
|
||||
window_opened: 'Window Opened',
|
||||
|
||||
// --- alarm_lock ---
|
||||
manual_lock: 'Manual Lock',
|
||||
manual_unlock: 'Manual Unlock',
|
||||
rf_lock: 'RF Lock',
|
||||
rf_unlock: 'RF Unlock',
|
||||
keypad_lock: 'Keypad Lock',
|
||||
keypad_unlock: 'Keypad Unlock',
|
||||
tag_lock: 'Tag Lock',
|
||||
tag_unlock: 'Tag Unlock',
|
||||
manual_not_locked: 'Manual Not Locked',
|
||||
rf_not_locked: 'RF Not Locked',
|
||||
auto_locked: 'Auto Locked',
|
||||
jammed: 'Lock Jammed',
|
||||
door_opened: 'Door Opened',
|
||||
door_closed: 'Door Closed',
|
||||
lock_failed: 'Lock Failed',
|
||||
|
||||
// --- alarm_power ---
|
||||
on: 'Power On',
|
||||
ac_on: 'AC Power On',
|
||||
ac_off: 'AC Power Off',
|
||||
surge: 'Power Surge',
|
||||
voltage_drop: 'Voltage Drop',
|
||||
over_current: 'Over Current Alarm',
|
||||
over_voltage: 'Over Voltage Alarm',
|
||||
replace_soon: 'Battery Replace Soon',
|
||||
replace_now: 'Battery Replace Now',
|
||||
charging: undefined, // battery_charging
|
||||
charged: undefined, // battery
|
||||
charge_soon: 'Charge Soon',
|
||||
charge_now: 'Charge Now',
|
||||
|
||||
// --- alarm_siren ---
|
||||
inactive: 'Siren Inactive',
|
||||
siren_active: 'Siren Active',
|
||||
|
||||
// --- alarm_system ---
|
||||
hw_failure: 'Hardware Failure',
|
||||
sw_failure: 'Software Failure',
|
||||
hw_failure_with_code: 'Hardware Failure (Code)',
|
||||
sw_failure_with_code: 'Software Failure (Code)',
|
||||
|
||||
// --- alarm_time ---
|
||||
wakeup: 'Wake Up',
|
||||
timer_ended: 'Timer Ended',
|
||||
time_remaining: 'Time Remaining',
|
||||
|
||||
// --- alarm_water_valve ---
|
||||
valve_op: 'Valve Operation',
|
||||
master_valve_op: 'Master Valve Operation',
|
||||
valve_short_circuit: 'Valve Short Circuit',
|
||||
current_alarm: 'Valve Current Alarm',
|
||||
alarm_water_valve: 'Water Valve Alarm',
|
||||
master_valve_current_alarm: 'Master Valve Current Alarm',
|
||||
|
||||
// --- alarm_water ---
|
||||
leak: undefined, // maps 1:1 to moisture
|
||||
level_drop: 'Water Level Drop',
|
||||
|
||||
// --- alarm_weather ---
|
||||
moisture: undefined, // maps 1:1 to moisture
|
||||
} as { [key: string]: string | undefined }
|
||||
)[event];
|
||||
|
||||
components[`${svc.addr}_${event}_sensor`] = {
|
||||
unique_id: `${svc.addr}_${event}_sensor`,
|
||||
platform: 'binary_sensor',
|
||||
device_class: device_class,
|
||||
name: name,
|
||||
value_template: `{{ (value_json['${svc.addr}'].alarm.${event}.status == 'activ') | iif('ON', 'OFF') }}`,
|
||||
};
|
||||
|
||||
if (svc.intf?.includes('cmd.alarm.clear')) {
|
||||
const clearCmdTopic = `${topicPrefix}${svc.addr}/${event}_clear/command`;
|
||||
|
||||
components[`${svc.addr}_${event}_clear`] = {
|
||||
unique_id: `${svc.addr}_${event}_clear`,
|
||||
platform: 'button',
|
||||
command_topic: clearCmdTopic,
|
||||
name: `Clear ${event} alarm`,
|
||||
icon: 'mdi:alarm-light-off',
|
||||
};
|
||||
|
||||
commandHandlers[clearCmdTopic] = async (_payload) => {
|
||||
await sendFimpMsg({
|
||||
address: svc.addr!,
|
||||
service: svcName,
|
||||
cmd: 'cmd.alarm.clear',
|
||||
val: event,
|
||||
val_t: 'string',
|
||||
});
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
components,
|
||||
commandHandlers,
|
||||
};
|
||||
}
|
@ -15,6 +15,7 @@ export function barrier_ctrl__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const components: Record<string, HaMqttComponent> = {};
|
||||
const commandHandlers: CommandHandlers = {};
|
||||
|
@ -18,6 +18,7 @@ export function basic__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
// MQTT topic that HA will publish commands to
|
||||
const cmdTopic = `${topicPrefix}${svc.addr}/command`;
|
||||
|
@ -9,6 +9,7 @@ export function battery__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const components: Record<string, HaMqttComponent> = {};
|
||||
|
||||
|
@ -17,6 +17,7 @@ export function chargepoint__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const components: Record<string, HaMqttComponent> = {};
|
||||
const commandHandlers: CommandHandlers = {};
|
||||
|
@ -13,6 +13,7 @@ export function color_ctrl__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const supComponents: string[] = svc.props?.sup_components ?? [];
|
||||
|
||||
|
@ -9,6 +9,7 @@ export function fan_ctrl__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const supModes: string[] = svc.props?.sup_modes ?? [];
|
||||
|
||||
|
@ -13,6 +13,7 @@ export function indicator_ctrl__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const components: Record<string, HaMqttComponent> = {};
|
||||
const commandHandlers: CommandHandlers = {};
|
||||
|
@ -18,6 +18,7 @@ export function media_player__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const components: Record<string, HaMqttComponent> = {};
|
||||
const commandHandlers: CommandHandlers = {};
|
||||
|
@ -9,6 +9,7 @@ export function out_bin_switch__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const commandTopic = `${topicPrefix}${svc.addr}/command`;
|
||||
|
||||
|
@ -9,6 +9,7 @@ export function out_lvl_switch__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const commandTopic = `${topicPrefix}${svc.addr}/command`;
|
||||
|
||||
|
@ -24,8 +24,9 @@ import {
|
||||
*/
|
||||
export function scene_ctrl__components(
|
||||
topicPrefix: string,
|
||||
_device: VinculumPd7Device,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const components: Record<string, HaMqttComponent> = {};
|
||||
const commandHandlers: CommandHandlers = {};
|
||||
|
@ -8,6 +8,7 @@ export function sensor_accelx__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = undefined;
|
||||
const name = 'Acceleration, X-axis';
|
||||
|
@ -8,6 +8,7 @@ export function sensor_accely__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = undefined;
|
||||
const name = 'Acceleration, Y-axis';
|
||||
|
@ -8,6 +8,7 @@ export function sensor_accelz__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = undefined;
|
||||
const name = 'Acceleration, Z-axis';
|
||||
|
@ -8,6 +8,7 @@ export function sensor_airflow__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = undefined;
|
||||
const name = 'Air flow';
|
||||
|
@ -8,6 +8,7 @@ export function sensor_airq__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = 'aqi';
|
||||
const name = undefined;
|
||||
|
@ -8,6 +8,7 @@ export function sensor_anglepos__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = undefined;
|
||||
const name = 'Angle Position';
|
||||
|
@ -8,6 +8,7 @@ export function sensor_atmo__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = 'atmospheric_pressure';
|
||||
const name = undefined;
|
||||
|
@ -8,6 +8,7 @@ export function sensor_baro__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = 'atmospheric_pressure';
|
||||
const name = undefined;
|
||||
|
@ -8,6 +8,7 @@ export function sensor_co__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = 'carbon_monoxide';
|
||||
const name = undefined;
|
||||
|
@ -8,6 +8,7 @@ export function sensor_co2__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = 'carbon_dioxide';
|
||||
const name = undefined;
|
||||
|
@ -8,6 +8,7 @@ export function sensor_contact__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = 'opening';
|
||||
|
||||
|
@ -8,6 +8,7 @@ export function sensor_current__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = 'current';
|
||||
const name = undefined;
|
||||
|
@ -8,6 +8,7 @@ export function sensor_dew__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = 'temperature';
|
||||
const name = undefined;
|
||||
|
@ -8,6 +8,7 @@ export function sensor_direct__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = 'wind_direction';
|
||||
const name = undefined;
|
||||
|
@ -8,6 +8,7 @@ export function sensor_distance__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = 'distance';
|
||||
const name = undefined;
|
||||
|
@ -8,6 +8,7 @@ export function sensor_elresist__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = undefined;
|
||||
const name = 'Electrical resistivity';
|
||||
|
@ -8,6 +8,7 @@ export function sensor_freq__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = 'frequency';
|
||||
const name = undefined;
|
||||
|
@ -8,6 +8,7 @@ export function sensor_gp__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = undefined;
|
||||
const name = 'Sensor';
|
||||
|
@ -8,6 +8,7 @@ export function sensor_gust__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = undefined;
|
||||
const name = 'Gust';
|
||||
|
@ -8,6 +8,7 @@ export function sensor_humid__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = 'humidity';
|
||||
const name = undefined;
|
||||
|
@ -8,6 +8,7 @@ export function sensor_lumin__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = 'illuminance';
|
||||
const name = undefined;
|
||||
|
@ -8,6 +8,7 @@ export function sensor_moist__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = 'moisture';
|
||||
const name = undefined;
|
||||
|
@ -8,6 +8,7 @@ export function sensor_noise__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = 'sound_pressure';
|
||||
const name = undefined;
|
||||
|
@ -8,6 +8,7 @@ export function sensor_power__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = 'power';
|
||||
const name = undefined;
|
||||
|
@ -8,6 +8,7 @@ export function sensor_presence__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = 'occupancy';
|
||||
|
||||
|
@ -8,6 +8,7 @@ export function sensor_rain__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = 'precipitation_intensity';
|
||||
const name = undefined;
|
||||
|
@ -8,6 +8,7 @@ export function sensor_rotation__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = undefined;
|
||||
const name = 'Rotation';
|
||||
|
@ -8,6 +8,7 @@ export function sensor_seismicint__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = undefined;
|
||||
const name = 'Seismic intensity';
|
||||
|
@ -8,6 +8,7 @@ export function sensor_seismicmag__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = undefined;
|
||||
const name = 'Seismic magnitude';
|
||||
|
@ -8,6 +8,7 @@ export function sensor_solarrad__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = undefined;
|
||||
const name = 'Solar radiation';
|
||||
|
@ -8,6 +8,7 @@ export function sensor_tank__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = 'volume_storage';
|
||||
const name = undefined;
|
||||
|
@ -8,6 +8,7 @@ export function sensor_temp__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = 'temperature';
|
||||
const name = undefined;
|
||||
|
@ -8,6 +8,7 @@ export function sensor_tidelvl__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = undefined;
|
||||
const name = 'Tide level';
|
||||
|
@ -8,6 +8,7 @@ export function sensor_uv__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = undefined;
|
||||
const name = 'Ultraviolet';
|
||||
|
@ -8,6 +8,7 @@ export function sensor_veloc__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = undefined;
|
||||
const name = 'Velocity';
|
||||
|
@ -8,6 +8,7 @@ export function sensor_voltage__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = 'voltage';
|
||||
const name = undefined;
|
||||
|
@ -8,6 +8,7 @@ export function sensor_watflow__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = 'volume_flow_rate';
|
||||
const name = undefined;
|
||||
|
@ -8,6 +8,7 @@ export function sensor_watpressure__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = 'pressure';
|
||||
const name = undefined;
|
||||
|
@ -8,6 +8,7 @@ export function sensor_wattemp__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = 'temperature';
|
||||
const name = undefined;
|
||||
|
@ -8,6 +8,7 @@ export function sensor_weight__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = 'weight';
|
||||
const name = undefined;
|
||||
|
@ -8,6 +8,7 @@ export function sensor_wind__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const device_class = 'wind_speed';
|
||||
const name = undefined;
|
||||
|
@ -14,6 +14,7 @@ export function siren_ctrl__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const components: Record<string, HaMqttComponent> = {};
|
||||
const commandHandlers: CommandHandlers = {};
|
||||
|
@ -16,6 +16,7 @@ export function thermostat__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const components: Record<string, HaMqttComponent> = {};
|
||||
const commandHandlers: CommandHandlers = {};
|
||||
|
@ -15,6 +15,7 @@ export function water_heater__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
_svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const components: Record<string, HaMqttComponent> = {};
|
||||
const commandHandlers: CommandHandlers = {};
|
||||
|
Loading…
x
Reference in New Issue
Block a user