-
Notifications
You must be signed in to change notification settings - Fork 22
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
Hmip drdi3 #354
Open
sreinhold95
wants to merge
2
commits into
rdmtc:master
Choose a base branch
from
sreinhold95:hmip-drdi3
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Hmip drdi3 #354
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
/* eslint-disable no-new */ | ||
|
||
const Accessory = require('./lib/accessory'); | ||
|
||
function addService(type, name, channel) { | ||
let service | ||
this.node.debug("HMIP-DRDI3: "+ name +" "+channel); | ||
switch (type) { | ||
case 'ValveIrrigation': | ||
// intentional fallthrough | ||
case 'Valve': | ||
// intentional fallthrough | ||
case 'Lightbulb': | ||
service=this.addService(type,name); | ||
service.get('On', channel + '.LEVEL', value => { | ||
this.node.debug("HMIPW-DRD3 get : "+channel); | ||
valueBrightness = value; | ||
return value > 0; | ||
}) | ||
|
||
service.set('On', (value, callback) => { | ||
this.node.debug("HMIPW-DRD3 set : "+channel); | ||
if (value) { | ||
setTimeout(() => { | ||
if (valueBrightness === 0) { | ||
value = 1; | ||
} else { | ||
value = valueBrightness / 100; | ||
} | ||
|
||
this.ccuSetValue(channel + '.LEVEL', value, callback); | ||
}, 100); | ||
} else { | ||
this.ccuSetValue(channel + '.LEVEL', 0, callback); | ||
} | ||
}) | ||
|
||
service.get('Brightness', channel + '.LEVEL', value => { | ||
valueBrightness = value * 100; | ||
return value * 100; | ||
}) | ||
|
||
service.set('Brightness', channel + '.LEVEL', value => { | ||
valueBrightness = value; | ||
return value / 100; | ||
}); | ||
case 'Fan': | ||
// intentional fallthrough | ||
case 'Outlet': | ||
// intentional fallthrough | ||
default: | ||
/*this.addService(type, name, type === 'Switch' ? '' : type) | ||
.get('On', dp) | ||
.set('On', dp);*/ | ||
} | ||
} | ||
|
||
class AccSingleService extends Accessory { | ||
init(config, node) { | ||
const {ccu} = node; | ||
node.debug(config.accChannel + ' ' + "Lightbulb" + ' '); | ||
addService.call(this, "Lightbulb", config.accChannelName, config.accChannel); | ||
} | ||
} | ||
|
||
class AccMultiService extends Accessory { | ||
init(config, node) { | ||
const {ccu} = node; | ||
|
||
for (let j = 0; j < 3; j++) { | ||
for (let c = 0; c < 3; c++) { | ||
const i = (j * 4) + (c + 2); | ||
if ((c === 0 && this.option(i)) || (c !== 0 && this.option(i, 'enabled'))) { | ||
const channel = config.deviceAddress + ':' + i; | ||
const name = ccu.channelNames[channel]; | ||
this.node.debug("HMIP-DRDI3 call MultiService Channel: "+name+" "+channel); | ||
addService.call(this,"Lightbulb",name,channel) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
module.exports = class HmipwDrd { | ||
option(id, option) { | ||
let addr = this.config.description.ADDRESS; | ||
if (!addr.includes(':')) { | ||
addr = addr + ':' + id; | ||
} | ||
|
||
let res; | ||
|
||
if (option) { | ||
res = this.config.options[addr] && this.config.options[addr][option]; | ||
} else { | ||
res = !(this.config.options[addr] && this.config.options[addr].disabled); | ||
} | ||
|
||
this.node.debug('option ' + addr + ' ' + id + ' ' + option + ' ' + res); | ||
return res; | ||
} | ||
|
||
constructor(config, node) { | ||
const {ccu} = node; | ||
this.node = node; | ||
this.ccu = ccu; | ||
this.config = config; | ||
if (this.option('SingleAccessory')) { | ||
new AccMultiService(config, node); | ||
} else { | ||
for (let j = 0; j < 3; j++) { | ||
for (let c = 0; c < 3; c++) { | ||
const i = (j * 4) + (c + 2); | ||
if ((c === 0 && this.option(i)) || (c !== 0 && this.option(i, 'enabled'))) { | ||
const channel = config.deviceAddress + ':' + i; | ||
const name = ccu.channelNames[channel]; | ||
this.node.debug("HMIP-DRDI3 call SingleService Channel: "+name+" "+channel); | ||
|
||
const chConfig = Object.assign({}, config, {accChannel: channel,accChannelName: name}); | ||
chConfig.description = Object.assign({}, config.description, {ADDRESS: channel}); | ||
|
||
new AccSingleService(chConfig, node); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -600,6 +600,10 @@ | |
addOption(addr, 'SingleAccessory'); | ||
addVirtualChannels(addr, 2, channelCount -1, 4); | ||
break; | ||
case 'hmip-drdi3': | ||
addOption(addr, 'SingleAccessory'); | ||
addVirtualChannels(addr, 2, channelCount -1, 4); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ich glaube, der erste Kanal müsste hier 5 und nicht 2 sein. |
||
break; | ||
|
||
case 'hmipw-drs4': | ||
case 'hmipw-drs8': | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Da der erste verwertbare Kanal der 5. ist, müsste hier eine +5 statt einer +2 verwendet werden?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Durch die Virtual Channels sieht man auch die verdeckten Kanäle.

Der Dimmer hat auf 1,5,9 die Statuskanäle als Rückgabe. Deswegen ist der erste Kanal 2,6,10 für Ausgang 1,2,3
habe ein Bild meiner CCU3 gemacht dort erkennt man es.
Habe mich vertan ist der hmipw drd3. diesen habe ich als basis genommen, da ich leider kein drdi3 habe.
wenn Sie einen haben können Sie das verifizieren?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Du hast einen DRD3, ich einen DRDI3, sind die vielliecht unterschiedlich?

So sieht es bei mir aus:
Ohne die Anpassung in der Datei
redmatic-homekit-homematic-devices.html
lief es bei mir jedenfalls definitiv nicht. Den Code in dieser Datei verstehe ich allerdings nicht zu 100%.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Das Kann sein.
Dein DRDI3 hat tastereingänge. hast du die virtuellen Kanäle an?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also ich nutze zumindest bislang keine virtuellen Kanäle. Die Einstellung "Kanal aktiv / inaktiv" bei den Statusmitteilungs-Kanälen steht auf "Aktiv", falls du das meinst.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meinte das hier,

es gibt bei Homematic immer 3 Kanäle pro Aktor Ausgang. es wäre interessant wie es dann aussieht wenn dort die virtuellen Kanäle (erweiterter Verknüpfungsmodus an ist).
Wenn du nur den Start Kanal anpassen musstest. dann passt das. Die Tastereingänge werden aktuell nicht ausgewertet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Achso, das ist wie bei dir nicht angehakt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also bei mir läuft jetzt alles wie es soll, an beiden Stellen muss für den DRDI3 aus der 2 eine 5 gemacht werden. Vielen Dank für die Vorarbeit!