WMR200 - solar in a jar possible?

This is intended for WMR100, WMR200, WMRS200 and RMS300 specific topics

Moderator: Mattk

Post Reply
User avatar
WS Grave
Expert Boarder
Expert Boarder
Posts: 103
Joined: Fri Oct 30, 2009 3:42 pm
Location: Grave - the Netherlands
Contact:

WMR200 - solar in a jar possible?

Post by WS Grave »

1) Does Meteohub support solar (w/m2) for the WMR200?
Is it possible with the Meteohub to calculate the solar with help of a selfmade "solar in a jar"? Or maybe this is something for the future?

2) I have a WMR200, with UV-sensor and 2 extra temp/hum sensors. Does WMR200 support other sensors like a solar sensor?
skyewright
Platinum Boarder
Platinum Boarder
Posts: 873
Joined: Fri Jan 25, 2008 6:27 pm
Location: Isle of Skye, Scotland

Re:WMR200 - solar in a jar possible?

Post by skyewright »

Taking your questions in reverse order...
WS Grave wrote:2) I have a WMR200, with UV-sensor and 2 extra temp/hum sensors. Does WMR200 support other sensors like a solar sensor?
There isn't a solar sensor for the WMR200.
1) Does Meteohub support solar (w/m2) for the WMR200?
Is it possible with the Meteohub to calculate the solar with help of a selfmade "solar in a jar"?
It would be possible to use or adapt a WMR200 extra sensor for "temp in a jar", but:

a) You'd then need a bit of simple extra maths to conver that into a percentage cloud cover.

b) You'd need a lot of failrly complex maths to convert that percentage into a (very approximate) w/m2 equivalent. The maths would involve latitude, and longitude plus the date and time of day.

c) The WMR200 extra sensors are quite large so they are not ideal for the purpose (OS don't seem to have produced a WMR200 compatible equivalent to the THC238, which has a small temp probe on a 3m wire yet). With the standard extra temp/hum sensor you need a big jar to get them in (and the smaller the jar the better "temp in a jar" works) and they have a substantial thermal mass which puts a big lag into the system.

To handle a) you could either use php as StratoQ did, or you can do it inside Meteohub as I do using a combination of a html template and a custom "plug-in" that I wrote. If you wanted to try the same thing I could let you have the details.

Handling b) is beyond anything I have time to research or try - and I know that there are some people who consider the resulting w/m2 is so 'approximate' that they feel the exercise not worth while anyway.

It may be possible to improve on c) if you are willing to start pulling an extra sensor to pieces and adapting it! I've seen (on Weather-Watch) descriptions of cases where people have put a different sensor in place of the standard temp or humidity one.

Just a few thoughts...
User avatar
WS Grave
Expert Boarder
Expert Boarder
Posts: 103
Joined: Fri Oct 30, 2009 3:42 pm
Location: Grave - the Netherlands
Contact:

Re:WMR200 - solar in a jar possible?

Post by WS Grave »

skyewright wrote:To handle a) you could either use php as StratoQ did, or you can do it inside Meteohub as I do using a combination of a html template and a custom "plug-in" that I wrote. If you wanted to try the same thing I could let you have the details.
That would be nice Skyewright.
I'm always in to try something new :)
skyewright
Platinum Boarder
Platinum Boarder
Posts: 873
Joined: Fri Jan 25, 2008 6:27 pm
Location: Isle of Skye, Scotland

Re:WMR200 - solar in a jar possible?

Post by skyewright »

WS Grave wrote:That would be nice Skyewright.
I'm always in to try something new :)
I've not forgotten this, it's just taking a while to find the time to get my notes together...
skyewright
Platinum Boarder
Platinum Boarder
Posts: 873
Joined: Fri Jan 25, 2008 6:27 pm
Location: Isle of Skye, Scotland

Re:WMR200 - solar in a jar possible?

Post by skyewright »

skyewright wrote:I've not forgotten this, it's just taking a while to find the time to get my notes together...
And now I've thought of a possibly neater (i.e. easier for you to install, less writes to disk, and faster updates) way to achieve the effect using a recently added feature of Meteohub (the new "no date range" behaviour for the logging protocol) so I'd like to give that a try first.
More news when I get a chance to try that out...
Yveau
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: Fri May 22, 2009 1:23 pm
Location: Tilburg, NL
Contact:

Re:WMR200 - solar in a jar possible?

Post by Yveau »

Hi,

I'm more than interested in this matter and would be very glad to help achieving it. Let me know if I can be of any help !

Gr,
Yveau
skyewright
Platinum Boarder
Platinum Boarder
Posts: 873
Joined: Fri Jan 25, 2008 6:27 pm
Location: Isle of Skye, Scotland

Re:WMR200 - solar in a jar possible?

Post by skyewright »

Yveau wrote:I'm more than interested in this matter and would be very glad to help achieving it.
I had time to try out my idea, but haven't yet had time to write it up.

In essence I have a small C/C++ application that every 30 seconds makes a http call that reads a Meteohub HTML template. The template uses values from other sensors plus the maths that templates allow to produce text that defines plug-in sensors, that text is then passed to the Meteohub plugin interface.


Using that approach it is easy to have sensors that are the difference in temp between two other sensors (which is what solar in a jar is interested in), and it's also possible to convert the temp difference into a percentage based on some user determined difference that represents 100% clear.

So the html template code is:

t0 {math- [actual_t8_temp_c*] [actual_th20_temp_c*]}
data0 {math* [actual_t10_temp_c] 400}
data1 {math* [actual_t10_temp_c] -6250}

N.B. The plug-in's t0 is assigned in Meteohub to sensor t10, so data0 and data1 are calculated from the temp difference set in the previous cycle.

What's passed to Meteohub is something like:

t0 -2.00
data0 -80.00
data1 1250.00


Which meteohub sees as -0.2, -0.8 and 12.5 (it's late afternoon and very overcast!).

In 'normal' conditions, during daylight hours data0 is a positive value and represents the estimated percentage of day time clear sky (25 C is 100%), and during night time hours data1 is a positive value and represents the estimated percentage of night time clear sky (1.6 C is 100%).

I have a Meteohub graph that plots data0 and data1. I have the baseline of the graph set to 0, so the negative values that occur in the "wrong half of the day" for the solar and night time sensors doesn't show.

There is a change over period either side of sunset, but there is not a lot that can be done about that.

Actually my template has more than the above as I also use the plug-in to maintain values that represent the temp difference between different parts of the house as part of a study of insulation performance.

For someone else to use an equivalent plug-in they'd need to a copy of the source code which they could put on their Meteohub, then they'd need to install libcurl, then build the plug-in. They'd also need a suitable html template (mine could be used as a starting point). I haven't had time to write up how to go about copying the code, installing libcurl and building the plug-in. Some people may not need any notes on how to do that - does that apply to anyone who's interested in trying out the idea?
skyewright
Platinum Boarder
Platinum Boarder
Posts: 873
Joined: Fri Jan 25, 2008 6:27 pm
Location: Isle of Skye, Scotland

Re:WMR200 - solar in a jar possible?

Post by skyewright »

skyewright wrote:I've not forgotten this, it's just taking a while to find the time to get my notes together...
If this is still of interest after this very long time...

I've now implemeted my "templateecho" plug-in as a perl script instead of in c++, this simplifies giving instructions for anyone else to install it!

What it does is to do make a meteohtml.cgi call every 30 seconds for a template file called templateecho.html in your meteohub's graphs folder.

That template can refer to other meteohub sensors and do "template maths" with those values, e.g.

I use

t0 {math- [actual_t8_temp_c*] [actual_th20_temp_c*]}

to log a "solar difference" temparature (t20 is my main outdoor temperature, and t8 is my 'solar jar' temperature)

The plug-in feeds the returned text from the template to Meteohub as plug-in data. So with the above line on the sensors page I see a t0 that I can then assign. I assign it to t10.

Taking things a stage further it's possible to use t10 in templateecho.html aswell to calculate a solar percentage based on an assumption about the temperature difference for a 100% clear sky at noon, e.g.


data0 {math* [actual_t10_temp_c] 286}

is what I'd use if a noon clear sky produced a temp difference of 35C (286 is 10000/35)

At night my jar is 2.0C cooler than t20 if the sky is totally clear, so using

data1 {math* [actual_t10_temp_c] -5000}

I can get a night time sky percentage too (-10,000/2.0)

You may see other uses for the technique...

I've attached the perl script, and a sample templateecho.html

Before you can use templateecho.pl you need to install an extra feature to allow the script to make a http call.

At SSH in meteohub type:

perl -MCPAN -e shell

Say 'no' to manual configuration, then at the

>cpan prompt:

install LWP::UserAgent

If the process identifies other things (unsatisfied dependencies) that
it needs to download , answer 'yes'. This might happen more than once.

After that is complete (i.e. you get back to the cpan prompt, type 'exit' to leave the cpan shell

Almost there now.

Copy the file templateecho.pl file on to your Meteohub, e.g. into

/srv/www/myweb

Create a templateecho.html file in the graphs folder on your Meteohub

You can then test the script in the SSH console moving to /srv/www/myweb then typing

./cc128.pl

No errors should be reported.

After a minute you should see the output from your html file, e.g.

t0 170

If you see something like that, use [Ctrl]C to stop the script.

Then you can set up a plug-in entry in the Weather Station section of Meteohub.

When setting up the plug-in, the Plug-in path would be

/srv/www/myweb/templateecho.pl

I hope that all makes sense (and is of interest to someone). :) [file name=templateecho.zip size=925]http://www.meteohub.de/joomla/images/fb ... teecho.zip[/file]
Yveau
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: Fri May 22, 2009 1:23 pm
Location: Tilburg, NL
Contact:

Re:WMR200 - solar in a jar possible?

Post by Yveau »

Thanks skyewright ! I'm going to try to implement your idea. Makes perfect sense ... hope I get it installed ...

Gr,
Yveau
User avatar
WS Grave
Expert Boarder
Expert Boarder
Posts: 103
Joined: Fri Oct 30, 2009 3:42 pm
Location: Grave - the Netherlands
Contact:

Re:WMR200 - solar in a jar possible?

Post by WS Grave »

Hi Yveau (and Skyewright ofcourse),

Please let us know if you manage to install this and get it working?
xor
Fresh Boarder
Fresh Boarder
Posts: 9
Joined: Sat Jan 08, 2011 11:49 pm
Location: russia, rostov-on-don
Contact:

Re: WMR200 - solar in a jar possible?

Post by xor »

Image
Image
Image
Post Reply