Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose essential demand control data points #184

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions daikin.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,14 @@ const SpecialMode = {
'12/13': 'ECONO/STREAMER'
};

const DemandControlType = {'0': 'UNSUPPORTED', '1': 'SUPPORTED'};
const DemandControlMode = {'0': 'MANUAL', '1': 'TIMER', '2': 'AUTO'};

const channelDef = {
'deviceInfo': {'role': 'info'},
'control': {'role': 'thermo'},
'controlInfo': {'role': 'info'},
'demandControl': {'role': 'info'},
'modelInfo': {'role': 'info'},
'sensorInfo': {'role': 'info'}
};
Expand Down Expand Up @@ -191,6 +195,20 @@ const fieldDef = {

'error': {'role': 'value', 'read': true, 'write': false, 'type': 'number'} // 255
},
'demandControl': {
'enabled': {'role': 'switch', 'read': true, 'write': false, 'type': 'boolean'}, // can be writable later
'type': {'role': 'level', 'read': true, 'write': false, 'type': 'number', 'states': DemandControlType},
'mode': {'role': 'level', 'read': true, 'write': false, 'type': 'number', 'states': DemandControlMode}, // can be writable later
'maxPower': {
'role': 'level.power',
'read': true,
'write': false, // will be writable
'type': 'number',
'min': 40,
'max': 100,
'unit': '%'
}, // number from 40..100 and must be a multiply of 5
},
'modelInfo': {
'model': {'role': 'text', 'read': true, 'write': false, 'type': 'string'},
'type': {'role': 'text', 'read': true, 'write': false, 'type': 'string'},
Expand Down Expand Up @@ -536,6 +554,9 @@ async function storeDaikinData(err) {
updated += await handleDaikinUpdate(control, 'control');
updated += await handleDaikinUpdate(controlInfo, 'controlInfo');
updated += await handleDaikinUpdate(daikinDevice.currentACSensorInfo, 'sensorInfo');
if (daikinDevice.currentACDemandControl) {
updated += await handleDaikinUpdate(daikinDevice.currentACDemandControl, 'demandControl');
}
if (updated > 0) {
adapter.log.info(`${updated} Values updated`);
}
Expand Down
Loading