ioBroker / ioBroker.zwave

Legacy Z-Wave integration using OpenZWave
Other
24 stars 7 forks source link

Support of openzwave-shared function "sendRawData" #102

Open KevinK4711 opened 4 years ago

KevinK4711 commented 4 years ago

Hi all,

For the automation of my Eurotronic Spirit Z thermostats using ioBroker I want to feed the current measured temperature to the Spirit since its own measurement is incorrect.

Therfore I'd like to make use of the openzwave-shared function sendRawData():

NAN_METHOD(OZW::SendRawData)
    // ===================================================================
    {
        Nan::HandleScope scope;
        CheckMinArgs(5, "nodeid, logText<str>, msgType<uint8>, sendSecure<bool>, content<Buffer> (,length)");
        uint8 nodeid     = Nan::To<Number>(info[0]).ToLocalChecked()->Value();
        ::std::string logText(*Nan::Utf8String( info[1] ));
        uint8 msgType    = Nan::To<Number>(info[2]).ToLocalChecked()->Value();
        bool sendSecure  = Nan::To<Boolean>(info[3]).ToLocalChecked()->Value();
        checkType(Buffer::HasInstance(info[4]));
        uint8 *content   = (uint8*)Buffer::Data(info[4]);
        double buflength =  Buffer::Length(info[4]);
        uint8 length    = 0;
        // can either deduce length from JS buffer, or use the length provided
        if (info.Length() > 5) {
            length = ::std::min<double>( Nan::To<Number>(info[5]).ToLocalChecked()->Value(), buflength );
        } else {
            length = buflength;
        }
        OZWManager( SendRawData, homeid, nodeid, logText, msgType, sendSecure, content, length );
    }

Could you please provide an option to invoke this function on a zwave device using iobroker.zwave?

More background: https://forum.iobroker.net/topic/22396/eurotronic-spirit-z-wave-ist-temperatur-extern-setzen https://github.com/OpenZWave/node-openzwave-shared/issues/358

cburghardt commented 4 years ago

According to the issue on openzwave-shared the device did not accept the input so why would it help when iobroker sends the same?

KevinK4711 commented 4 years ago

That's something I'm working on. As soon as I know how to transmit the value correctly I'd appreciate it if the function would be included in iobroker.zwave. I think the function might be of value for other occasions as well?