Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deleteAll does not work when logging is already disabled #207

Closed
5G7K opened this issue Nov 30, 2021 · 3 comments
Closed

deleteAll does not work when logging is already disabled #207

5G7K opened this issue Nov 30, 2021 · 3 comments

Comments

@5G7K
Copy link

5G7K commented Nov 30, 2021

I want to use the deleteALL functionality to delete entries for not more existing data points.
I tried to use it like documented. BTW in the example in the docu there are some ' and , missing?

To delete ALL history data for some data point execute:

sendTo('sql.0', 'deleteAll', [
    {id: 'mbus.0.counter.xxx} 
    {id: 'mbus.0.counter.yyy}
], result => console.log('deleted'));

I tried to use it the following way:

sendTo('sql.0', 'deleteAll', [
    {id: 'alias.0.Heizung.Switch.Heating'},
    {id: 'alias.0.Heizung.Switch.Cooling'}
], result => console.log('deleted'));

I also tried instead of the name the IDs. But nothing happens

Log:

2021-11-30 12:49:11.873 - info: javascript.0 (32056) script.js.Test.JS_Test1: deleted
2021-11-30 12:49:11.854 - debug: sql.0 (32083) prepareTaskCheckTypeAndDbId CALLED for alias.0.Heizung.Switch.Heating
2021-11-30 12:49:11.855 - warn: sql.0 (32083) Ignore type lookup for alias.0.Heizung.Switch.Heating because not enabled anymore
2021-11-30 12:49:11.856 - warn: sql.0 (32083) Cannot store values of type "undefined" for alias.0.Heizung.Switch.Heating
2021-11-30 12:49:11.857 - debug: sql.0 (32083) prepareTaskCheckTypeAndDbId CALLED for alias.0.Heizung.Switch.Cooling
2021-11-30 12:49:11.857 - warn: sql.0 (32083) Ignore type lookup for alias.0.Heizung.Switch.Cooling because not enabled anymore
2021-11-30 12:49:11.859 - warn: sql.0 (32083) Cannot store values of type "undefined" for alias.0.Heizung.Switch.Cooling
2021-11-30 12:49:11.866 - debug: sql.0 (32083) deleteStateAll 2 items
2021-11-30 12:49:11.867 - debug: sql.0 (32083) prepareTaskCheckTypeAndDbId CALLED for alias.0.Heizung.Switch.Heating
2021-11-30 12:49:11.867 - warn: sql.0 (32083) Ignore type lookup for alias.0.Heizung.Switch.Heating because not enabled anymore
2021-11-30 12:49:11.868 - warn: sql.0 (32083) Cannot store values of type "undefined" for alias.0.Heizung.Switch.Heating
2021-11-30 12:49:11.869 - debug: sql.0 (32083) prepareTaskCheckTypeAndDbId CALLED for alias.0.Heizung.Switch.Cooling
2021-11-30 12:49:11.870 - warn: sql.0 (32083) Ignore type lookup for alias.0.Heizung.Switch.Cooling because not enabled anymore
2021-11-30 12:49:11.870 - warn: sql.0 (32083) Cannot store values of type "undefined" for alias.0.Heizung.Switch.Cooling
2021-11-30 12:49:13.269 - info: javascript.0 (32056) Stop script script.js.Test.JS_Test1

It this a bug or what's wrong?
Thank you very much!

@Apollon77 Apollon77 added the bug label Dec 18, 2021
@Apollon77
Copy link
Contributor

Ignore type lookup for alias.0.Heizung.Switch.Heating because not enabled anymore

This is the reason. the adapter can only handle values that are enabled for logging ...

Can this be the reason?

@Apollon77 Apollon77 added question and removed bug labels Dec 18, 2021
@5G7K
Copy link
Author

5G7K commented Dec 18, 2021

I want to use it to delete old entries out of my MariaDB for datapoints for which I have disabled SQL logging or for datapoints with SQL logging which I have deleted.
So yes, logging is not enabled any more.
But that would be the perfect function to delete the old entries. Would it be possible to enable this functionality also for this case?
Or is there an other way to do this (easier than to write a script with all the SQL statements)?
Thanks!

@Apollon77 Apollon77 changed the title deleteAll does not work deleteAll does not work when logging is already disabled Dec 20, 2021
@Apollon77
Copy link
Contributor

The problem is that for all that many meta information are needed and when the datapoint is disabled these data structures are not there. Ideally enable it and maybe set the min/max or such in a way that no new value is logged ... then delete, then deactivate again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants