enocean-js / nrce-deprecated

depricated
MIT License
2 stars 2 forks source link

[WIP] Listen to incoming Enocean Requests #2

Closed nabbl closed 7 years ago

nabbl commented 7 years ago

Please don't merge yet. Several things left to do. Using the PR to keep track of ToDo:

Holger-Will commented 7 years ago

Different Buttons to send from need to be implemented (maybe generating nodes on the fly?)

i do have a somewhat rough generic telegram encoder/decoder script i'm currently working on that could be of help here...

maybe it's best to only have a simple button, and to put more complex nodes in seperate repositories...

Holger-Will commented 7 years ago

Allow multiples of the same Listener Node and reuse connection

shouldn't this be automatic when using config nodes?

nabbl commented 7 years ago

This encoder/decoder script sounds great! I had a look at your button implementation and this should work for at least a simple example. But something more dynamic would be nice to have.

Yes we should seperate more complex stuff maybe. It would be great to have a normal Rocker-Switch as Standard and if you want a Dimmer or whatever you can get additional nodes from NPM.

Holger-Will commented 7 years ago

i would suggest the following changes:

don't pollute the global scope. move the enocean declaration into the config node.

function EnOceanConfig(n) {
    RED.nodes.createNode(this, n);
    this.config = n;
    var enocean = require("node-enocean")({
        sensorFilePath:"/knownSensors.json",
        configFilePath:"/config.json",
        timeout:30 //make this a config, too?
    });
     try {
         this.enocean.listen(this.config.serialport);

    ...
nabbl commented 7 years ago

would certainly make sense.

nabbl commented 7 years ago

Made some changes. There is a button to send telegrams to actuators now. I can't send and then receive the same telegram though. Makes me wonder if the telegram is actually sent.

need to check when I am at home...

Holger-Will commented 7 years ago

i would really like to merge so i can play around with this myself ;-)

nabbl commented 7 years ago

I am going to make some last commits and then it is ready to go :)