New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

homebridge-rinnai-touch-platform

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

homebridge-rinnai-touch-platform - npm Package Compare versions

Comparing version 3.0.9 to 3.1.0

dist/models/Settings.d.ts

9

CHANGELOG.md

@@ -5,2 +5,11 @@ # Change Log

## 3.1.0 (2020-10-11)
* TCP/IP connection always open to improve performance and reliability
* New logging options in settings
* Remove some redundant settings
* Prevent some commands via MQTT when invalid
* [FIX] MQTT Native format not functioning correctly
* Update dependencies
## 3.0.9 (2020-09-20)

@@ -7,0 +16,0 @@

47

config.schema.json

@@ -13,4 +13,4 @@ {

"type": "string",
"placeholder": "Rinnai Touch",
"required": false
"default": "Rinnai Touch",
"required": true
},

@@ -77,17 +77,14 @@ "address": {

},
"closeConnectionDelay": {
"title": "Close Connection Delay (ms)",
"type": "number",
"placeholder": 1100,
"minimum": 0,
"maximum": 10000
"showHomebridgeEvents": {
"title": "Show Homebridge events in the log",
"type": "boolean",
"default": true,
"required": false
},
"connectionTimeout": {
"title": "Connection Timeout (ms)",
"description": "(-1 = never close, 0 = close immediately)",
"type": "number",
"placeholder": 5000,
"minimum": -1,
"maximum": 300000
},
"showModuleEvents": {
"title": "Show Rinnai Touch Module events in the log",
"type": "boolean",
"default": true,
"required": false
},
"clearCache": {

@@ -157,2 +154,8 @@ "title": "Clear plugin's accessory cache",

},
"showMqttEvents": {
"title": "Show MQTT events in the log",
"type": "boolean",
"default": true,
"required": false
},
"subscribeTemperature": {

@@ -252,3 +255,4 @@ "type": "object",

"mqtt.publishFrequency",
"mqtt.publishAll"
"mqtt.publishAll",
"mqtt.showMqttEvents"
]

@@ -273,11 +277,8 @@ },

"type": "fieldset",
"title": "Advanced Settings",
"title": "Other Settings",
"expandable": true,
"expanded": false,
"items": [
{
"type": "flex",
"flex-flow": "row wrap",
"items": [ "closeConnectionDelay", "connectionTimeout" ]
},
"showHomebridgeEvents",
"showModuleEvents",
"clearCache"

@@ -284,0 +285,0 @@ ]

@@ -21,9 +21,13 @@ "use strict";

