Datamine2 MySensors button - sensor

I have created the graph for the button sensor (MySensor- button sensor) ,
But it strange…It shows that the hole last year the sensor was tripped…?
I just reinstall the sensor library on arduino but…the same result…
Looks like a wrong hystory created…

Hi. I’m not sure I fully understand the situation. Could you attach an image of the graph so I can see what you mean?

Thank you for your reply…
Please , take a look on to the picture ,the device created today,the chart is for all year, and it shows like the device was tripped, . In normal position the value is set to 0, and 1 in activated… So for all year it should be 0 indication … or i made something wrong…?

Ah! I see. This deserves some explanation as it is partly due to a design choice I made. DataMine2 only logs changes in variable values so when you added your device nothing got logged until the variable changed from 0 to 1. When looking back historically at the data the only value it has is 1 and it knows nothing about the history before this value.

The design choice I made was to continue the data backwards with the only value it knows when there is no data there. In many cases this works but in this case it doesn’t. The same situation could happen if there is a long break in the data where it can’t find the previous value and has to make a guess.

Are you able to log into your Vera box or if you are logging to USB can you access the data files? If so it would be simple to add a dummy value of zero at the beginning of the data. I can give instructions if required.

As a longer term fix I could add a configurable option as to whether to extend the data back or not.

Thanks for the help…!
Datamine is a great tool for vera graphing. i think…
Works great, no any problem at all…
Donation will follow :slight_smile:
My arduino sensor is connected to my Boiler consumption, so if the boiler was not working for couples of days , the total consumption per month is calculated wrong…as the graph shows for those days as 1. full consumption

Would you please instruct me how to reset the history to 0,
The date is stored on to USB .

Temporary i created a virtual switch connected to my sensor, and it makes everyday a tripping time for couple seconds, when the boiler is not working…
not letting the graph to calculate as it was value 1 for all the day.
By the way, for the weather is the same wrong readings.All the last year +13C, the temperature of the first reading of variable…:slight_smile:
But its not so critical as with the boiler calculations…

And one more question…
How the graph based on On Duration (Hours) works…?
Does it calculates a second…
For example : My boiler (pellet feeder) works interrupted during the minute…
5sec on 10 off
What would be the calculation for the total time in my case?

Hi @aivaredze - glad you like the plug-in.

The on-time functionality works to the nearest second, so if your boiler is on for 5 seconds then off for 10 seconds continuously for an hour and you have set the aggregation period to an hour then the result of the calculation will be 1,200 / 3,600 seconds = 0.33 hours.

The fact that you get an incorrect reading carried backwards whilst your boiler was not working is due to a fault in my code. This is a slightly different scenario from where it is the first ever reading, as it should be possible to find the correct value to use - I just never got round to writing the extra bit of code.

In the mean time if you want to manually edit your data…

  1. make a note of the variable name you want to change - this should be what is listed as the Display Name in the properties. Be careful as quite often you’ll have a number of variables coming from the same device that have very similar names.
  2. find the file /dataMine/dataMineConfig.json on your USB stick or via your favourite remote access tool (e.g. WinSCP) and open it for editing in a text editor such as Notepad or Notepad++
  3. find your chosen variable in the file and then search for a variable called “Id”: close to your chosen variable. This is considerably easier if you paste your file into a code beautifier such as
  4. decide at what time and date you want to make an edit and determine the unix timestamp for this time using
  5. find the directory /dataMine/database/<your id from step 3>/raw and open the file called <timestamp from step 4 divided by 604800>.txt. Alternatively you may just want to edit the most recent (highest number) or oldest (lowest number) file
  6. The file will be of the format ,. e.g. [tt]1431196757,100[/tt]. Find where you want to edit, insert or delete using the time stamp from step 4 as a guide, and make your edit.
  7. save the file, plug your USB back in, if you are using one and you are done - rerun the graph in dataMine2.

If you want to add an initial value to the file, just open the first datafile in the directory, find the first entry, subtract 1 from it and insert a new line before with the new initial value.

If you want trying to edit out a corrupt data point just search the file for the corrupt value then delete that line.

Hi, Constant Sphere.
I’m very appreciated for your help.
It works great.
Just removed the first log with the variable 1, and the history of the graph become 0 for all year…
Tonight was a test run for all night.
My Boiler- Arduino-Veraedge-DataMine2.
Works great!!

@aivaredze - great news.

Feel free to leave a review if you like it: MiOS Apps