UNPKG

homebridge-obis-powermeter

Version:

Plugin for OBIS smart meter devices (SML/D0) to read power, energy, and voltages.

77 lines 3.27 kB
/** * Homebridge OBIS Power Meter Plugin * Reads power/energy data from a Smart Meter via OBIS using smartmeter-obis. * Provides Homebridge accessories for power consumption, return, voltage, and energy import. */ /** * Example output of readSml.js with a ZPA EHz Smart Meter: * Start * 1-0:96.50.1*1: Service entry (T1) previous Year = ZPA * 1-0:96.1.0*255: Serialnumber = 0a535350410001822222 * 1-0:1.8.0*255: Time integral 1 Sum active power + (Total) = 11163.4213 kWh * 1-0:2.8.0*255: Time integral 1 Sum active power - (Total) = 0 kWh * 1-0:14.7.0*255: Instantaneous value Frequency (Total) = 50.03 Hz * 1-0:0.2.0*0: Firmware version = 01 * 1-0:96.90.2*1: Service entry (T2) previous Year = 7249a01d * 1-0:97.97.0*255: Error message (Total) = 00000000 * 1-0:96.5.0*255: Last average 1 Service entry (Total) = 001c0104 * 1-0:16.7.0*255: Instantaneous value Total active power (Total) = 381 W * 1-0:36.7.0*255: Instantaneous value (Total) = 37 W * 1-0:56.7.0*255: Instantaneous value (Total) = 190 W * 1-0:76.7.0*255: Instantaneous value (Total) = 152 W * 1-0:32.7.0*255: Instantaneous value L1 voltage (Total) = 241.99 V * 1-0:52.7.0*255: Instantaneous value L2 voltage (Total) = 243.01 V * 1-0:72.7.0*255: Instantaneous value L3 voltage (Total) = 241.67 V * 1-0:31.7.0*255: Instantaneous value L1 current (Total) = 0.295 A * 1-0:51.7.0*255: Instantaneous value L2 current (Total) = 1.489 A * 1-0:71.7.0*255: Instantaneous value L3 current (Total) = 0.767 A * 1-0:81.7.1*255: Instantaneous value Angles (T1) = 122.1 ° * 1-0:81.7.2*255: Instantaneous value Angles (T2) = 241 ° * 1-0:81.7.4*255: Instantaneous value Angles (T4) = 306.6 ° * 1-0:81.7.15*255: Instantaneous value Angles = 304.2 ° * 1-0:81.7.26*255: Instantaneous value Angles = 328.7 ° */ import { API, DynamicPlatformPlugin, Logger, PlatformAccessory, PlatformConfig } from 'homebridge'; interface PluginConfig extends PlatformConfig { pollInterval?: number; serialPort: string; protocol?: 'SmlProtocol' | 'D0Protocol' | 'JsonEfrProtocol'; serialBaudRate?: number; serialDataBits?: number; serialStopBits?: number; serialParity?: 'none' | 'even' | 'odd'; hidePowerConsumptionDevice?: boolean; hidePowerReturnDevice?: boolean; debugLevel?: number; } export declare class HomebridgeObisPowerConsumption implements DynamicPlatformPlugin { readonly log: Logger; readonly config: PluginConfig; readonly api: API; Service: unknown; Characteristic: unknown; readonly accessories: PlatformAccessory[]; private readonly heartBeatInterval; private readonly REGISTER_PLUGIN_NAME; private readonly PLATFORM_NAME; private readonly UUID_NAMESPACE; private devices; private dataDevices; private device; private hbTimer?; private d; constructor(log: Logger, config: PluginConfig, api: API); configureAccessory(accessory: PlatformAccessory): void; private validateConfig; private obisOptions; private syncObisOptionsFromConfig; private validateSerialPort; private initialize; private setupAccessoires; private heartBeat; shutdown(): void; private floatOf; private computeActivePower; } export {}; //# sourceMappingURL=Platform.d.ts.map