Coder Social home page Coder Social logo

Comments (3)

tiele avatar tiele commented on August 18, 2024

double checked my version bx controller is 00_0010_7421_10_0100_052_2_0 => 2.0.1, that menu file doesn't include idHash

from resol-vbus.

tiele avatar tiele commented on August 18, 2024

I clearly misunderstood the documentation if i use the index and not the IdHash i have a working system!

Thank you Daniel for this great library!! 5 sunny days coming up, couldn't be more pleased, i can now now 'red node script' my valve to pass the central heating through the sun boiler if warm enough, instead of using the heat pump. One for the planet!

    client.on('message', (topic, payload) => {
        // Received Message: vbus/set 
        // on  { "hashId": 369, "value": 1 } handbediening R2
        // off { "hashId": 369, "value": 2 } handbediening R2
        logger.debug('Received Message: ' + topic + " " + payload.toString());
      
        const req = JSON.parse(payload);
        logger.debug('hashId: ' + req.hashId + " requested value: " + req.value);

        //waiting for the bus offering to get the address of the master device connected to the VBus
        const dgram = connection.waitForFreeBus(20000);
        //logger.debug('waitForFreeBus -> ' + dgram );
        dgram.then(datagram => {
            logger.debug('in result -> ' + JSON.stringify(datagram));
            if (datagram != null) {
                const deviceAddress = datagram.sourceAddress;
                
                //  R2 --> on = 1 {"destinationAddress":32,"sourceAddress":29729,"minorVersion":0,"timestamp":"2022-03-03T15:06:09.636Z","command":256,"valueId":369,"value":1,"channel":0}  
                //  R2 --> off = 2 ->{"destinationAddress":32,"sourceAddress":29729,"minorVersion":0,"timestamp":"2022-03-03T15:00:32.616Z","command":256,"valueId":369,"value":2,"channel":0}
           
               /*connection.getValueIdHashById(deviceAddress, 369).then(result => {
                    logger.debug('in result 3!!!!-> ' + JSON.stringify(result) + ' Jos' );
                    connection.releaseBus(deviceAddress);
                }); */
                connection.setValueById(deviceAddress, req.hashId, req.value ).then(result => {
                    logger.debug('setting  ' + JSON.stringify(result));
                    connection.releaseBus(deviceAddress);
                }); 
            }
        });
    })

from resol-vbus.

danielwippermann avatar danielwippermann commented on August 18, 2024

Thanks for the kind word and glad you got it working!

from resol-vbus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.