mirror of
https://github.com/adrianjagielak/home-assistant-futurehome.git
synced 2025-09-13 15:47:08 +00:00
Add default entities names
This commit is contained in:
parent
5ccce69523
commit
c84c2744e0
Binary file not shown.
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 131 KiB |
Binary file not shown.
Before Width: | Height: | Size: 168 KiB After Width: | Height: | Size: 158 KiB |
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
- Added support for 'chargepoint' service (EV chargers).
|
- Added support for 'chargepoint' service (EV chargers).
|
||||||
- Updated demo mode data to add thermostat with dual setpoint system (heat+cool).
|
- Updated demo mode data to add thermostat with dual setpoint system (heat+cool).
|
||||||
|
- Added default entities names.
|
||||||
|
|
||||||
## 0.1.2 (24.07.2025)
|
## 0.1.2 (24.07.2025)
|
||||||
|
|
||||||
|
@ -41,6 +41,7 @@ export function barrier_ctrl__components(
|
|||||||
} else {
|
} else {
|
||||||
deviceClass = null;
|
deviceClass = null;
|
||||||
}
|
}
|
||||||
|
const name = deviceClass ? undefined : 'Barrier';
|
||||||
|
|
||||||
// Check if position control is supported
|
// Check if position control is supported
|
||||||
const supportsPosition = svc.props?.sup_tposition === true;
|
const supportsPosition = svc.props?.sup_tposition === true;
|
||||||
@ -50,6 +51,7 @@ export function barrier_ctrl__components(
|
|||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'cover',
|
platform: 'cover',
|
||||||
device_class: deviceClass,
|
device_class: deviceClass,
|
||||||
|
name: name,
|
||||||
command_topic: commandTopic,
|
command_topic: commandTopic,
|
||||||
optimistic: false,
|
optimistic: false,
|
||||||
value_template: `{{ value_json['${svc.addr}'].state }}`,
|
value_template: `{{ value_json['${svc.addr}'].state }}`,
|
||||||
|
@ -16,7 +16,7 @@ import { ServiceComponentsCreationResult } from '../ha/publish_device';
|
|||||||
|
|
||||||
export function basic__components(
|
export function basic__components(
|
||||||
topicPrefix: string,
|
topicPrefix: string,
|
||||||
_device: VinculumPd7Device,
|
device: VinculumPd7Device,
|
||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
// MQTT topic that HA will publish commands to
|
// MQTT topic that HA will publish commands to
|
||||||
@ -31,6 +31,7 @@ export function basic__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'number',
|
platform: 'number',
|
||||||
|
name: device.client?.name ?? device?.modelAlias,
|
||||||
min: MIN_LVL,
|
min: MIN_LVL,
|
||||||
max: MAX_LVL,
|
max: MAX_LVL,
|
||||||
step: 1,
|
step: 1,
|
||||||
|
@ -58,6 +58,7 @@ export function color_ctrl__components(
|
|||||||
const lightComponent: LightComponent = {
|
const lightComponent: LightComponent = {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'light',
|
platform: 'light',
|
||||||
|
name: 'Light',
|
||||||
|
|
||||||
// Basic on/off control
|
// Basic on/off control
|
||||||
command_topic: commandTopic,
|
command_topic: commandTopic,
|
||||||
|
@ -21,6 +21,7 @@ export function fan_ctrl__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'fan',
|
platform: 'fan',
|
||||||
|
name: 'Fan',
|
||||||
command_topic: commandTopic,
|
command_topic: commandTopic,
|
||||||
optimistic: false,
|
optimistic: false,
|
||||||
preset_modes: supModes,
|
preset_modes: supModes,
|
||||||
|
@ -17,6 +17,7 @@ export function out_bin_switch__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'switch',
|
platform: 'switch',
|
||||||
|
name: 'Binary Switch',
|
||||||
command_topic: commandTopic,
|
command_topic: commandTopic,
|
||||||
optimistic: false,
|
optimistic: false,
|
||||||
value_template: `{{ (value_json['${svc.addr}'].binary) | iif('ON', 'OFF') }}`,
|
value_template: `{{ (value_json['${svc.addr}'].binary) | iif('ON', 'OFF') }}`,
|
||||||
|
@ -20,6 +20,7 @@ export function out_lvl_switch__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'number',
|
platform: 'number',
|
||||||
|
name: 'Level Switch',
|
||||||
min: minLvl,
|
min: minLvl,
|
||||||
max: maxLvl,
|
max: maxLvl,
|
||||||
step: 1,
|
step: 1,
|
||||||
|
@ -35,20 +35,12 @@ export function scene_ctrl__components(
|
|||||||
components[`${svc.addr}_scene`] = {
|
components[`${svc.addr}_scene`] = {
|
||||||
unique_id: `${svc.addr}_scene`,
|
unique_id: `${svc.addr}_scene`,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: 'Scene',
|
||||||
unit_of_measurement: '',
|
unit_of_measurement: '',
|
||||||
value_template: `{{ value_json['${svc.addr}'].scene }}`,
|
value_template: `{{ value_json['${svc.addr}'].scene }}`,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (svc.intf?.includes('evt.lvl.report')) {
|
|
||||||
components[`${svc.addr}_lvl`] = {
|
|
||||||
unique_id: `${svc.addr}_lvl`,
|
|
||||||
platform: 'sensor',
|
|
||||||
unit_of_measurement: '',
|
|
||||||
value_template: `{{ value_json['${svc.addr}'].lvl }}`,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// ───────────── writeable “select” (scene activator) ─────────────
|
// ───────────── writeable “select” (scene activator) ─────────────
|
||||||
const supScenes: string[] = svc.props?.sup_scenes ?? [];
|
const supScenes: string[] = svc.props?.sup_scenes ?? [];
|
||||||
if (svc.intf?.includes('cmd.scene.set') && supScenes.length) {
|
if (svc.intf?.includes('cmd.scene.set') && supScenes.length) {
|
||||||
@ -57,6 +49,7 @@ export function scene_ctrl__components(
|
|||||||
components[`${svc.addr}_select`] = {
|
components[`${svc.addr}_select`] = {
|
||||||
unique_id: `${svc.addr}_select`,
|
unique_id: `${svc.addr}_select`,
|
||||||
platform: 'select',
|
platform: 'select',
|
||||||
|
name: 'Scene',
|
||||||
options: supScenes,
|
options: supScenes,
|
||||||
command_topic: commandTopic,
|
command_topic: commandTopic,
|
||||||
optimistic: false,
|
optimistic: false,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_accelx__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = undefined;
|
const device_class = undefined;
|
||||||
|
const name = 'Acceleration, X-axis';
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'm/s2';
|
const unit = svc.props?.sup_units?.[0] ?? 'm/s2';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_accelx__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_accely__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = undefined;
|
const device_class = undefined;
|
||||||
|
const name = 'Acceleration, Y-axis';
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'm/s2';
|
const unit = svc.props?.sup_units?.[0] ?? 'm/s2';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_accely__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_accelz__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = undefined;
|
const device_class = undefined;
|
||||||
|
const name = 'Acceleration, Z-axis';
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'm/s2';
|
const unit = svc.props?.sup_units?.[0] ?? 'm/s2';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_accelz__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_airflow__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = undefined;
|
const device_class = undefined;
|
||||||
|
const name = 'Air flow';
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'm3/h';
|
const unit = svc.props?.sup_units?.[0] ?? 'm3/h';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_airflow__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_airq__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = 'aqi';
|
const device_class = 'aqi';
|
||||||
|
const name = undefined;
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'pm25';
|
const unit = svc.props?.sup_units?.[0] ?? 'pm25';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_airq__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,14 +10,18 @@ export function sensor_anglepos__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = undefined;
|
const device_class = undefined;
|
||||||
|
const name = 'Angle Position';
|
||||||
const unit = svc.props?.sup_units?.[0] ?? '%';
|
const unit = svc.props?.sup_units?.[0] ?? '%';
|
||||||
|
const state_class = svc.props?.sup_units?.[0] === '%' ? 'measurement' : 'measurement_angle';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
components: {
|
components: {
|
||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
|
state_class: state_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
},
|
},
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_atmo__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = 'atmospheric_pressure';
|
const device_class = 'atmospheric_pressure';
|
||||||
|
const name = undefined;
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'kPa';
|
const unit = svc.props?.sup_units?.[0] ?? 'kPa';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_atmo__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_baro__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = 'atmospheric_pressure';
|
const device_class = 'atmospheric_pressure';
|
||||||
|
const name = undefined;
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'kPa';
|
const unit = svc.props?.sup_units?.[0] ?? 'kPa';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_baro__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_co__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = 'carbon_monoxide';
|
const device_class = 'carbon_monoxide';
|
||||||
|
const name = undefined;
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'mol/m3';
|
const unit = svc.props?.sup_units?.[0] ?? 'mol/m3';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_co__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_co2__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = 'carbon_dioxide';
|
const device_class = 'carbon_dioxide';
|
||||||
|
const name = undefined;
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'ppm';
|
const unit = svc.props?.sup_units?.[0] ?? 'ppm';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_co2__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_current__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = 'current';
|
const device_class = 'current';
|
||||||
|
const name = undefined;
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'A';
|
const unit = svc.props?.sup_units?.[0] ?? 'A';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_current__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_dew__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = 'temperature';
|
const device_class = 'temperature';
|
||||||
|
const name = undefined;
|
||||||
let unit = svc.props?.sup_units?.[0] ?? '°C';
|
let unit = svc.props?.sup_units?.[0] ?? '°C';
|
||||||
if (unit === 'C') unit = '°C';
|
if (unit === 'C') unit = '°C';
|
||||||
if (unit === 'F') unit = '°F';
|
if (unit === 'F') unit = '°F';
|
||||||
@ -19,6 +20,7 @@ export function sensor_dew__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_direct__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = 'wind_direction';
|
const device_class = 'wind_direction';
|
||||||
|
const name = undefined;
|
||||||
const unit = svc.props?.sup_units?.[0] ?? '°';
|
const unit = svc.props?.sup_units?.[0] ?? '°';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_direct__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_distance__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = 'distance';
|
const device_class = 'distance';
|
||||||
|
const name = undefined;
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'm';
|
const unit = svc.props?.sup_units?.[0] ?? 'm';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_distance__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_elresist__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = undefined;
|
const device_class = undefined;
|
||||||
|
const name = 'Electrical resistivity';
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'ohm/m';
|
const unit = svc.props?.sup_units?.[0] ?? 'ohm/m';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_elresist__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_freq__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = 'frequency';
|
const device_class = 'frequency';
|
||||||
|
const name = undefined;
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'Hz';
|
const unit = svc.props?.sup_units?.[0] ?? 'Hz';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_freq__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_gp__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = undefined;
|
const device_class = undefined;
|
||||||
|
const name = 'Sensor';
|
||||||
const unit = svc.props?.sup_units?.[0] ?? '%';
|
const unit = svc.props?.sup_units?.[0] ?? '%';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_gp__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_gust__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = undefined;
|
const device_class = undefined;
|
||||||
|
const name = 'Gust';
|
||||||
let unit = svc.props?.sup_units?.[0] ?? 'km/h';
|
let unit = svc.props?.sup_units?.[0] ?? 'km/h';
|
||||||
if (unit === 'kph') unit = 'km/h';
|
if (unit === 'kph') unit = 'km/h';
|
||||||
|
|
||||||
@ -18,6 +19,7 @@ export function sensor_gust__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_humid__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = 'humidity';
|
const device_class = 'humidity';
|
||||||
|
const name = undefined;
|
||||||
const unit = svc.props?.sup_units?.[0] ?? '%';
|
const unit = svc.props?.sup_units?.[0] ?? '%';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_humid__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_lumin__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = 'illuminance';
|
const device_class = 'illuminance';
|
||||||
|
const name = undefined;
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'lx';
|
const unit = svc.props?.sup_units?.[0] ?? 'lx';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_lumin__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_moist__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = 'moisture';
|
const device_class = 'moisture';
|
||||||
|
const name = undefined;
|
||||||
const unit = svc.props?.sup_units?.[0] ?? '%';
|
const unit = svc.props?.sup_units?.[0] ?? '%';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_moist__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_noise__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = 'sound_pressure';
|
const device_class = 'sound_pressure';
|
||||||
|
const name = undefined;
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'dB';
|
const unit = svc.props?.sup_units?.[0] ?? 'dB';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_noise__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_power__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = 'power';
|
const device_class = 'power';
|
||||||
|
const name = undefined;
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'W';
|
const unit = svc.props?.sup_units?.[0] ?? 'W';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_power__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_rain__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = 'precipitation_intensity';
|
const device_class = 'precipitation_intensity';
|
||||||
|
const name = undefined;
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'mm/h';
|
const unit = svc.props?.sup_units?.[0] ?? 'mm/h';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_rain__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_rotation__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = undefined;
|
const device_class = undefined;
|
||||||
|
const name = 'Rotation';
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'rpm';
|
const unit = svc.props?.sup_units?.[0] ?? 'rpm';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_rotation__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_seismicint__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = undefined;
|
const device_class = undefined;
|
||||||
|
const name = 'Seismic intensity';
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'EMCRO';
|
const unit = svc.props?.sup_units?.[0] ?? 'EMCRO';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_seismicint__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_seismicmag__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = undefined;
|
const device_class = undefined;
|
||||||
|
const name = 'Seismic magnitude';
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'MB';
|
const unit = svc.props?.sup_units?.[0] ?? 'MB';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_seismicmag__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_solarrad__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = undefined;
|
const device_class = undefined;
|
||||||
|
const name = 'Solar radiation';
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'W/m2';
|
const unit = svc.props?.sup_units?.[0] ?? 'W/m2';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_solarrad__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_tank__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = 'volume_storage';
|
const device_class = 'volume_storage';
|
||||||
|
const name = undefined;
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'l';
|
const unit = svc.props?.sup_units?.[0] ?? 'l';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_tank__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_temp__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = 'temperature';
|
const device_class = 'temperature';
|
||||||
|
const name = undefined;
|
||||||
let unit = svc.props?.sup_units?.[0] ?? '°C';
|
let unit = svc.props?.sup_units?.[0] ?? '°C';
|
||||||
if (unit === 'C') unit = '°C';
|
if (unit === 'C') unit = '°C';
|
||||||
if (unit === 'F') unit = '°F';
|
if (unit === 'F') unit = '°F';
|
||||||
@ -19,6 +20,7 @@ export function sensor_temp__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_tidelvl__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = undefined;
|
const device_class = undefined;
|
||||||
|
const name = 'Tide level';
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'm';
|
const unit = svc.props?.sup_units?.[0] ?? 'm';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_tidelvl__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_uv__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = undefined;
|
const device_class = undefined;
|
||||||
|
const name = 'Ultraviolet';
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'index';
|
const unit = svc.props?.sup_units?.[0] ?? 'index';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_uv__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_veloc__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = undefined;
|
const device_class = undefined;
|
||||||
|
const name = 'Velocity';
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'm/2';
|
const unit = svc.props?.sup_units?.[0] ?? 'm/2';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_veloc__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_voltage__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = 'voltage';
|
const device_class = 'voltage';
|
||||||
|
const name = undefined;
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'V';
|
const unit = svc.props?.sup_units?.[0] ?? 'V';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_voltage__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_watflow__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = 'volume_flow_rate';
|
const device_class = 'volume_flow_rate';
|
||||||
|
const name = undefined;
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'l/h';
|
const unit = svc.props?.sup_units?.[0] ?? 'l/h';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_watflow__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_watpressure__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = 'pressure';
|
const device_class = 'pressure';
|
||||||
|
const name = undefined;
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'kPa';
|
const unit = svc.props?.sup_units?.[0] ?? 'kPa';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_watpressure__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_wattemp__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = 'temperature';
|
const device_class = 'temperature';
|
||||||
|
const name = undefined;
|
||||||
let unit = svc.props?.sup_units?.[0] ?? '°C';
|
let unit = svc.props?.sup_units?.[0] ?? '°C';
|
||||||
if (unit === 'C') unit = '°C';
|
if (unit === 'C') unit = '°C';
|
||||||
if (unit === 'F') unit = '°F';
|
if (unit === 'F') unit = '°F';
|
||||||
@ -19,6 +20,7 @@ export function sensor_wattemp__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_weight__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = 'weight';
|
const device_class = 'weight';
|
||||||
|
const name = undefined;
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'kg';
|
const unit = svc.props?.sup_units?.[0] ?? 'kg';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_weight__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -10,6 +10,7 @@ export function sensor_wind__components(
|
|||||||
svc: VinculumPd7Service,
|
svc: VinculumPd7Service,
|
||||||
): ServiceComponentsCreationResult | undefined {
|
): ServiceComponentsCreationResult | undefined {
|
||||||
const device_class = 'wind_speed';
|
const device_class = 'wind_speed';
|
||||||
|
const name = undefined;
|
||||||
const unit = svc.props?.sup_units?.[0] ?? 'km/h';
|
const unit = svc.props?.sup_units?.[0] ?? 'km/h';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ export function sensor_wind__components(
|
|||||||
[svc.addr]: {
|
[svc.addr]: {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'sensor',
|
platform: 'sensor',
|
||||||
|
name: name,
|
||||||
device_class: device_class,
|
device_class: device_class,
|
||||||
unit_of_measurement: unit,
|
unit_of_measurement: unit,
|
||||||
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
value_template: `{{ value_json['${svc.addr}'].sensor }}`,
|
||||||
|
@ -119,6 +119,7 @@ export function thermostat__components(
|
|||||||
const climateComponent: ClimateComponent = {
|
const climateComponent: ClimateComponent = {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'climate',
|
platform: 'climate',
|
||||||
|
name: 'Thermostat',
|
||||||
modes: haModes,
|
modes: haModes,
|
||||||
mode_command_topic: modeCommandTopic,
|
mode_command_topic: modeCommandTopic,
|
||||||
// mode_state_topic seems to be required for mode state to be reported correctly in HA
|
// mode_state_topic seems to be required for mode state to be reported correctly in HA
|
||||||
|
@ -96,6 +96,7 @@ export function water_heater__components(
|
|||||||
const waterHeaterComponent: HaMqttComponent = {
|
const waterHeaterComponent: HaMqttComponent = {
|
||||||
unique_id: svc.addr,
|
unique_id: svc.addr,
|
||||||
platform: 'water_heater',
|
platform: 'water_heater',
|
||||||
|
name: 'Water heater',
|
||||||
modes: haModes.length > 0 ? haModes : ['off', 'heat_pump'],
|
modes: haModes.length > 0 ? haModes : ['off', 'heat_pump'],
|
||||||
mode_command_topic: modeCommandTopic,
|
mode_command_topic: modeCommandTopic,
|
||||||
mode_state_topic: stateTopic,
|
mode_state_topic: stateTopic,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user