JustAnOpossum / myq-node

Chamberlain node module
4 stars 1 forks source link

Anyone aware of how to get myq-node to work in Node-RED using node-red-contrib-npm? #1

Closed jtmoderate876 closed 6 years ago

jtmoderate876 commented 7 years ago

Anyone aware of how to get myq-node to work in Node-RED using ? I seem to be able to execute login but not getDevices() I get payload: "[Circular ~]" instead of a list of devices.

I do this from Node-RED, using node-red-contrib-npm,

image

then create function: "establish function getDevices":

const getDevices = function () {

    let promise = new Promise((resolve, reject) => {
        msg.resolve = resolve;
        msg.reject = reject;
    });

    node.send(Object.assign({}, msg));

    return promise;
};

global.set('getDevices', getDevices);

that feeds the NPM node pointing to npm node: myq-node

msg.payload = npm_module.getDevices();
return msg;
JustAnOpossum commented 7 years ago

I don't know node RED but this is what getDevices returns

{ Devices: [], ReturnCode: '0', ErrorMessage: '', CorrelationId: '' }
jtmoderate876 commented 6 years ago

Closing but I never got it working with NodeRED. May revisit if things change or Chamberlain becomes more open. Thx.