Page 1 of 1
Change image depending on weather?
Posted: Fri 13 May 2011 9:27 pm
by nbr_uk
Is it possible to change the image displayed in the bottom left corner of the generated webpage to reflect the current conditions? For example show a sunny scene when warm, rainy when wet etc?
I replaced the image with one of my weather station in the snow but it looks a bit naff in summer!
I suppose I could setup a webcam to capture to a still and save it to the directory but it wouldn't have the soft filter round the edge and would probably end up getting a shot of my wife hanging out the washing or my cat having a dump so would rather set a predefined image for a weather condition.
Any ideas?
Re: Change image depending on weather?
Posted: Sat 14 May 2011 9:50 am
by steve
You could possibly use javascript to change the background image depending on a particular item, e.g. if you had a solar sensor you could use the <#IsSunny> web tag:
Code: Select all
<script language="JavaScript">
if (<#IsSunny> = "1")
{ document.body.background = "sunny.jpg"}
else
{ document.body.background = "cloudy.jpg"}
</script>
Note that I haven't tried this!
Re: Change image depending on weather?
Posted: Sat 14 May 2011 2:21 pm
by ColinJS
If you would be OK with a seasonal display, you could try (similar to the day/night question a while back):
document.body.background = "month<#month>.jpg", with twelve images, "month01.jpg" etc.
Unfortunately there is no 'current conditions' webtag, except the one you put in yourself, which would be text I guess. You could use the forecast one <#forecastnumber>, but then you'd need 28 different photos.
I haven't tried this either, but it looks like it should work. I should try it, my page also still shows snow!
HTH,
Colin
Re: Change image depending on weather?
Posted: Sat 14 May 2011 5:13 pm
by robynfali
Colin
Just been looking through your page, and found the setup area
7th Apr: Upgraded to Cumulus 1.9.1. Documentation doesn't really describe what to do, but an entry on the forum said just to backup and load over old version. Wasn't sure what to do with the 'HTML' option. Let it install in case there are new things to consider and after install, copied *t.htm back over the newly installed versions (after copying, of course!).
When you install an updated cumulus, if you have any personalised pages you should UNTICK the HTML option, as it will overwrite your exisiting pages replacing them with originals.
Re: Change image depending on weather?
Posted: Sat 14 May 2011 5:34 pm
by steve
7th Apr: Upgraded to Cumulus 1.9.1. Documentation doesn't really describe what to do
The readme.txt says:
"Upgrading:
If you are upgrading from a previous version, you can install
this version over the top of these (just run the setup.exe).
Your data files will be saved (you should take backups
before upgrading to be safe). "
The FAQ says:
"How do I upgrade to a new release?
Back up your data, and run the new setup. Occasionally, there may be actions you need to perform before or after the upgrade - these will be documented in the readme.txt file."
I'll update the FAQ to mention the 'install HTML files' option. Someone might read it, you never know.
Re: Change image depending on weather?
Posted: Sat 14 May 2011 5:40 pm
by robynfali
steve wrote:
I'll update the FAQ to mention the 'install HTML files' option. Someone might read it, you never know.

Re: Change image depending on weather?
Posted: Sat 14 May 2011 6:12 pm
by nbr_uk
Thanks for the responses - going to give the suggestions a try when I get back off holiday!
Re: Change image depending on weather?
Posted: Sat 14 May 2011 6:52 pm
by ColinJS
Thanks for pointing out the documentation stuff. I tend to rely on backups rather heavily, somewhat paranoid about making them, so might as well use them. I seem to remember not seeing anything leaping out from whatever page I was reading, so let it install, knowing I would be able to recover my customisation afterwards. Worked fine.
Cheers,
Colin
Re: Change image depending on weather?
Posted: Wed 18 May 2011 2:30 pm
by MickinMoulden
nbr_uk wrote:Is it possible to change the image displayed in the bottom left corner of the generated webpage to reflect the current conditions? For example show a sunny scene when warm, rainy when wet etc?
I replaced the image with one of my weather station in the snow but it looks a bit naff in summer!
I suppose I could setup a webcam to capture to a still and save it to the directory but it wouldn't have the soft filter round the edge and would probably end up getting a shot of my wife hanging out the washing or my cat having a dump so would rather set a predefined image for a weather condition.
Any ideas?
I don't have a background image, but I do have 6 images that change depending on the weather. It's all done in HTML using a combination of webtags. You should be able to do the same thing for the background image, however you will need to upload the weatherstyle.css every time.
Re: Change image depending on weather?
Posted: Wed 18 May 2011 11:35 pm
by beteljuice
... You should be able to do the same thing for the background image, however you will need to upload the weatherstyle.css every time.
Nope ....
You could use the document.body mentioned earlier, but a better way would be to 'add' to the css as described here:
https://cumulus.hosiene.co.uk/viewtopic.php?f=14&t=1657
Re: Change image depending on weather?
Posted: Thu 19 May 2011 2:44 am
by MickinMoulden
beteljuice wrote:... You should be able to do the same thing for the background image, however you will need to upload the weatherstyle.css every time.
Nope ....
You could use the document.body mentioned earlier, but a better way would be to 'add' to the css as described here:
https://cumulus.hosiene.co.uk/viewtopic.php?f=14&t=1657
ah...yes you can....
where it has
Code: Select all
@charset "UTF-8";
body {
background:#FFFFFF url('images/picture.jpg') no-repeat fixed left bottom; font-family: Verdana, Helvetica, sans-serif;
font-size: 10pt;
color: #585858;
text-align: left;
you could change
to
Code: Select all
('images/temp<#HighTempAlarm><#LowTempAlarm>.jpg)
. Done. And this is just 1 of many examples or combinations you could use. Get creative.
For this simple example you would only need 3 pictures. I have combinations up around 25. So I know it can be done.
You learn something every day hey.

Re: Change image depending on weather?
Posted: Thu 19 May 2011 3:27 am
by beteljuice
I didn't mean it wasn't possible

- just that it's extra baggage to process and upload weatherstyles.css when you can do a couple of lines override in your xxxxT.htm files
