Possibility to switch to different units

8 posts / 0 new
Last post
Matthias
Possibility to switch to different units

Hi,

I have to wait to be back home to be able to calibrate my scale / load cells. In the meantime, I use the remote desktop (or SSH) to play with my hivetool.

I am wondering if / how it is possible to change the units from Fahrenheit/pounds/MPH/feet above sea level to international/scientific units (°C, kg, km/h, m (basically SI-Units).

Looking into some files, I found that there is temp_f and temp_c defined in several instances, but I am not sure where the central switch is where I can set what is being written into the database and what is displayed for me.
Is there a possibility to change units and the calculation from sensor readings somewhere? I seem not to find it in the config.pl

If there is this possibility, could this differ between local database and hivetool.net? If the overall project is american, I would not want to mess up with different units. However, for my own purpose I would prefer metric units, since I have absolutely no feeling for Fahrenheit and pounds.

Best

Matthias

Emil
Emil's picture
Check out earlier post

I have the same problem, but in my hive emil I have calibrated the weight to Kg, but the temperature is still a problem
This is discussed in post http://hivetool.org/d/node/32
But I don't think there has been much progress here
The best would be to use pound and F and then convert on hivetool.net

Matthias
Thanks for the link. You're

Thanks for the link. You're right, not much happening in the other thread. Should there be interest to compare data from different hives in different countries, it would seem crucial to have metric units as a possibility. I will of course calibrate my scale also in kg, simply because I don't have any reference for lbs. if someone would use my kg-Data and they are still displayed as lbs, this would lead to serious misinterpretation of the data.

I had a look at the mysqlite-db, and it seems that all columns for imperial AND metric units are there. In fact, temperature is being written in degrees Velcius to temp-hive-c.

I Wonder where the code is that recalculates the values...

Paul
Paul's picture
SI Units

We definitely need to provide SI units. My philosophy (but I am open to suggestions) is that data should be uploaded in the native units of the sensor and calibrated/displayed in the native units of the user. I believe this reduces the chance of conversion and calibration error.

This is why the temp sensors (which usually provide only data in Celsius) is uploaded in C and converted to F on the server. (Did you know that there are only 4 countries in the world that use F? I believe to be a "real" scientific endeavor, we need to provide SI units.)

I suggest you calibrate the scale in kg and change the upload program so you are sending the units in kg. I will need to make sure that the kg to lb conversion is working on the server - I don't think it is in there.

In /home/hivetool/xml.sh the 4th line is:

<hive_weight_lbs>$HIVE_WEIGHT</hive_weight_lbs>

This should be changed to

<hive_weight_kgs>$HIVE_WEIGHT</hive_weight_kgs>

This will upload the weight in kgs to the server. BUT DON"T DO THIS YET as I need to test it. Actually, if you
are just testing, go ahead and upload it in ks and I will use your data to test the storage of kgs and the conversion to lbs.

There should be a switch to change the display from imperial to SI units. On the server, it would be a user preference that would be saved. On the local Pi, there could be a default setting in config.pl and a switch on the graph page.

The real question is how much farther do we want to go with the existing code - or is it time for a major rewrite? See
http://hivetool.net/node/140

I will see what I need to do in hive_statsX.pl and hive_graphX.pl to display SI units.

If you are running 0.7.4 on your pi, point your browser to hive_stats6.pl and click on the column heading "WEIGHT" (it is now a button). A channel setup frame should replace the graph. None of this is functional - I am just playing with what the UI should look like and what features should be added. hive_stats6 displays the local rain gauge. I am trying to move from a hive monitor to a general purpose monitoring program that can be used to monitor any system.

PS. The reason the SI units are not in there is because I started this just for my use. I do not view this as an American project but will hopefully be a world wide project where anyone/everyone can contribute and benefit.

Thanks!

Matthias
Hi Paul,

Hi Paul,

if you want my hive for test purposes: please, I'll be happy! But currentyl I don't upload Data to the server, as I don't dare to provide strange Data to the public, in case someone might use several hives for a metaanalysis or something? (Also, I don't have login credentials for the remote database yet).

The thing is, that especially my wight data have some problem. I have calibrated the load cells, and I have entered intercept and slope as modulus (is that the right vocable? I mean as positive value, I skipped the minus). Now the curve itselve makes somewhat sense and in config.pl, "Hive Weight" gives a meaningful value [kg] in the right column.
The numbers that appear then in the left Y-Axis of the graph don't make so much sense, as they are much, much bigger and the graph is plotted only in the upper part of the diagram. Where in the data flow could this happen / where could I have to make modifications?

Before typing my fingers off, see yourself:

[Link removed by administrator Paul - see response below]

Matthias
Hi Paul,

Hi Paul,

if you want my hive for test purposes: please, I'll be happy! But currentyl I don't upload Data to the server, as I don't dare to provide strange Data to the public, in case someone might use several hives for a metaanalysis or something? (Also, I don't have login credentials for the remote database yet).

The thing is, that especially my wight data have some problem. I have calibrated the load cells, and I have entered intercept and slope as modulus (is that the right vocable? I mean as positive value, I skipped the minus). Now the curve itselve makes somewhat sense and in config.pl, "Hive Weight" gives a meaningful value [kg] in the right column.
The numbers that appear then in the left Y-Axis of the graph don't make so much sense, as they are much, much bigger and the graph is plotted only in the upper part of the diagram. Where in the data flow could this happen / where could I have to make modifications?

Before typing my fingers off, see yourself:

[Link removed by administrator Paul - see response below]

(anyone, don't destroy my database. Pretty please!)

Paul
Paul's picture
BUG: Do not use scientific notation for slope.

The problem with the BIG weight numbers on the graph was the slope was entered using scientific notation: -5.996942287E-005
I changed it to: -0.000059969 and all is working. What was weird is that the weight was correct some places. I will fix this, but for now,
DO NOT USE SCIENTIFIC NOTATION FOR THE SLOPE.

Matthias,
Letting me access it was very helpful. I removed the link to your system. You can put it back if you wish but I did not want to leave your system unprotected without a password.

I suspect the data in the data base was multiplied by -5.996942287 instead of -0.00005996942287. If so, the data should be easy to correct.

Please start uploading your data. We plan to have quality ratings on the data and don't mind receiving data during the testing phase.

Please register your hive and test the new online hive registration form at http://hivetool.org/register.pl

Thanks!

Matthias
Paul, you're the best!

Paul, you're the best!
Seems that I was too stupid to see the most likely explanation.
Thanks for the rematrk, I deliberately took the risk when showing my URL here. However, I assumed that beekeepers wouldn't harm each other's systems and that some hackers don't see much benefit in manipulating a hivetool (they wouldn't get into the network, that I made sure).

Back to The untis-discussion. I calibrated the scale in kg, even though the data are being processed or treated as lbs by the system. Works fine for me, but I wondered how this would affect the switch in config.pl from metric to imperial, which you showed in another thread.
I see two ways:
a) another dropdown in the config.pl, that tells the system to enter the weight data in hive_weight_kg OR hive_weight_lbs
b) a hint in the calibration-article that calibration must be in lbs, even if the calibration weights are kg. One could imagine converting the calibration weights from kg into imperial or to convert the slope and intercept values.

Log in to post comments