Sea temperature Block

Post Reply
leonrossouw
Observer
Observer
Posts: 26
Joined: Tue Aug 22, 2017 6:33 am

Sea temperature Block

Post by leonrossouw » Sun Jan 08, 2023 6:01 am

The block seems broken ?
Any ideas on fixing it ?
2D76B386-02B0-4F7F-882C-7E21784A9E07.png
2D76B386-02B0-4F7F-882C-7E21784A9E07.png (54.13 KiB) Viewed 790 times

User avatar
Asobig
Advisor
Advisor
Posts: 72
Joined: Mon Aug 21, 2017 7:05 am
Location: Almere
Station model: Davis Vantage VP2+
Software: Meteobridge (Red)
Contact:

Re: Sea temperature Block

Post by Asobig » Mon Jan 09, 2023 3:29 pm

It seems that that they changed the output of the json-file, to make it work i changed the following things in the block:
Remove line 90 to 95, so this part:

Code: Select all

for($i=0;$i<count($data);$i++){
		$data[$i]['current'] = number_format(convertor($data[$i]['current'],"C",$displayTempUnits),1,".","");
		$data[$i]['thisMonthMax'] = number_format(convertor($data[$i]['thisMonthMax'],"C",$displayTempUnits),1,".","");
		$data[$i]['thisMonthAvg'] = number_format(convertor($data[$i]['thisMonthAvg'],"C",$displayTempUnits),1,".","");
		$data[$i]['thisMonthMin'] = number_format(convertor($data[$i]['thisMonthMin'],"C",$displayTempUnits),1,".","");
	}
Change line 117 from:

Code: Select all

<?php echo floor($data[$i]['current'])?>.<span style="font-size:0.6em"><?php echo number_format(($data[$i]['current'] - floor($data[$i]['current']))*10,0,".","")?>&nbsp;<?php echo unitFormatter($displayTempUnits)?></span>
To:

Code: Select all

<?php echo $data[$i]["current"];?>&nbsp;<?php echo unitFormatter($displayTempUnits)?></span>
Change lines 134 to 138, from:

Code: Select all

<td style="width:33%"><?php echo lang('maximumAbbr','c')?><br><?php echo floor($data[$i]['thisMonthMax'])?>.<span style="font-size:0.7em"><?php echo number_format(($data[$i]['thisMonthMax'] - floor($data[$i]['thisMonthMax']))*10,0,".","")?>&nbsp;<?php echo unitFormatter($displayTempUnits)?></span>
</td>
<td style="width:33%"><?php echo lang('avgAbbr','c')?><br><?php echo floor($data[$i]['thisMonthAvg'])?>.<span style="font-size:0.7em"><?php echo number_format(($data[$i]['thisMonthAvg'] - floor($data[$i]['thisMonthAvg']))*10,0,".","")?>&nbsp;<?php echo unitFormatter($displayTempUnits)?></span>
</td>
<td style="width:33%"><?php echo lang('minimumAbbr','c')?><br><?php echo floor($data[$i]['thisMonthMin'])?>.<span style="font-size:0.7em"><?php echo number_format(($data[$i]['thisMonthMin'] - floor($data[$i]['thisMonthMin']))*10,0,".","")?>&nbsp;<?php echo unitFormatter($displayTempUnits)?></span>
To:

Code: Select all

<td style="width:33%"><?php echo lang('maximumAbbr','c')?><br><?php echo $data[$i]['thisMonthMax']?>&nbsp;<?php echo unitFormatter($displayTempUnits)?></span>
</td>
<td style="width:33%"><?php echo lang('avgAbbr','c')?><br><?php echo $data[$i]['thisMonthAvg']?>&nbsp;<?php echo unitFormatter($displayTempUnits)?></span>
</td>
<td style="width:33%"><?php echo lang('minimumAbbr','c')?><br><?php echo $data[$i]['thisMonthMin']?>&nbsp;<?php echo unitFormatter($displayTempUnits)?></span>
</td>
I tested it only with Celsius!

leonrossouw
Observer
Observer
Posts: 26
Joined: Tue Aug 22, 2017 6:33 am

Re: Sea temperature Block

Post by leonrossouw » Tue Jan 10, 2023 12:56 pm

Thank you very much !
Works perfectly
:D
Regards,
Leon

Laglene
Observer
Observer
Posts: 30
Joined: Thu Nov 04, 2021 4:44 pm
Location: Galargues 34
Station model: Davis pro 2
Software: Weatherlink
Contact:

Re: Sea temperature Block

Post by Laglene » Wed Jan 11, 2023 9:24 am

Hello, I also had the same problem. Great, thanks to your explanations it works...
thanks a lot for your help
Image

alexvanuxem
Forecaster
Forecaster
Posts: 182
Joined: Mon Jan 31, 2022 4:41 pm
Location: Sint-Katelijne-Waver, Belgium
Station model: Davis Vantage Pro 2
Software: Meteobridge
Contact:

Re: Sea temperature Block

Post by alexvanuxem » Tue Jan 17, 2023 6:23 pm

thx it works, could you make an 'official' update block? @davidefa, thx!!!
Image

User avatar
cw3beck
Observer
Observer
Posts: 24
Joined: Sun Aug 20, 2017 5:48 pm
Location: Huntsville, AL
Station model: Davis Pro 2
Software: Weather Display
Contact:

Re: Sea temperature Block

Post by cw3beck » Wed Jan 18, 2023 1:08 am

Thanks! Worked for me as well. Cheers!

User avatar
MeteoElMasnou
Observer
Observer
Posts: 26
Joined: Sat Feb 05, 2022 1:56 pm
Location: El Masnou / Catalunya
Station model: Davis Vantage Vue
Software: Weewx
Contact:

Re: Sea temperature Block

Post by MeteoElMasnou » Fri Jan 27, 2023 4:51 pm

Hello,
I followed all the steps you indicate and I can't get it to work.

Could you post the modified seaTemperatureBlock.php file?

Thank you

User avatar
Asobig
Advisor
Advisor
Posts: 72
Joined: Mon Aug 21, 2017 7:05 am
Location: Almere
Station model: Davis Vantage VP2+
Software: Meteobridge (Red)
Contact:

Re: Sea temperature Block

Post by Asobig » Fri Jan 27, 2023 9:37 pm

Here is the (zipped) php file.
I hope it works:
https://www.asobig.com/uploads/seaTempe ... ck.php.zip

User avatar
MeteoElMasnou
Observer
Observer
Posts: 26
Joined: Sat Feb 05, 2022 1:56 pm
Location: El Masnou / Catalunya
Station model: Davis Vantage Vue
Software: Weewx
Contact:

Re: Sea temperature Block

Post by MeteoElMasnou » Thu Feb 02, 2023 9:28 am

Asobig wrote: Fri Jan 27, 2023 9:37 pm Here is the (zipped) php file.
I hope it works:
https://www.asobig.com/uploads/seaTempe ... ck.php.zip
Great, working.
Thank you

Post Reply