You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The reason will be displayed to describe this comment to others. Learn more.
Why would you let influxdb determine the timestamp? It would deviate from the Domoticz timestamp. Suppose influxdb is down because of an upgrade and you want to determine the missed pushes to import manually via a script that reads sqlite. But if the timestamps are not shared it becomes difficult to pinpoint exactly.
The reason will be displayed to describe this comment to others. Learn more.
It did not work out for some users...
Worked on mine setup
But if it's down you got bigger issues then a timestamp of a temperature sensor
Happy to accept a working patch
The reason will be displayed to describe this comment to others. Learn more.
Hmm, just read his report and that is weird. He seemed to have issues with some data being in second precision, while other data in nanosecond. That makes no sense.
But you don't actually have to convert the timestamp to nanoseconds, and the InfluxDB team recommend to send in a lower precision if the source is not nanoseconds.
** We recommend using the least precise precision possible as this can result in significant improvements in compression. influxdb write documentation
This circumvents the issue of multiplying by 1**9, allows InfluxDB too compress better, and you only need to add &precision=s to the influxdb URL (behind ?db=XXX)
The reason will be displayed to describe this comment to others. Learn more.
Well I tested before I committed the code....and without the conversion the timestamps where completely wrong in my influxdb (latest version)
I would have expect I could indeed just use the output from time_t
That's why I needed to convert them
But from his report, the temperature timestamps looked fine
Maybe because we send (could send) multiple values in one go, that the timestamps for the second and up lines are not correctly being received or handled?
Bdw, at the moment when.your influx machine can not be received, the package is also dropped
The reason will be displayed to describe this comment to others. Learn more.
I am experience invalid timestamps in a new configuration of influxdb data push as well. My Domoticz is v3.6708, InfluxDB 1.2.2. My sensor data has accumulated over several days, all with invalid "1970" dates but slowly accumulating time in the lower digits. Tacking on various precision alternatives from ns to ms to s had no effect other than to "speed up the clock" on the subsequent timestamps, without providing the correct date. Details on http://www.domoticz.com/forum/viewtopic.php?f=28&t=16108&p=127806#p127806
The reason will be displayed to describe this comment to others. Learn more.
No, my comments above are based on using InfluxDB push, and the post on domoticz forum were based on influxdb push problem.
You probably saw in my forum post where user sincze suggested I try http push using: http://influxmachine:8086/write?db=domoticz&u=root&p=root&precision=ms as an experiment, that post has been corrected.
I found an interesting discussion of this kind of trouble with timestamps in influxDB github issue: influxdata/influxdb#6041
More data: from database created yesterday, configured as posted in forum link above. Data push (influxdb), queries now after ~ 12-18 hours of data:
> use domoinflux
Using database domoinflux
> precision ns
> select "value" from "Temperature"
name: Temperature
-----------------
time value
1276416 63.3
1276416 54.1
…
2142177792 57
2142991872 54.1
2143905792 55.9
> precision ms
> select "value" from "Temperature"
name: Temperature
-----------------
time value
1 54.1
1 63.3
2 55.8
…
2142 57
2142 54.1
2143 55.9
You can see that timestamp is not correct for either ns or ms precision.
The reason will be displayed to describe this comment to others. Learn more.
I see no straight answer in the Influxdb issue either...
I can remove the timestamp completely as in the first commit... this was, influxdb will generate the timestamp, shall we try this ?
The reason will be displayed to describe this comment to others. Learn more.
Excuse my unqualified comment, but is this perhaps simply an error in declaring the precision to be the same as the timestamp data when writing?. So much timestamp confusion in many github influxdata issues. An interesting one: influxdata/influxdb#4226.
As of now, writing to InfluxDB with the precision flag in the query string is inconsistent. When writing without a timestamp, the precision flag tells Influx to truncate the write time to the given unit of precision. When writing with a timestamp, the precision flag is telling Influx the units of the write.
From my user perspective there is no difference in timestamp provided with domoticz data or by influxdata import time, but perhaps it could be a checkbox option.
Thank you to everyone involved in writing and maintaining this project.
The reason will be displayed to describe this comment to others. Learn more.
I wanted to remove the time stamping in Domoticz... but quess what... it was already removed
So InfluxDb is timestamping.... so this is definitely not a Domoticz issue...
We only send the value
Currently my VPN connection is broke, so i am unable to test
The reason will be displayed to describe this comment to others. Learn more.
It is curious that http push is writing correct timestamps while influxdb push has this problem. (same systems, same day.) I don’t think the problem is with Influx.
(but with http push I can’t figure out how to send the correct data elements that are sent by influxdb push, or I would use it).
InfluxDB query, data from HTTP Push:
SELECT "value" FROM "device_Temperature"
name: device_Temperature
------------------------
time value
1491850628000000000 64.9
1491850731000000000 64.9
1491850828000000000 64.9
1491850928000000000 64.9
1491851031000000000 64.9
InfluxDB query, data from Influx Push:
SELECT "value" FROM "Temperature"
name: Temperature
------------------------
time value
796169216 54.3
797171712 55
797443072 64.6
The reason will be displayed to describe this comment to others. Learn more.
Do you have multiple sensors that can be received at the same time ? This because the influxdb pusher is able to push multiple values
Maybe something goes wrong here, when it actually sends multiple values ?
The reason will be displayed to describe this comment to others. Learn more.
I don't have the skill to understand the source code, sorry. I have many years experience working with unix and (old school) databases, but I'm an amateur coder. I have been pushing data from 4+ different sensors with both Influx push first and trying HTTP push later. Both are running now.
InfluxDB push is correctly loading all my sensor data, consistently. But not the timestamp.
My simultaneous HTTP push to InfluxDB server is also loading the same data (into a different InfluxDB database) consistently. But only the correct timestamp (ms significant plus zero padding to ns digits) and value, no luck getting any device name, idx, etc.
I was curious if the difference between the timestamp data in the Domoticz log (correct time) and in the InfluxDB log (incorrect time) would help understand the issue. Of course the big problem is that the timestamps in InfluxDB are starting at the Epoch date beginning 01-Jan-1970. But they continue to increment at a slow rate, so I measured it.
I don't know if it helps, but the the influxDB timestamps continue to increment from 1970/01/01 at real elapsed time*.0035. The epoch NS time stamps are not at all incorrect simply by the decimal place.
It is hard to understand how the trouble could be with the InfluxDB engine as opposed to the push code.
I am asking on the Domoticz forum if any users are getting successful results with Domoticz version V3.6708, like I am using. I wonder if reports of success are really from earlier versions.
00b7111
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would you let influxdb determine the timestamp? It would deviate from the Domoticz timestamp. Suppose influxdb is down because of an upgrade and you want to determine the missed pushes to import manually via a script that reads sqlite. But if the timestamps are not shared it becomes difficult to pinpoint exactly.
00b7111
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It did not work out for some users...
Worked on mine setup
But if it's down you got bigger issues then a timestamp of a temperature sensor
Happy to accept a working patch
00b7111
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, just read his report and that is weird. He seemed to have issues with some data being in second precision, while other data in nanosecond. That makes no sense.
But you don't actually have to convert the timestamp to nanoseconds, and the InfluxDB team recommend to send in a lower precision if the source is not nanoseconds.
This circumvents the issue of multiplying by 1**9, allows InfluxDB too compress better, and you only need to add
&precision=s
to the influxdb URL (behind?db=XXX
)00b7111
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well I tested before I committed the code....and without the conversion the timestamps where completely wrong in my influxdb (latest version)
I would have expect I could indeed just use the output from time_t
That's why I needed to convert them
But from his report, the temperature timestamps looked fine
Maybe because we send (could send) multiple values in one go, that the timestamps for the second and up lines are not correctly being received or handled?
Bdw, at the moment when.your influx machine can not be received, the package is also dropped
00b7111
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am experience invalid timestamps in a new configuration of influxdb data push as well. My Domoticz is v3.6708, InfluxDB 1.2.2. My sensor data has accumulated over several days, all with invalid "1970" dates but slowly accumulating time in the lower digits. Tacking on various precision alternatives from ns to ms to s had no effect other than to "speed up the clock" on the subsequent timestamps, without providing the correct date. Details on http://www.domoticz.com/forum/viewtopic.php?f=28&t=16108&p=127806#p127806
00b7111
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems you use the http push ? and not the influxdb push?
00b7111
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, my comments above are based on using InfluxDB push, and the post on domoticz forum were based on influxdb push problem.
You probably saw in my forum post where user sincze suggested I try http push using:
http://influxmachine:8086/write?db=domoticz&u=root&p=root&precision=ms
as an experiment, that post has been corrected.I found an interesting discussion of this kind of trouble with timestamps in influxDB github issue: influxdata/influxdb#6041
More data: from database created yesterday, configured as posted in forum link above. Data push (influxdb), queries now after ~ 12-18 hours of data:
You can see that timestamp is not correct for either ns or ms precision.
00b7111
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see no straight answer in the Influxdb issue either...
I can remove the timestamp completely as in the first commit... this was, influxdb will generate the timestamp, shall we try this ?
00b7111
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excuse my unqualified comment, but is this perhaps simply an error in declaring the precision to be the same as the timestamp data when writing?. So much timestamp confusion in many github influxdata issues. An interesting one: influxdata/influxdb#4226.
Edited: more detailed and current issue influxdata/influxdb#8053.
From my user perspective there is no difference in timestamp provided with domoticz data or by influxdata import time, but perhaps it could be a checkbox option.
Thank you to everyone involved in writing and maintaining this project.
00b7111
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to remove the time stamping in Domoticz... but quess what... it was already removed
So InfluxDb is timestamping.... so this is definitely not a Domoticz issue...
We only send the value
Currently my VPN connection is broke, so i am unable to test
00b7111
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
00b7111
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have multiple sensors that can be received at the same time ? This because the influxdb pusher is able to push multiple values
Maybe something goes wrong here, when it actually sends multiple values ?
Have a look here, it is a very small file:
https://github.com/domoticz/domoticz/blob/master/push/InfluxPush.cpp
00b7111
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have the skill to understand the source code, sorry. I have many years experience working with unix and (old school) databases, but I'm an amateur coder. I have been pushing data from 4+ different sensors with both Influx push first and trying HTTP push later. Both are running now.
InfluxDB push is correctly loading all my sensor data, consistently. But not the timestamp.
My simultaneous HTTP push to InfluxDB server is also loading the same data (into a different InfluxDB database) consistently. But only the correct timestamp (ms significant plus zero padding to ns digits) and value, no luck getting any device name, idx, etc.
I was curious if the difference between the timestamp data in the Domoticz log (correct time) and in the InfluxDB log (incorrect time) would help understand the issue. Of course the big problem is that the timestamps in InfluxDB are starting at the Epoch date beginning 01-Jan-1970. But they continue to increment at a slow rate, so I measured it.
I don't know if it helps, but the the influxDB timestamps continue to increment from 1970/01/01 at real elapsed time*.0035. The epoch NS time stamps are not at all incorrect simply by the decimal place.
It is hard to understand how the trouble could be with the InfluxDB engine as opposed to the push code.
I am asking on the Domoticz forum if any users are getting successful results with Domoticz version V3.6708, like I am using. I wonder if reports of success are really from earlier versions.
Thank you for your work on this project.