-
Notifications
You must be signed in to change notification settings - Fork 26
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
SQL driver: wrong detection of changes for aliase driver #295
Comments
Please enable debug logging for the instance and enable the enhanced debug log for such a datapoint and provide the debug log. thank you |
It is a fragment of debug log: Please pay attention to variable alias.0.Energy.Battery.Axioma100 (type: undefined, ID: 405)
There are two records in the log: at 2023-02-14 10:38:02.202 and 2023-02-14 10:38:02.366
|
Please also show the alias definition |
|
BTW: "role:"variable" is completely wrong. Who created this state? Should not be the mqtt adapter. it shoild be "role: "mixed" |
The base variable was created by MQTT Publish request. The alias is created manually from alias-manager. Ok I will change it manually |
Hm ... but alias.0.Energy.Battery.Axioma100 is correctly rounded as 12.3 in your above log example... just other values are not ... so whats exactly the issue here? |
The role "mixed" is absent in the list of available roles in both Admin UI and Alias-Manager |
(and that type is undefined for the very first attemt to write a value after adapterstart is completely correct because it will read the type from DB in that process. all fine here |
(and role missing is better then a wrong value, but should not be missing ... but might be in "older reated states" ... so ... I just stumbled over the "variable" which is in any case a wrong value |
The problem is: the SQL adapter creates a hundreds records in the DB with the same values:
It is a result of
I set options So, it should be just one record in DB with the timestamp where this value is set: |
BTW. I changed role: "mixed" manually and restart of SQL driver. Nothing to changed - a lot of records in DB with the same value |
Is the "optimization for displaying" enabled ... or better is it turned off? If not do that because most likely this is caused by this |
"Disable charting optimized logging of skipped values" = off. "On query round numbers to" is empty |
BTW, I set "On query round numbers to"=1. Nothing to changed - lot's of records in DB |
Ok, please share screenshots ofd the settings from adapter and from that datapoint and add a more longdebug log with at least 4-5 of the values logged from this datapoint 8and do not shorten it please). Attach please as file. The debug log normally contains excat infos why something was logged |
I have collected a set of screenshots of settings and a full log. Please, pay attention to the object with id=405, name= alias.0.Energy.Battery.Axioma100. |
I have exactly the same problem: are there any news or workarounds for this? |
No solution for this. In my case, I modify my script and check the previous value manually. How to resolve it when this value is generated by some device - I have no idea. |
The problem is that the check if the value changed is notthat easiely possible and normally the core system handles this. But because of the fact that an alias never has a real value and the value is always dynamically determined by the formula the basic "has value changed" information is carried from the basic value. So fixing this requires that the adapter builds up his own "last value cache" and do the comparism based on the real value and not on the provided details fro the core system. |
Thank you for your comments! Next I'll fiddle with SQL to get rid of duplicate consecutive values in my DB :-) |
Describe the bug
I have installed SQL driver 2.2.0 and Alias-Manager 1.2.4. Also, I have set up the alias variable with Read converter:
Math.round(val*10)/10
. This variable is stored in DB (PostgreSQL) with the parameters:The value for this variable is displayed in admin UI correctly (with 1 digit after the decimal point). But when I look in the DB:
I see the same values:
The same values are stored in DB with disregard of "Record changes only", It seems, like the presence of changes is detected before applying of Read converting.
To Reproduce
Steps to reproduce the behavior:
Record changes only
Record the same values (seconds)=0
Minimum difference from the last value=0
Expected result=Achieved result: The value of 1.2 is displayed for A1 in Admin UI and stored in DB
Expected behavior
from ts_number
where id in (
select id
from datapoints
where name = 'alias.0.A1'
)
order by ts desc
returns just 1 record.
Achieved result:
this select returns 2 records with the same val.
Screenshots & Logfiles
Versions:
Additional context
The text was updated successfully, but these errors were encountered: