Page 3 of 4

Re: Customising the local dashboard

Posted: Sun 28 Mar 2021 12:21 pm
by odintheterrible
You are absolutely right I was referring to the web page/interface and not the dashboard. For the senility of old age, I apologise unreservedly LOL

Re: Customising the local dashboard

Posted: Mon 29 Mar 2021 9:31 am
by odintheterrible
I've been looking at the output from the GW1000 and the dasboard from the Brandson 304577 and there does appear to be some variation on certain of the readings at some points in time.
However, more importantly, since migrating away from the old index.htm to the new json based system, some of what I consider to be important data has been excluded. Prime example of this is the UVI data. In the new system, it has been decided to exclude the UV INDEX and only show the SOLAR RADIATION (W/m2 ... watt per square meter). Whilst this may be the unit it of choice for the purists, for the man in the street who tend to view this data (displayed on our holiday apartment web site by way of example) find the UV Index to be far more relevant and of use as it is an instantly recognisable guide. I absolutely guarantee that if you asked the average holiday maker, they would have absolutely no idea what watt per square meter meant to them. The UVI is an instantly recognisable guide.

I would therefore be interested to know if it's possible to replace the watt per square meter reading on the index.htm with the UV Index reading? The data is there, as reference the desktop, but I'm not up to speed with this json stuff so some guidance would be appreciated. Thanks

Re: Customising the local dashboard

Posted: Mon 29 Mar 2021 11:18 am
by mcrossley
UV-I is on the to-do list for the new web site.

Re: Customising the local dashboard

Posted: Mon 29 Mar 2021 3:15 pm
by odintheterrible
mcrossley wrote: Mon 29 Mar 2021 11:18 am UV-I is on the to-do list for the new web site.
Thanks for the heads up

Re: Customising the local dashboard

Posted: Thu 01 Apr 2021 4:44 pm
by hornychz
mcrossley wrote: Mon 29 Mar 2021 11:18 am UV-I is on the to-do list for the new web site.
Super, I have tried it since yesterday, but have nothing on my web...
(The file solardata.json on my web contains UV data.)

My code:

Code: Select all

<tr>
	<td colspan="4" class="w3-theme-d1">Solar</td>
</tr>
<tr class="w3-theme-l6 w3-hide" data-cmx-solar>
	<td>Solar Radiation (SP440):</td>
	<td><span data-cmxdata="SolarRad"></span>&nbsp;W/m&sup2;</td>
	<td>Evapotranspiration Today</td>
	<td><span data-cmxdata="ET"></span>&nbsp;<span data-cmxdata="rainunit"></span></td>
</tr>
<tr class="w3-theme-l6" data-solardata>
	<td>UV Index (RK200-07):</td>
	<td><span data-cmxdata="UV"></span></td>
	<td>Is sunny now?</td>
	<td>
		<script>
	$Sunny = (<span data-cmxdata="IsSunny"></span>);
	if( $Sunny == 1 ) {
	echo "Yes";
	else echo "No";
	}
	</script>
	</td>
</tr>
Best Regards
Zdenek

Re: Customising the local dashboard

Posted: Fri 02 Apr 2021 4:56 am
by Ned
I was happy to see AndyK’s customised dashboard showing the moon phases (missed that since Cumulus 1) so i thought I’d try his new index.html along with the newgrid.css.

Unfortunately my installation does not find moon.png (located in the web folder under CumulusMX) while index.html is installed in the interface folder.

I know nothing about html programming, but tried modifying the image path in index.html to
<p><img id="Moon" <img src="../web/moon.png" but no joy there.

The dashboard displays an image if located in the interface folder or a folder under that (with path modification) but I cannot make it work if located anywhere else.

Can anyone see what I’m doing wrong?
Cheers!

Re: Customising the local dashboard

Posted: Fri 02 Apr 2021 7:04 am
by AndyKF650
Hi Ned

You are correct that the moon.png file is maintained in the web folder and that for the moon to display on the local desktop it needs to be in the interface folder. My work around for this was to setup a cron job to copy the "web folder" moon to the "interface folder" every 3 hours.

Assuming that you are running CMX on a raspberry pi the terminal instruction is as follows 0 */3 * * * cp CumulusMX/web/Moon.png CumulusMX/interface

There is loads of support on the net to assist with setting up cron jobs

To get the moon.png onto the desktop I used the following script <p><img id = "Moon" ,img src = "moon.png">

Re: Customising the local dashboard

Posted: Fri 02 Apr 2021 7:24 am
by Ned
Thanks AndyK, but I'm lost already with 'cron jobs'
I had a quick google, is is correct that they run in Unix systems and not Windows? (all I have....)

Re: Customising the local dashboard

Posted: Fri 02 Apr 2021 7:30 am
by freddie
AndyKF650 wrote: Fri 02 Apr 2021 7:04 amMy work around for this was to setup a cron job to copy the "web folder" moon to the "interface folder"
Why not just use the "extra files" settings provided by MX?

Re: Customising the local dashboard

Posted: Fri 02 Apr 2021 7:46 am
by AndyKF650
Since my use is for the local desktop only I think the "extra web files" in settings will not help me out. Maybe my customisation has hidden the "extra files" function!
I might just have to dig around and see if I can find my error!

Re: Customising the local dashboard

Posted: Fri 02 Apr 2021 7:56 am
by freddie
AndyKF650 wrote: Fri 02 Apr 2021 7:46 am Since my use is for the local desktop only I think the "extra web files" in settings will not help me out. Maybe my customisation has hidden the "extra files" function!
I might just have to dig around and see if I can find my error!
You can (and I do) use extra files for local copies. I'm on my phone right now so can't give you a screenshot. But it is definitely do-able.

Re: Customising the local dashboard

Posted: Fri 02 Apr 2021 8:31 am
by hornychz
mcrossley wrote: Mon 29 Mar 2021 11:18 am UV-I is on the to-do list for the new web site.
Hello, now it is working for me...

1) I added the 2 tags into ./CumulusMX/web/websitedataT.json
"UV":"<#UV>";
"IsSunny":"<#IsSunny>";

2) Corrected the code in ./CumulusMX/webfiles/idex.htm

Code: Select all

<tr>
	<td colspan="4" class="w3-theme-d1">Solar</td>
</tr>
<tr class="w3-theme-l6 w3-hide" data-cmx-solar>
	<td>Solar Radiation (SP440):</td>
	<td><span data-cmxdata="SolarRad"></span>&nbsp;W/m&sup2;</td>
	<td>Evapotranspiration Today</td>
	<td><span data-cmxdata="ET"></span>&nbsp;<span data-cmxdata="rainunit"></span></td>
</tr>
<tr class="w3-theme-l6" data-cmx-solar>
	<td>UV Index (RK200-07):</td>
	<td><span data-cmxdata="UV"></span></td>
	<td>Is sunny now?</td>
		<?php 
		$Sunny = '<span data-cmxdata="IsSunny"></span>';
		?>
	<td><?php if( $Sunny == 1 ) echo "Yes"; else{echo "No";}?></td>
</tr>
3) Results: the UVI is shown, but "IsSunny" (=No) not -> probably my PHP code is still wrong...

Image

Re: Customising the local dashboard

Posted: Fri 02 Apr 2021 10:38 am
by hornychz
It resolved all -> renamed index.htm to index.php and all is working...
UVI-new.jpg

Re: Customising the local dashboard

Posted: Mon 05 Apr 2021 11:38 pm
by Ned
I was able to get the dashboard in Windows to show the current moon image just by making a batch file to copy moon.png between folders and then using Windows Task Scheduler to run the bat file every hour. All that is needed now is a page refresh from time to time.
All good, thanks!

Re: Customising the local dashboard

Posted: Tue 06 Apr 2021 5:26 am
by freddie
Ned wrote: Mon 05 Apr 2021 11:38 pm I was able to get the dashboard in Windows to show the current moon image just by making a batch file to copy moon.png between folders and then using Windows Task Scheduler to run the bat file every hour. All that is needed now is a page refresh from time to time.
All good, thanks!
You could've done that with the extra files settings in MX itself.