Skip to content

Commit

Permalink
support HmIP-ASIR (close #61)
Browse files Browse the repository at this point in the history
  • Loading branch information
hobbyquaker committed Feb 14, 2019
1 parent ec95058 commit 0588146
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 6 deletions.
2 changes: 1 addition & 1 deletion nodes/ccu-connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ module.exports = function (RED) {
const devices = config.metadata.devices[req.query.iface];
if (devices) {
Object.keys(devices).forEach(addr => {
if (['SIGNAL_CHIME', 'SIGNAL_LED'].includes(devices[addr].TYPE)) {
if (['SIGNAL_CHIME', 'SIGNAL_LED', 'ALARM_SWITCH_VIRTUAL_RECEIVER'].includes(devices[addr].TYPE)) {
obj[addr] = {
name: config.channelNames[addr],
type: devices[addr].TYPE
Expand Down
63 changes: 61 additions & 2 deletions nodes/ccu-signal.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
signal: {value: ''},
channelType: {value: ''},
led: {value: ''},
acoustic_alarm_selection: {value: 'DISABLE_ACOUSTIC_SIGNAL'},
duration_unit: {value: 'S'},
duration_value: {value: 3},
optical_alarm_selection: {value: 'DISABLE_OPTICAL_SIGNAL'},
ccuConfig: {value: 'localhost', type: 'ccu-connection', required: true}
},
inputs: 1,
Expand Down Expand Up @@ -223,6 +227,8 @@
commands.forEach(cmd => {
$('#node-input-led-container').editableList('addItem', {cmd});
});
} else if (this.channelType === 'ALARM_SWITCH_VIRTUAL_RECEIVER') {
// ...
} else {
console.error('unknown channelType', this.channelType);
}
Expand Down Expand Up @@ -278,8 +284,10 @@
<div class="form-row">
<label for="node-input-channelType"><i class="icon-tags"></i> Typ</label>
<select id="node-input-channelType">
<option value="SIGNAL_CHIME">SIGNAL_CHIME</option>
<option value="SIGNAL_LED">SIGNAL_LED</option>
<option value="SIGNAL_CHIME">SIGNAL_CHIME (HM-OU-*)</option>
<option value="SIGNAL_LED">SIGNAL_LED (HM-OU-*)</option>
<option value="ALARM_SWITCH_VIRTUAL_RECEIVER">ALARM (HmIP-ASIR)</option>

</select>
</div>

Expand All @@ -302,6 +310,57 @@
<label for="node-input-led"><i class="icon-envelope"></i> Kommandos</label>
<ol id="node-input-led-container"></ol>
</div>


<div class="form-row SUBMIT ALARM_SWITCH_VIRTUAL_RECEIVER">
<label for="node-input-acoustic_alarm_selection"><i class=""></i> Akustisch</label>
<select id="node-input-acoustic_alarm_selection">
<option value="DISABLE_ACOUSTIC_SIGNAL">Kein akustisches Signal</option>
<option value="FREQUENCY_RISING">Freq. steigend</option>
<option value="FREQUENCY_FALLING">Freq. fallend</option>
<option value="FREQUENCY_RISING_AND_FALLING">Freq. steigend/fallend</option>
<option value="FREQUENCY_ALTERNATING_LOW_HIGH">Freq. tief/hoch</option>
<option value="FREQUENCY_ALTERNATING_LOW_MID_HIGH">Freq. tief/mittel/hoch</option>
<option value="FREQUENCY_HIGHON_OFF">Freq. hoch ein/aus</option>
<option value="FREQUENCY_HIGHON_LONGOFF">Freq. hoch ein, lang aus</option>
<option value="FREQUENCY_LOWON_OFF_HIGHON_OFF">req. tief ein/aus, hoch ein/aus</option>
<option value="FREQUENCY_LOWON_LONGOFF_HIGHON_LONGOFF">Freq. tief ein - lang aus, hoch ein - lang aus</option>
<option value="LOW_BATTERY">Batterie leer</option>
<option value="DISARMED">Unscharf</option>
<option value="INTERNALLY_ARMED">Intern scharf</option>
<option value="EXTERNALLY_ARMED">Extern scharf</option>
<option value="DELAYED_INTERNALLY_ARMED">Verzögert intern scharf</option>
<option value="DELAYED_EXTERNALLY_ARMED">Verzögert extern scharf</option>
<option value="EVENT">Alarm Ereignis</option>
<option value="ERROR">Fehler</option>
</select>
</div>

<div class="form-row SUBMIT ALARM_SWITCH_VIRTUAL_RECEIVER">
<label for="node-input-optical_alarm_selection"><i class=""></i> Optisch</label>
<select id="node-input-optical_alarm_selection">
<option value="DISABLE_OPTICAL_SIGNAL">Kein optisches Signal</option>
<option value="BLINKING_ALTERNATELY_REPEATING">Abwechselndes, langsames Blinken</option>
<option value="BLINKING_BOTH_REPEATING">Gleichzeitigs langsames Blinken</option>
<option value="DOUBLE_FLASHING_REPEATING">Gleichzeitiges schnelles Blinken</option>
<option value="FLASHING_BOTH_REPEATING">Gleichzeitiges kurzes Blinken</option>
<option value="CONFIRMATION_SIGNAL_0">Bestätigungssignal 0 - lang lang</option>
<option value="CONFIRMATION_SIGNAL_1">Bestätigungssignal 1 - lang kurz</option>
<option value="CONFIRMATION_SIGNAL_2">Bestätigungssignal 2 - lang kurz kurz</option>
</select>
</div>

<div class="form-row SUBMIT ALARM_SWITCH_VIRTUAL_RECEIVER">
<label for="node-input-duration_unit"><i class=""></i> Dauer </label>
<select id="node-input-duration_unit" style="width: calc(35% - 5px)">
<option value="S">Sekunden</option>
<option value="M">Minuten</option>
<option value="H">Stunden</option>
</select>
<input id="node-input-duration_value" type="number" style="width: 35%">
</div>


<div class="form-row">
<label for="node-input-name"><i class="icon-globe"></i> Name</label>
<input type="text" id="node-input-name">
Expand Down
11 changes: 10 additions & 1 deletion nodes/ccu-signal.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,23 @@ module.exports = function (RED) {
switch (config.channelType) {
case 'SIGNAL_CHIME':
payload = config.chime;
this.ccu.setValue(config.iface, config.channel, 'SUBMIT', payload);
break;
case 'SIGNAL_LED':
payload = config.led;
this.ccu.setValue(config.iface, config.channel, 'SUBMIT', payload);
break;
case 'ALARM_SWITCH_VIRTUAL_RECEIVER':
this.ccu.methodCall(config.iface, 'putParamset', [config.channel, 'VALUES', {
ACOUSTIC_ALARM_SELECTION: config.acoustic_alarm_selection,
DURATION_UNIT: config.duration_unit,
DURATION_VALUE: parseInt(config.duration_value, 10) || 0,
OPTICAL_ALARM_SELECTION: config.optical_alarm_selection
}]);
break;
default:
console.error('channelType', config.channelType, 'unknown');
}
this.ccu.setValue(config.iface, config.channel, 'SUBMIT', payload);
});
}

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-contrib-ccu",
"version": "1.13.5",
"version": "1.14.0",
"description": "Node-RED Nodes for the Homematic CCU",
"repository": "https://github.com/hobbyquaker/node-red-contrib-ccu",
"keywords": [
Expand Down Expand Up @@ -66,6 +66,7 @@
],
"rules": {
"no-template-curly-in-string": "warn",
"camelcase": "warn",
"capitalized-comments": 0,
"spaced-comment": 0,
"unicorn/catch-error-name": 0
Expand Down

0 comments on commit 0588146

Please sign in to comment.