New Feature: Virtual Sensors

All about the standard Meteobridge devices based on mobile routers from TP-Link, D-Link, ASUS

Moderator: Mattk

Post Reply
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7874
Joined: Mon Oct 01, 2007 10:51 pm

New Feature: Virtual Sensors

Post by admin »

Just updated release brings virtual sensors to Meteobridge. The idea is that not just direct data from a weather station is stored, but that also derived data from sensors can be stored as a new "virtual" sensor. Please read about details here: https://meteobridge.com/wiki/index.php/ ... ersion_5.7

This thread is meant to share experiences and application ideas.
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7874
Joined: Mon Oct 01, 2007 10:51 pm

Re: New Feature: Virtual Sensors

Post by admin »

Use Case: "Use own computation for derived data"

Example: Implement your own wind chill computation.

Code: Select all

T(wc) = 0.0817(3.71V**0.5 + 5.81 -0.25V)(T - 91.4) + 91.4 
where T(wc) is the wind chill, V is in the wind speed in statute miles per hour and T is the temperature in degrees Fahrenheit.
Source: http://weather.uky.edu/aen599/wchart.ht ... Fahrenheit.

Implementation in Meteobridge:

Code: Select all

Trigger Sensor "wind0!chill"
Virtual Sensor "wind8!0chill"
Computation: {* ( ( 0.0817 * ( 3.71 * sqrt( [wind0wind-act=mph:0] ) - 0.25 * [wind0wind-act=mph:0] + 5.81 ) * ( [th0temp-act=F:INVALID] - 91.4 ) + 91.4 ) - 32 ) * 5 / 9 *}
Last part of "( .... - 32 ) * 5 / 9" expression is meant to convert Fahrenheit back to Celsius.

When you move yout mouse over the "i" you see the breakdown of the last computation:

Code: Select all

2023-11-15 14:56:04
expression: {* ( ( 0.0817 * ( 3.71 * sqrt( [wind0wind-act=mph:0] ) - 0.25 * [wind0wind-act=mph:0] + 5.81 ) * ( [th0temp-act=F:] - 91.4 ) + 91.4 ) - 32 ) * 5 / 9 *}
eval vars:  {* ( ( 0.0817 * ( 3.71 * sqrt( 0.0 ) - 0.25 * 0.0 + 5.81 ) * ( 46.8 - 91.4 ) + 91.4 ) - 32 ) * 5 / 9 *}
eval math:  21.24
eval cond.: 21.24
value:      21.240000
I think the formula itself is not providing too much sense, but it explains how computation with complicated math works in general.
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7874
Joined: Mon Oct 01, 2007 10:51 pm

Re: New Feature: Virtual Sensors

Post by admin »

Another windchill computation from https://www.backpacker.com/skills/how-t ... ind-chill/

Formula:

Code: Select all

F = 35.74 + 0.6215T – 35.75(V^0.16) + 0.4275T(V^0.16)
with T and F in °F, V in mph
Implementation in Meteobridge:

Code: Select all

Trigger Sensor "wind0!chill"
Virtual Sensor "wind8!1chill"
Computation: {* ( ( 35.74 + 0.6215 * [th0temp-act=F:INVALID] - 35.75 * [wind0wind-act=mph:0] ^ 0.16  + 0.4275 * [wind0wind-act=mph:0] ^ 0.16 ) - 32 ) * 5 / 9 *}
Evaluation flow shows at "i" icon as follows:

Code: Select all

2023-11-15 19:47:47
expression: {* ( ( 35.74 + 0.6215 * [th0temp-act=F:INVALID] - 35.75 * [wind0wind-act=mph:0] ^ 0.16  + 0.4275 * [wind0wind-act=mph:0] ^ 0.16 ) - 32 ) * 5 / 9 *}
eval vars:  {* ( ( 35.74 + 0.6215 * 47.1 - 35.75 * 0.0 ^ 0.16  + 0.4275 * 0.0 ^ 0.16 ) - 32 ) * 5 / 9 *}
eval math:  18.34
eval cond.: 18.34
value:      18.340000
Post Reply