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]