Mathematical operations

Discussion of the Meteohub software package

Moderator: Mattk

Post Reply
masgio69
Fresh Boarder
Fresh Boarder
Posts: 11
Joined: Thu Apr 23, 2020 12:38 pm

Mathematical operations

Post by masgio69 »

Hello everyone, question, is it possible to perform mathematical operations via the meteohub? I better explain myself from the tag [actual_th0_temp_c] I want to subtract [last60m_th0_temp_c] ( [actual_th0_temp_c]-[last60m_th0_temp_c] ), which formula should I use? Thanks so much.

User avatar
d_l
Expert Boarder
Expert Boarder
Posts: 137
Joined: Fri Mar 13, 2009 12:58 am
Location: Reno, Nevada USA
Contact:

Re: Mathematical operations

Post by d_l »

I could be wrong but I don't think there is any way to do what you want The Meteohub has only limited ability to manipulate actual square bracket weather data values. See the Meteohub manual v4.7 pages 71-73.

There may be other ways handle the calculation. What is the result to be used for?

masgio69
Fresh Boarder
Fresh Boarder
Posts: 11
Joined: Thu Apr 23, 2020 12:38 pm

Re: Mathematical operations

Post by masgio69 »

Hello, I would need the result to make a comparison of the temperature at the same time yesterday and that of a year ago .....

User avatar
d_l
Expert Boarder
Expert Boarder
Posts: 137
Joined: Fri Mar 13, 2009 12:58 am
Location: Reno, Nevada USA
Contact:

Re: Mathematical operations

Post by d_l »

If you have a website, you could output the two values as a txt file and then use a little PHP program to handle the subtraction. This would be somewhat similar to the way the Revised Chandler Burning Index: viewtopic.php?f=9&t=14614 is handled, except the calculations would be handled outside of the Meteohub in the PHP program..

masgio69
Fresh Boarder
Fresh Boarder
Posts: 11
Joined: Thu Apr 23, 2020 12:38 pm

Re: Mathematical operations

Post by masgio69 »

I had already seen posts about these functions, I wanted to find something simpler without complicating life too much. Anyway, thank you for replying. Although I am of the opinion that a system like meteohub should allow me to do these calculations. Thanks so much.

User avatar
d_l
Expert Boarder
Expert Boarder
Posts: 137
Joined: Fri Mar 13, 2009 12:58 am
Location: Reno, Nevada USA
Contact:

Re: Mathematical operations

Post by d_l »

One more try at your problem. You might take a look at this math formula on page 73 of the manual:

"{math- val1 val2 ... valn}" subtracts enclosed values from position two on from
number at position 1. For example, "{math- 2 5 -1}" returns "-2.00". Computation: (2 -
5) - (-1)

You would have to get your temp yesterday as val1 and the temp a year ago as val2

I'm sorry that I can't help you further. I haven't really worked with manipulating data in this square bracket format [like this} within the Meteohub other that outputting values to a HTML page.

masgio69
Fresh Boarder
Fresh Boarder
Posts: 11
Joined: Thu Apr 23, 2020 12:38 pm

Re: Mathematical operations

Post by masgio69 »

Dont worry d_I , thank you so much for trie to help me......

mikeo
Junior Boarder
Junior Boarder
Posts: 21
Joined: Thu Jan 07, 2016 11:03 pm

Re: Mathematical operations

Post by mikeo »

I believe what you're trying to accomplish is possible via the "virtual sensors" function. I'm not sure how/where you're going to source the non-sensor or legacy data, but math functions are possible via "awk". Look at the manual for virtual sensors and awk.
I'm currently using an i2c magnetometer (compass) to write a compass heading to a file with python, then using a virtual sensor to replace the anemometer direction data with the compass heading via awk. My weather station is on a boat that is moored to a single point and it rotates around that point. The boat functions as the wind-direction because the wind direction of my sensor array always says the wind is from the North as the boat rotates.

If you're interested I can post some of the virtual sensor code that I use to do mathematical operation so you can see what I've done.

Take a look around page #32 of https://www.meteohub.de/files/meteohub-v4.7en.pdf

Post Reply