ioBroker.sql
ioBroker.sql copied to clipboard
Duplicate Date
The adapter inserts identical values for the source adapter and for sql adapter.
How can I make the adapter ONLY log data from the source OR sql adapter? I don't need duplicate data in db.
If you do not need "duplicate "data then you should not configure it to write them ;-)
please show the confoguration of the datanpoint and also the adapzter confoiguration defaults for datapoints.
Maybe you want to "enable" the option to disable the graph optimized data logging ...
The thing is, I did not configure it to write it twice. I set the sql adapter to log the datapoint, 👇
{
"type": "state",
"common": {
"name": "Current plant power",
"type": "number",
"role": "value.power",
"read": true,
"write": false,
"unit": "W",
"custom": {
"sql.0": {
"enabled": true,
"storageType": "",
"counter": false,
"aliasId": "",
"debounceTime": 0,
"blockTime": 60000,
"changesOnly": true,
"changesRelogInterval": 60,
"changesMinDelta": "0",
"ignoreBelowNumber": "",
"disableSkippedValueLogging": false,
"retention": "31536000",
"customRetentionDuration": 365,
"maxLength": 0,
"enableDebugLogs": false,
"debounce": "1000"
}
}
},
"native": {},
"_id": "plenticore.0.devices.local.Pv_P",
"acl": {
"object": 1636,
"state": 1636,
"owner": "system.user.admin",
"ownerGroup": "system.group.administrator"
},
"from": "system.adapter.admin.0",
"user": "system.user.admin",
"ts": 1681568473156
}
which is working as expected. (The sql adapter logs data as defined in config. source: system.adapter.sql.0
)
But at the same time the plenticore adapter is writing the exact same value. source: system.adapter.plenticore.0
If I turn off sql logging for the datapoint. No values are written to db. Not from system.adapter.plenticore.0
OR system.adapter.plenticore.0
If I turn it back on, system.adapter.plenticore.0
AND system.adapter.sql.0
are again logging.
default:
{
"connLink": "",
"debounce": "1000",
"retention": "31536000",
"host": "192.168.0.20",
"port": 3306,
"user": "",
"password": "",
"dbtype": "mysql",
"fileName": "sqlite.db",
"requestInterval": "0",
"encrypt": false,
"round": "4",
"dbname": "iobroker",
"multiRequests": true,
"changesRelogInterval": 60,
"changesMinDelta": "0",
"writeNulls": false,
"maxConnections": 100,
"doNotCreateDatabase": false,
"maxLength": 0,
"blockTime": 60000,
"debounceTime": 0,
"disableSkippedValueLogging": false,
"enableLogging": false,
"rejectUnauthorized": false,
"customRetentionDuration": 365
}
Enabling graph optimized data logging apparently does not help.
Maybe I did not understand the concept, but I think it does not make sense to log the same value, at the same time for two different data sources.
So my question would be, how can I configure the sql adapter to only write a value once with either system.adapter.plenticore.0
OR system.adapter.plenticore.0
as a data source.
Btw: I have many other datapoints showing the same behavior. But it is not all. Some only log from system.adapter.sql.0
as expected.
The thing is, I did not configure it to write it twice.
Yes, because a majority of the users log data to visualize them and so the default is to log data in a way that it is optimized for visualization. If you do not need that you can turn this off.
So in fact: You did not turned the "optimized for visualization" logging off ;-)