danielwippermann / resol-vbus

A JavaScript library for processing RESOL VBus data
MIT License
67 stars 34 forks source link

With npm install the new version all the optimizer and src / dist directory are gone #55

Closed SurfGargano closed 3 years ago

SurfGargano commented 3 years ago

With npm install the new version all the optimizer files and src / dist directory are gone

danielwippermann commented 3 years ago

I have not been able to reproduce this bug myself. But I just published a new version 0.22.0 to the npm registry which drops the transpilation step and should again contain a src directory. Please give it a try.

SurfGargano commented 3 years ago

The optimizerfiles are now available in directory src. But there is an error : Unable to create optimizer for master with address 0x1121. with the old version it was functional without error. Is the connection procedure changed ? I have seen there is something changed in the function createConnection...

danielwippermann commented 3 years ago

It still works for me:

const vbus = require('resol-vbus');

async function main() {
    const optimizer = await vbus.ConfigurationOptimizerFactory.createOptimizerByDeviceAddress(0x1121);

    console.log(optimizer);
}

main().then(null, err => {
    console.error(err);
    process.exit(1);
});

This hands me back the correct optimizer for the address you mentioned.

Can you post the full error message including the stack trace, please?

SurfGargano commented 3 years ago

Hi Daniel,

again I have problems with the new resol-vbus (0.22.0)

I get the answer of a request as follows :

loadedConfig [{"valueId":"THolyCool","valueIndex":65,"priority":0,"valueTextById":{},"pending":false,"transceived":false},{"valueId":"Handbetrieb1","valueIndex":552,"priority":0,"valueTextById":{"Off":0,"Auto":1,"On":2},"pending":false,"transceived":false}]

with the old version there was an item ‚value‘ in the json string, but with this version it disappeared.

Can you please check.

This is the code snippet :

const optimizer = await vbus.ConfigurationOptimizerFactory.createOptimizerByDeviceAddress(context.deviceAddress);

            context.optimizer = optimizer;

            if (!optimizer) {

                throw new Error ('Unable to create optimizer for master with address 0x'+context.deviceAddress.toString(16));

            }

            context.customizer = new vbus.ConnectionCustomizer({

                deviceAddress: context.deviceAddress,

                connection: context.connection,

                optimizer: context.optimizer,

            });

            let readConfig = [];

            jsoncontrollerSetupItems.dp.forEach(item => {

                const fct = this.searchForFctItem(item.dpName);

                if (fct.cmd) {

                    // generate readConfig                        

                    const thisConfig = {valueId: fct.cmd};

                    readConfig.push(thisConfig);

                }

            });

            const options = {

                optimize: !readConfig

            };

            const loadedConfig = await context.customizer.loadConfiguration(readConfig, options);

            this.log.debug('loadedConfig options '+JSON.stringify(options));

            this.log.debug('loadedConfig '+JSON.stringify(loadedConfig)); 

            this.log.debug('readConfig '+JSON.stringify(readConfig));

            loadedConfig.forEach (item => {

                let fctItem=this.searchForDpItem(item.valueId);

                let thisDpName =  context.deviceID + actionPath + fctItem.name;

                this.setStateAsync(thisDpName,item.value,true);

            });

best regards

Werner

Von: danielwippermann @. Gesendet: Mittwoch, 12. Mai 2021 16:14 An: danielwippermann/resol-vbus @.> Cc: Gargano @.>; Author @.> Betreff: Re: [danielwippermann/resol-vbus] With npm install the new version all the optimizer and src / dist directory are gone (#55)

It still works for me:

const vbus = require('resol-vbus');

async function main() { const optimizer = await vbus.ConfigurationOptimizerFactory.createOptimizerByDeviceAddress(0x1121);

console.log(optimizer);

}

main().then(null, err => { console.error(err); process.exit(1); });

This hands me back the correct optimizer for the address you mentioned.

Can you post the full error message including the stack trace, please?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/danielwippermann/resol-vbus/issues/55#issuecomment-839806940 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AQYEOD6MF4AQ32V4ABLONATTNKEKJANCNFSM43RH6URA .

SurfGargano commented 3 years ago

Entwarnung: Irgenwie hat sich das Resol-Teil aufgehangen. Power off/on, jetzt geht es wieder. Man steckt halt nicht drin

Viele Grüße

Werner

Von: Werner Dungs @. Gesendet: Sonntag, 16. Mai 2021 19:54 An: 'danielwippermann/resol-vbus' @.> Betreff: AW: [danielwippermann/resol-vbus] With npm install the new version all the optimizer problems reading values (#55)

Hi Daniel,

again I have problems with the new resol-vbus (0.22.0)

I get the answer of a request as follows :

loadedConfig [{"valueId":"THolyCool","valueIndex":65,"priority":0,"valueTextById":{},"pending":false,"transceived":false},{"valueId":"Handbetrieb1","valueIndex":552,"priority":0,"valueTextById":{"Off":0,"Auto":1,"On":2},"pending":false,"transceived":false}]

with the old version there was an item ‚value‘ in the json string, but with this version it disappeared.

Can you please check.

This is the code snippet :

const optimizer = await vbus.ConfigurationOptimizerFactory.createOptimizerByDeviceAddress(context.deviceAddress);

            context.optimizer = optimizer;

            if (!optimizer) {

                throw new Error ('Unable to create optimizer for master with address 0x'+context.deviceAddress.toString(16));

            }

            context.customizer = new vbus.ConnectionCustomizer({

                deviceAddress: context.deviceAddress,

                connection: context.connection,

                optimizer: context.optimizer,

            });

            let readConfig = [];

            jsoncontrollerSetupItems.dp.forEach(item => {

                const fct = this.searchForFctItem(item.dpName);

                if (fct.cmd) {

                    // generate readConfig                        

                    const thisConfig = {valueId: fct.cmd};

                    readConfig.push(thisConfig);

                }

            });

            const options = {

                optimize: !readConfig

            };

            const loadedConfig = await context.customizer.loadConfiguration(readConfig, options);

            this.log.debug('loadedConfig options '+JSON.stringify(options));

            this.log.debug('loadedConfig '+JSON.stringify(loadedConfig)); 

            this.log.debug('readConfig '+JSON.stringify(readConfig));

            loadedConfig.forEach (item => {

                let fctItem=this.searchForDpItem(item.valueId);

                let thisDpName =  context.deviceID + actionPath + fctItem.name;

                this.setStateAsync(thisDpName,item.value,true);

            });

best regards

Werner

Von: danielwippermann @. Gesendet: Mittwoch, 12. Mai 2021 16:14 An: danielwippermann/resol-vbus @. @.> > Cc: Gargano @. @.> >; Author @. @.***> > Betreff: Re: [danielwippermann/resol-vbus] With npm install the new version all the optimizer and src / dist directory are gone (#55)

It still works for me:

const vbus = require('resol-vbus');

async function main() { const optimizer = await vbus.ConfigurationOptimizerFactory.createOptimizerByDeviceAddress(0x1121);

console.log(optimizer);

}

main().then(null, err => { console.error(err); process.exit(1); });

This hands me back the correct optimizer for the address you mentioned.

Can you post the full error message including the stack trace, please?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/danielwippermann/resol-vbus/issues/55#issuecomment-839806940 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AQYEOD6MF4AQ32V4ABLONATTNKEKJANCNFSM43RH6URA .

danielwippermann commented 3 years ago

Hi Werner,

danke für die Rückmeldung. Dann schließe ich mal das Ticket. Sollte noch etwas sein, mach einfach ein neues auf.

Bis dann, Daniel

SurfGargano commented 3 years ago

Danke für Deine Geduld, meine war schon fast am Ende, nachdem ich den ganzen Tag rumprobiert habe.

Zum Schluss bin ich dann auf den Power Reset gekommen.

Viele Grüße

Werner

Von: danielwippermann @. Gesendet: Montag, 17. Mai 2021 15:23 An: danielwippermann/resol-vbus @.> Cc: Gargano @.>; Author @.> Betreff: Re: [danielwippermann/resol-vbus] With npm install the new version all the optimizer and src / dist directory are gone (#55)

Hi Werner,

danke für die Rückmeldung. Dann schließe ich mal das Ticket. Sollte noch etwas sein, mach einfach ein neues auf.

Bis dann, Daniel

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/danielwippermann/resol-vbus/issues/55#issuecomment-842320208 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AQYEODYBKOKYYQ7QCADQIFLTOEKCLANCNFSM43RH6URA .