this.platform.log.debug('AccessoryBase', 'setEventHandlers');
this.platform.service.on('updated', this.updateValues.bind(this));
this.platform.service.on('updated', () => {
this.updateValues();
});
}
async getCharacteristicValue(getValue, characteristic, callback) {
this.platform.log.debug('AccessoryBase', 'getCharacteristicValue', 'getValue', characteristic, 'callback');
this.platform.log.info(`${this.platformAccessory.displayName}: Getting characteristic '${characteristic}'`);
if (this.platform.settings.showHomebridgeEvents) {
this.platform.log.info(`${this.platformAccessory.displayName}: Getting characteristic '${characteristic}'`);
}
try {
await this.platform.service.updateStates();
this.platform.service.updateStates();
const value = getValue();

@@ -39,7 +43,9 @@ callback(null, value);

this.platform.log.debug('AccessoryBase', 'setCharacteristic', 'setValue', characteristic, value, 'callback');
this.platform.log.info(`${this.platformAccessory.displayName}: Setting characteristic '${characteristic}' to '${value}'`);
if (this.platform.settings.showHomebridgeEvents) {
this.platform.log.info(`${this.platformAccessory.displayName}: Setting characteristic '${characteristic}' to '${value}'`);
}
try {
await setValue(value);
callback(null);
await this.platform.service.updateStates();
this.platform.service.updateStates();
}

@@ -46,0 +52,0 @@ catch (error) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AdvanceSwitch = void 0;
const RinnaiTouchService_1 = require("../services/RinnaiTouchService");
const RinnaiService_1 = require("../rinnai/RinnaiService");
const AccessoryBase_1 = require("./AccessoryBase");

@@ -29,3 +29,3 @@ class AdvanceSwitch extends AccessoryBase_1.AccessoryBase {

const state = this.platform.service.getScheduleOverride(this.platformAccessory.context.zone);
return state === RinnaiTouchService_1.ScheduleOverrideModes.ADVANCE;
return state === RinnaiService_1.ScheduleOverrideModes.ADVANCE;
}

@@ -35,5 +35,5 @@ async setAdvanceSwitchOn(value) {

const state = value
? RinnaiTouchService_1.ScheduleOverrideModes.ADVANCE
: RinnaiTouchService_1.ScheduleOverrideModes.NONE;
await this.platform.service.setControlMode(RinnaiTouchService_1.ControlModes.SCHEDULE, this.platformAccessory.context.zone);
? RinnaiService_1.ScheduleOverrideModes.ADVANCE
: RinnaiService_1.ScheduleOverrideModes.NONE;
await this.platform.service.setControlMode(RinnaiService_1.ControlModes.SCHEDULE, this.platformAccessory.context.zone);
await this.platform.service.setScheduleOverride(state, this.platformAccessory.context.zone);

@@ -40,0 +40,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HeaterCooler = void 0;
const RinnaiTouchService_1 = require("../services/RinnaiTouchService");
const RinnaiService_1 = require("../rinnai/RinnaiService");
const ThermostatBase_1 = require("./ThermostatBase");

@@ -124,3 +124,3 @@ class HeaterCooler extends ThermostatBase_1.ThermostatBase {

}
if (this.platform.service.mode === RinnaiTouchService_1.Modes.HEAT) {
if (this.platform.service.mode === RinnaiService_1.Modes.HEAT) {
return this.platform.Characteristic.CurrentHeaterCoolerState.HEATING;

@@ -132,3 +132,3 @@ }

this.platform.log.debug(this.constructor.name, 'getTargetHeaterCoolerState');
if (this.platform.service.mode === RinnaiTouchService_1.Modes.HEAT) {
if (this.platform.service.mode === RinnaiService_1.Modes.HEAT) {
return this.platform.Characteristic.TargetHeaterCoolerState.HEAT;

@@ -169,10 +169,10 @@ }

case this.platform.Characteristic.TargetHeaterCoolerState.HEAT:
await this.platform.service.setMode(RinnaiTouchService_1.Modes.HEAT);
await this.platform.service.setMode(RinnaiService_1.Modes.HEAT);
break;
case this.platform.Characteristic.TargetHeaterCoolerState.COOL:
if (this.platform.service.hasCooler) {
await this.platform.service.setMode(RinnaiTouchService_1.Modes.COOL);
await this.platform.service.setMode(RinnaiService_1.Modes.COOL);
}
else {
await this.platform.service.setMode(RinnaiTouchService_1.Modes.EVAP);
await this.platform.service.setMode(RinnaiService_1.Modes.EVAP);
}

@@ -182,4 +182,4 @@ break;

if (this.platform.service.getState()) {
await this.platform.service.setControlMode(RinnaiTouchService_1.ControlModes.SCHEDULE, this.platformAccessory.context.zone);
await this.platform.service.setScheduleOverride(RinnaiTouchService_1.ScheduleOverrideModes.NONE, this.platformAccessory.context.zone);
await this.platform.service.setControlMode(RinnaiService_1.ControlModes.SCHEDULE, this.platformAccessory.context.zone);
await this.platform.service.setScheduleOverride(RinnaiService_1.ScheduleOverrideModes.NONE, this.platformAccessory.context.zone);
}

@@ -186,0 +186,0 @@ // Force update values so mode switches back to correct mode

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ManualSwitch = void 0;
const RinnaiTouchService_1 = require("../services/RinnaiTouchService");
const RinnaiService_1 = require("../rinnai/RinnaiService");
const AccessoryBase_1 = require("./AccessoryBase");

@@ -29,3 +29,3 @@ class ManualSwitch extends AccessoryBase_1.AccessoryBase {

const state = this.platform.service.getControlMode(this.platformAccessory.context.zone);
return state === RinnaiTouchService_1.ControlModes.MANUAL;
return state === RinnaiService_1.ControlModes.MANUAL;
}

@@ -35,4 +35,4 @@ async setManualSwitchOn(value) {

const state = value
? RinnaiTouchService_1.ControlModes.MANUAL
: RinnaiTouchService_1.ControlModes.SCHEDULE;
? RinnaiService_1.ControlModes.MANUAL
: RinnaiService_1.ControlModes.SCHEDULE;
await this.platform.service.setControlMode(state, this.platformAccessory.context.zone);

@@ -39,0 +39,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Thermostat = void 0;
const RinnaiTouchService_1 = require("../services/RinnaiTouchService");
const RinnaiService_1 = require("../rinnai/RinnaiService");
const ThermostatBase_1 = require("./ThermostatBase");

@@ -97,3 +97,3 @@ class Thermostat extends ThermostatBase_1.ThermostatBase {

}
if (this.platform.service.mode === RinnaiTouchService_1.Modes.HEAT) {
if (this.platform.service.mode === RinnaiService_1.Modes.HEAT) {
return this.platform.Characteristic.CurrentHeatingCoolingState.HEAT;

@@ -109,3 +109,3 @@ }

}
if (this.platform.service.mode === RinnaiTouchService_1.Modes.HEAT) {
if (this.platform.service.mode === RinnaiService_1.Modes.HEAT) {
return this.platform.Characteristic.TargetHeatingCoolingState.HEAT;

@@ -132,3 +132,3 @@ }

if (value === this.platform.Characteristic.TargetHeatingCoolingState.HEAT) {
await this.platform.service.setMode(RinnaiTouchService_1.Modes.HEAT);
await this.platform.service.setMode(RinnaiService_1.Modes.HEAT);
await this.platform.service.setState(true);

@@ -139,6 +139,6 @@ return;

if (this.platform.service.hasCooler) {
await this.platform.service.setMode(RinnaiTouchService_1.Modes.COOL);
await this.platform.service.setMode(RinnaiService_1.Modes.COOL);
}
else {
await this.platform.service.setMode(RinnaiTouchService_1.Modes.EVAP);
await this.platform.service.setMode(RinnaiService_1.Modes.EVAP);
}

@@ -150,4 +150,4 @@ await this.platform.service.setState(true);

await this.platform.service.setState(true);
await this.platform.service.setControlMode(RinnaiTouchService_1.ControlModes.SCHEDULE, this.platformAccessory.context.zone);
await this.platform.service.setScheduleOverride(RinnaiTouchService_1.ScheduleOverrideModes.NONE, this.platformAccessory.context.zone);
await this.platform.service.setControlMode(RinnaiService_1.ControlModes.SCHEDULE, this.platformAccessory.context.zone);
await this.platform.service.setScheduleOverride(RinnaiService_1.ScheduleOverrideModes.NONE, this.platformAccessory.context.zone);
// Force update values so mode switches back to correct mode

@@ -154,0 +154,0 @@ setTimeout(this.updateValues.bind(this), 1000);

export declare class Command {
private _currentSequence;
private _path;
private _state;
constructor(currentSequence?: number, path?: string, state?: string, command?: string);
constructor(path?: string, state?: string, command?: string);
get group1(): string;

@@ -10,5 +9,6 @@ get group2(): string;

get state(): string;
private get nextSequence();
get isPing(): boolean;
toString(): string;
toCommand(sequence: number): string;
}
//# sourceMappingURL=Command.d.ts.map

@@ -5,6 +5,5 @@ "use strict";

class Command {
constructor(currentSequence, path, state, command) {
constructor(path, state, command) {
this._path = ['', '', ''];
this._state = '';
this._currentSequence = currentSequence !== null && currentSequence !== void 0 ? currentSequence : 1;
if (path !== undefined && state !== undefined) {

@@ -15,2 +14,3 @@ this._path = path.split('.');

else if (command !== undefined) {
this._path = [];
const json = JSON.parse(command);

@@ -35,15 +35,16 @@ this._path.push(Object.keys(json)[0]);

}
get nextSequence() {
let nextSequence = (this._currentSequence + 1) % 255;
if (nextSequence === 0) {
nextSequence = 1;
}
return nextSequence;
get isPing() {
return this._state === '';
}
toString() {
const sequenceNumber = this.nextSequence.toString().padStart(6, '0');
return `N${sequenceNumber}{"${this._path[0]}":{"${this._path[1]}":{"${this._path[2]}":"${this._state}"}}}`;
return this._state !== ''
? `{"${this._path[0]}":{"${this._path[1]}":{"${this._path[2]}":"${this._state}"}}}`
: '';
}
toCommand(sequence) {
const sequenceNumber = sequence.toString().padStart(6, '0');
return `N${sequenceNumber}${this.toString()}`;
}
}
exports.Command = Command;
//# sourceMappingURL=Command.js.map

@@ -9,3 +9,3 @@ export declare class Status {

hasState(group1: string, group2: string, command: string, state: string): boolean;
toString(): string | undefined;
toString(): string;
equals(status?: Status): boolean;

@@ -12,0 +12,0 @@ private validate;

@@ -36,3 +36,4 @@ "use strict";

toString() {
return this._statusString;
var _a;
return (_a = this._statusString) !== null && _a !== void 0 ? _a : '';
}

@@ -39,0 +40,0 @@ equals(status) {

@@ -9,2 +9,3 @@ import mqtt = require('async-mqtt');

private topicPayload;
private connected;
constructor(platform: RinnaiTouchPlatform, client: mqtt.AsyncMqttClient);

@@ -11,0 +12,0 @@ get subscriptionTopics(): string[];

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConnectionFormat = void 0;
const QueueService_1 = require("../services/QueueService");
class ConnectionFormat {

@@ -9,2 +8,3 @@ constructor(platform, client) {

this.client = client;
this.connected = false;
const prefix = this.platform.settings.mqtt.topicPrefix

@@ -16,3 +16,3 @@ ? `${this.platform.settings.mqtt.topicPrefix}/`

if (this.platform.settings.mqtt.publishStatusChanged) {
this.platform.queue.on('connection', () => {
this.platform.session.on('connection', () => {
this.publishStatus();

@@ -39,5 +39,9 @@ });

this.platform.log.debug(this.constructor.name, 'publishStatus');
const payload = this.platform.queue.connectionState === QueueService_1.ConnectionStates.Error
? 'error'
: 'ok';
if (this.connected === this.platform.session.isConnected) {
return;
}
this.connected = this.platform.session.isConnected;
const payload = this.connected
? 'ok'
: 'error';
this.publish(this.pubTopic, payload);

@@ -53,3 +57,5 @@ }

await this.client.publish(topic, payload, { retain: true });
this.platform.log.info(`MQTT: Publish: ${topic}, Payload: ${payload}`);
if (this.platform.settings.mqtt.showMqttEvents) {
this.platform.log.info(`MQTT: Publish: ${topic}, Payload: ${payload}`);
}
}

@@ -56,0 +62,0 @@ catch (error) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HomeAssistantFormat = void 0;
const RinnaiTouchService_1 = require("../services/RinnaiTouchService");
const RinnaiService_1 = require("../rinnai/RinnaiService");
class HomeAssistantFormat {

@@ -56,2 +56,6 @@ constructor(platform, client) {

try {
if (!this.platform.service.getFanState()) {
this.platform.log.warn('MQTT: Setting fan mode only supported for "fan_only" mode');
return;
}
let fanSpeed;

@@ -92,3 +96,3 @@ switch (payload) {

await this.platform.service.setFanState(false);
await this.platform.service.setMode(RinnaiTouchService_1.Modes.HEAT);
await this.platform.service.setMode(RinnaiService_1.Modes.HEAT);
await this.platform.service.setState(true);

@@ -98,3 +102,3 @@ break;

await this.platform.service.setFanState(false);
await this.platform.service.setMode(this.platform.service.hasEvaporative ? RinnaiTouchService_1.Modes.EVAP : RinnaiTouchService_1.Modes.COOL);
await this.platform.service.setMode(this.platform.service.hasEvaporative ? RinnaiService_1.Modes.EVAP : RinnaiService_1.Modes.COOL);
await this.platform.service.setState(true);

@@ -114,2 +118,6 @@ break;

try {
if (!this.platform.service.getState() || this.platform.service.getFanState()) {
this.platform.log.warn('MQTT: Setting temperature only supported for "heat" and "cool" modes');
return;
}
const json = JSON.parse(payload);

@@ -160,3 +168,3 @@ if (typeof json === 'object') {

try {
const mode = RinnaiTouchService_1.Modes[this.getTopicComponent(topic, -2).toUpperCase()];
const mode = RinnaiService_1.Modes[this.getTopicComponent(topic, -2).toUpperCase()];
const state = payload.toLowerCase() === 'on';

@@ -194,7 +202,11 @@ if (this.platform.service.getFanState()) {

try {
if (!this.platform.service.getState() && !this.platform.service.getFanState()) {
this.platform.log.warn('MQTT: Setting manual operation not supported for "off" mode');
return;
}
let zone = this.getTopicComponent(topic, -2).toUpperCase();
zone = zone.length !== 1 ? 'U' : zone;
const state = payload.toLowerCase() === 'on'
? RinnaiTouchService_1.ControlModes.MANUAL
: RinnaiTouchService_1.ControlModes.SCHEDULE;
? RinnaiService_1.ControlModes.MANUAL
: RinnaiService_1.ControlModes.SCHEDULE;
this.platform.service.setControlMode(state, zone);

@@ -216,3 +228,3 @@ }

try {
await this.platform.service.updateStates();
this.platform.service.updateStates();
this.publishHvacAction();

@@ -252,3 +264,3 @@ this.publishHvacCurrentTemperature();

}
payload[zone] = this.platform.service.mode === RinnaiTouchService_1.Modes.HEAT
payload[zone] = this.platform.service.mode === RinnaiService_1.Modes.HEAT
? 'heating'

@@ -290,3 +302,3 @@ : 'cooling';

}
else if (this.platform.service.mode === RinnaiTouchService_1.Modes.HEAT) {
else if (this.platform.service.mode === RinnaiService_1.Modes.HEAT) {
payload = 'heat';

@@ -329,3 +341,3 @@ }

if (this.platform.service.getState()) {
payload = this.platform.service.mode === RinnaiTouchService_1.Modes[mode.toUpperCase()] ? 'on' : 'off';
payload = this.platform.service.mode === RinnaiService_1.Modes[mode.toUpperCase()] ? 'on' : 'off';
}

@@ -348,3 +360,3 @@ else {

if (this.platform.service.getControlMode(zone)) {
const payload = this.platform.service.getControlMode(zone) === RinnaiTouchService_1.ControlModes.MANUAL ? 'on' : 'off';
const payload = this.platform.service.getControlMode(zone) === RinnaiService_1.ControlModes.MANUAL ? 'on' : 'off';
this.publish(`switch/manual/${zone.toLowerCase()}/get`, payload);

@@ -355,3 +367,3 @@ }

else {
const payload = this.platform.service.getControlMode() === RinnaiTouchService_1.ControlModes.MANUAL ? 'on' : 'off';
const payload = this.platform.service.getControlMode() === RinnaiService_1.ControlModes.MANUAL ? 'on' : 'off';
this.publish('switch/manual/get', payload);

@@ -368,3 +380,5 @@ }

await this.client.publish(`${this.prefix}${topic}`, payload, { retain: true });
this.platform.log.info(`MQTT: Publish: ${this.prefix}${topic}, Payload: ${payload}`);
if (this.platform.settings.mqtt.showMqttEvents) {
this.platform.log.info(`MQTT: Publish: ${this.prefix}${topic}, Payload: ${payload}`);
}
}

@@ -371,0 +385,0 @@ catch (error) {

@@ -41,3 +41,5 @@ "use strict";

this.client.on('message', (topic, payload) => {
this.platform.log.info(`MQTT: Received: ${topic}, Payload: ${payload}`);
if (this.platform.settings.mqtt.showMqttEvents) {
this.platform.log.info(`MQTT: Received: ${topic}, Payload: ${payload}`);
}
const format = this.topicMap.get(topic);

@@ -57,3 +59,5 @@ if (format) {

setInterval(async () => {
this.platform.log.info('MQTT: Publish Event: Scheduled Interval');
if (this.platform.settings.mqtt.showMqttEvents) {
this.platform.log.info('MQTT: Publish Event: Scheduled Interval');
}
for (const format of this.formats) {

@@ -93,3 +97,5 @@ await format.publishTopics();

for (const topic of format.subscriptionTopics) {
this.platform.log.info(`MQTT: Subscribe: ${topic}`);
if (this.platform.settings.mqtt.showMqttEvents) {
this.platform.log.info(`MQTT: Subscribe: ${topic}`);
}
await this.client.subscribe(topic);

@@ -96,0 +102,0 @@ this.topicMap.set(topic, format);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NativeFormat = void 0;
const QueueService_1 = require("../services/QueueService");
const Command_1 = require("../models/Command");
class NativeFormat {

@@ -16,4 +16,4 @@ constructor(platform, client) {

if (this.platform.settings.mqtt.publishStatusChanged) {
this.platform.queue.on('status', (status) => {
this.publish(this.pubTopic, JSON.stringify(status));
this.platform.session.on('status', (status) => {
this.publish(this.pubTopic, status.toString());
});

@@ -28,7 +28,4 @@ }

try {
const request = {
type: QueueService_1.RequestTypes.Command,
command: payload,
};
this.platform.queue.execute(request);
const command = new Command_1.Command(undefined, undefined, payload);
this.platform.session.sendCommand(command);
}

@@ -42,7 +39,7 @@ catch (error) {

try {
const status = await this.platform.queue.execute({ type: QueueService_1.RequestTypes.Get });
if (!status) {
const status = this.platform.session.getStatus();
if (status === undefined) {
return;
}
this.publish(this.pubTopic, JSON.stringify(status));
await this.publish(this.pubTopic, status.toString());
}

@@ -61,3 +58,5 @@ catch (error) {

await this.client.publish(topic, payload, { retain: true });
this.platform.log.info(`MQTT: Publish: ${topic}, Payload: ${payload}`);
if (this.platform.settings.mqtt.showMqttEvents) {
this.platform.log.info(`MQTT: Publish: ${topic}, Payload: ${payload}`);
}
}

@@ -64,0 +63,0 @@ catch (error) {

import { API, DynamicPlatformPlugin, Logger, PlatformAccessory, PlatformConfig, Service, Characteristic } from 'homebridge';
import { SettingsService } from './services/SettingsService';
import { QueueService } from './services/QueueService';
import { RinnaiTouchService } from './services/RinnaiTouchService';
import { Settings } from './models/Settings';
import { RinnaiSession } from './rinnai/RinnaiSession';
import { RinnaiService } from './rinnai/RinnaiService';
import { AccessoryService } from './accessories/AccessoryService';

@@ -14,5 +14,5 @@ import { MqttService } from './mqtt/MqttService';

readonly Characteristic: typeof Characteristic;
readonly settings: SettingsService;
readonly queue: QueueService;
readonly service: RinnaiTouchService;
readonly settings: Settings;
readonly session: RinnaiSession;
readonly service: RinnaiService;
readonly accessoryService: AccessoryService;

@@ -19,0 +19,0 @@ readonly mqttService: MqttService;

@@ -5,5 +5,5 @@ "use strict";

const settings_1 = require("./settings");
const SettingsService_1 = require("./services/SettingsService");
const QueueService_1 = require("./services/QueueService");
const RinnaiTouchService_1 = require("./services/RinnaiTouchService");
const Settings_1 = require("./models/Settings");
const RinnaiSession_1 = require("./rinnai/RinnaiSession");
const RinnaiService_1 = require("./rinnai/RinnaiService");
const AccessoryService_1 = require("./accessories/AccessoryService");

@@ -20,5 +20,5 @@ const MqttService_1 = require("./mqtt/MqttService");

try {
this.settings = new SettingsService_1.SettingsService(config);
this.queue = new QueueService_1.QueueService(this, this.settings);
this.service = new RinnaiTouchService_1.RinnaiTouchService(this, this.queue);
this.settings = new Settings_1.Settings(config);
this.session = new RinnaiSession_1.RinnaiSession(this);
this.service = new RinnaiService_1.RinnaiService(this);
this.accessoryService = new AccessoryService_1.AccessoryService(this);

@@ -31,3 +31,3 @@ this.mqttService = new MqttService_1.MqttService(this);

this.log.info('Shutting down plugin');
this.queue.closeConnection();
this.session.stop();
});

@@ -57,2 +57,3 @@ }

}
await this.session.start();
await this.service.init();

@@ -59,0 +60,0 @@ // Display found items

{
"displayName": "Rinnai Touch Platform",
"name": "homebridge-rinnai-touch-platform",
"version": "3.0.9",
"version": "3.1.0",
"description": "Homebridge Plugin to control heating/cooling via a Rinnai Touch WiFi Module",

@@ -16,3 +16,3 @@ "license": "Apache-2.0",

"node": ">=10.17.0",
"homebridge": ">0.4.53"
"homebridge": ">=1.0.0"
},

@@ -53,7 +53,7 @@ "main": "dist/index.js",

"devDependencies": {
"@types/node": "^14.11.1",
"@typescript-eslint/eslint-plugin": "^4.1.1",
"@typescript-eslint/parser": "^4.1.1",
"eslint": "^7.9.0",
"homebridge": "^1.2.2",
"@types/node": "^14.11.8",
"@typescript-eslint/eslint-plugin": "^4.4.0",
"@typescript-eslint/parser": "^4.4.0",
"eslint": "^7.11.0",
"homebridge": "^1.2.3",
"nodemon": "^2.0.4",

@@ -60,0 +60,0 @@ "rimraf": "^3.0.2",

@@ -1,2 +0,2 @@

# Homebridge Plugin for the Rinnai Touch WiFi Module
# Rinnai Touch Platform

@@ -23,3 +23,3 @@ [![npm](https://badgen.net/npm/v/homebridge-rinnai-touch-platform) ![npm](https://badgen.net/npm/dt/homebridge-rinnai-touch-platform)](https://www.npmjs.com/package/homebridge-rinnai-touch-platform) [![verified-by-homebridge](https://badgen.net/badge/homebridge/verified/purple)](https://github.com/homebridge/homebridge/wiki/Verified-Plugins)

This plugin will add one or more accessories to the Home app depending on your Rinnai Touch status. Accessories are discovered automatically without any need to modify the config.json file. The following table describes each type of accessory.
This plugin will add one or more accessories to the Home app depending on the status received from the Rinnai Touch module. Accessories are discovered automatically. The following table describes each type of accessory.

@@ -38,3 +38,3 @@ |Accessory|Description|

To install or upgrade to the latest version of this plugin:
It is highly recommended that you use Homebridge Config UI X to install and configure the plugin. Alternatively you can install from the command line as follows:

@@ -49,26 +49,26 @@ npm install -g homebridge-rinnai-touch-platform

It is also recommended that you remove the `cachedAccessories` file from the `.homebridge/accessories` folder.
Once uninstalled restart Homebridge which should clear the accessories. If this doesn't work you can delete the `cachedAccessories` file from the `.homebridge/accessories` folder.
## Configuration
This is a platform plugin that will register accessories and their services with the Bridge provided by homebridge. The plugin will attempt to discover your Rinnai Touch accessories automatically thus requiring minimal configuration to the config.json file.
This is a platform plugin that will register accessories and their services with the bridge provided by Homebridge. The plugin will attempt to discover your Rinnai Touch accessories automatically thus requiring minimal configuration to the `config.json` file.
If you find the auto config is not correct for your system or some defaults are not to your liking there are some overrides you can define in the config.json file.
If you find the default config is not correct for your system or not to your liking there are some overrides you can define in the `config.json` file.
|Option|Description|Default Value (if not supplied)|
|-|-|-|
|`platform`|Must be `"RinnaiTouchPlatform"`. This is the only mandatory configuration setting.||
|`name`|The name of the platform|`"Rinnai Touch"`|
|`address`|IP Address of the WiFi module<br/>NOTE: leave blank for auto discovery||
|`port`|Port to use for the WiFI module<br/>NOTE: leave blank for auto discovery|`27847`|
|`controllerType`|The type of accessory to use for the controller(s). Options are:<br/>`T` for Thermostat<br/>`H` for Heater Cooler|`T`|
|`zoneType`|The type of accessory to use for controlling zones (only applicable for Single Temperature Set Point). Options are:<br>`N` for None (ie. don't show any accessory for zones<br/>`S` for Switch<br/>`H` for Heater Cooler|`S`|
|`showFan`|Show the fan accessory in the Home app|`true`|
|`showAuto`|Show the `AUTO` option in the Thermostat menu|`true`|
|`showAdvanceSwitches`|Show the Advance Period switch accessory in the Home app|`true`|
|`showManualSwitches`|Show the Manual switch accessory in the Home app|`true`|
|`closeConnectionDelay`|The time (ms) to wait for the TCP connection to fully close. Increasing this may reduce `Connection Refused` errors from occuring|`1100`|
|`connectionTimeout`|The time (ms) to wait to close the TCP connection after the last request. Set to `-1` to keep the connection open indefinitely, or `0` to close immediately|`5000`|
|`clearCache`|Clear all the plugin's cached accessories from homebridge to force full discovery of accessories on restart|`false`|
|`mqtt`|See [MQTT.md](src/mqtt/MQTT.md) for details|`{}`|
|Option|Required|Type|Description|Default Value (if not supplied)|
|-|-|-|-|-|
|`platform`|Yes|string|Must be `"RinnaiTouchPlatform"`. This is the only mandatory configuration setting.||
|`name`|Yes|string|The name of the platform|`"Rinnai Touch"`|
|`address`|No|string|IP Address of the WiFi module<br/>NOTE: leave blank for auto discovery||
|`port`|No|number|Port to use for the WiFI module<br/>NOTE: leave blank for auto discovery|`27847`|
|`controllerType`|No|string|The type of accessory to use for the controller(s). Options are:<br/>`T` for Thermostat<br/>`H` for Heater Cooler|`T`|
|`zoneType`|No|string|The type of accessory to use for controlling zones (only applicable for Single Temperature Set Point). Options are:<br>`N` for None (ie. don't show any accessory for zones<br/>`S` for Switch<br/>`H` for Heater Cooler|`S`|
|`showFan`|No|boolean|Show the fan accessory in the Home app|`true`|
|`showAuto`|No|boolean|Show the `AUTO` option in the Thermostat menu|`true`|
|`showAdvanceSwitches`|No|boolean|Show the Advance Period switch accessory in the Home app|`true`|
|`showManualSwitches`|No|boolean|Show the Manual switch accessory in the Home app|`true`|
|`showHomebridgeEvents`|No|boolean|Include the homebridge events such as getting and setting characterics in the logs|`true`|
|`showModuleEvents`|No|boolean|Include the module events such as commands sent in the logs|`true`|
|`clearCache`|No|boolean|Clear all the plugin's cached accessories from homebridge to force full discovery of accessories on restart|`false`|
|`mqtt`|No|object|See [MQTT.md](src/mqtt/MQTT.md) for details||

@@ -108,2 +108,20 @@

#### Example: Showing all available options except for MQTT
"platforms": [
{
"platform": "RinnaiTouchPlatform",
"name": "Rinnai Touch",
"controllerType": "H",
"zoneType": "S",
"showFan": true,
"showAuto": true,
"showAdvanceSwitches": true,
"showManualSwitches": true,
"showHomebridgeEvents": true,
"showModuleEvents": true,
"clearCache": false
}
],
## Version History

@@ -113,10 +131,10 @@

## Known Limitations
* The plugin only supports a TCP connection over a LAN so no other connections can be active at the time. This would typically be the TouchApp by Rinnai.
* If the TCP connection is not closed properly then no further connections can be made to the module. I've tried to mitigate this as best I can by keeping TCP connections as short as possible and only allowing one request at a time. If it does happen I find rebooting my router clears it but rebooting the module itself should work also.
## Known Limitations / Troubleshooting
* The Rinnai Touch module appears to only allow a single client to connect to it at one time via TCP/IP. As the plugin only supports a TCP/IP connection to the module no other connections from other clients (such as the TouchApp by Rinnai) can be active at the time the plugin starts. Once a connection is established the plugin will keep it open to prevent other clients connecting to it via TCP/IP. NOTE: Once the plugin has started you can then use the TouchApp as it will connect to the module via the cloud.
* The module will disconnect if it has not received any requests after 5 minutes. To prevent this the plugin will send a blank command every minute.
* The module is also very temperamental about the TCP/IP connection. If it is not not closed properly or re-opened too quickly then a "Connection Refused" error may occur which prevents the plugin from connecting to the module. This may happen if Homebridge is not shutdown gracefully (eg. a crash). If it does happen try restarting Homebridge, the Rinnai Touch module or your router.
* Multi controller and Evaporative cooling configurations were not able to be tested so may not function properly.
* Due to the lag between sending a command to the module and it correctly reflecting that command in it's status there may be a short delay of a few seconds before the Home app shows the correct values. eg. When switching from HEAT to COOL mode some details such as the desired temperature will take a few seconds before the current value is shown.
* If the number of zones is different between the `Heat` and `Cool` modes the Zone Switches are dynamically added or removed as necessary. The downside of this is that you will loose any changes you made to the accessory (eg. name).
* Due to the lag between sending a command to the module and it correctly reflecting that command in it's status there may be a short delay of a few seconds before the Home app shows the correct values. eg. When switching from `HEAT` to `COOL` mode some details such as the desired temperature will take a few seconds before the current value is shown.
* If the number of zones is different between the `HEAT` and `COOL` modes the Zone Switches are dynamically added or removed as necessary. The downside of this is that you will loose any changes you made to the accessory (eg. name).
* If the WiFi module does not supply a current temperature then the temperature will display as zero in the Thermostat/Heater Cooler accessory. I would have prefered it showed as blank but couldn't find a way to do it. This appears to be a limitation of the service within Homebridge.
* The WiFi module will close the TCP connection after 5 minutes of inactivity. If the connection timeout is set to never (ie. `-1`) the plugin will attempt to automatically reconnect.
* The 'Heater Cooler' accessory is not currently supported by Home Assistant. See https://github.com/home-assistant/core/issues/30384

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc