Page 1 of 1

Rain block

Posted: Wed Jul 28, 2021 7:14 am
by bengtdg
Hi
Having issues with the rain block.
It only shows rain today.

This month and This year is always zero
Block version 7.1

Weather station netatmo

Bengt

Re: Rain block

Posted: Wed Jul 28, 2021 8:52 am
by davidefa
- do other block report rain data correctly ( for example block station data )?
- do graphs show past rain data correctly ( which is equivalent to previous question and should verify that rain data is correctly saved in database )?
- when did you start weather data recording in meteotemplate

Please post a link to your site

Re: Rain block

Posted: Wed Jul 28, 2021 9:09 am
by bengtdg
Link: https://selevaret.casadelsele.com/meteo/

Started collecting data sinse mid april this year.

Now i see that block station data also shows 0 mm when selecting month or year

Bengt

Re: Rain block

Posted: Wed Jul 28, 2021 10:25 am
by bengtdg
Found the fix

ran this command:
SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));

I had problem with the interactive graph as well, both solved:)

Re: Rain block

Posted: Fri Nov 10, 2023 7:32 am
by djpoppy
I have the same problem. Where should I run the command? In this console?

Re: Rain block

Posted: Sat Nov 11, 2023 11:59 am
by davidefa
Yes, you can do it from the Sql tab, or in the Variables tab you should be able to edit the sql_mode variable directly

Re: Rain block

Posted: Sat Nov 11, 2023 12:43 pm
by djpoppy
Sorry but I've never edited on SQL. Is this one? What should I enter or change?

Re: Rain block

Posted: Sat Nov 11, 2023 1:39 pm
by davidefa
Simply remove the

Code: Select all

ONLY_FULL_GROUP_BY,
at the beginning

Re: Rain block

Posted: Sat Nov 11, 2023 2:39 pm
by djpoppy
It gives me an error when modifying the sqlmode database because I don't have super privileges even if the database is mine :( :?:

Re: Rain block

Posted: Sat Nov 11, 2023 9:17 pm
by davidefa
You still have a few options:
- verify in the control panel of your hosting provider if you have any 'database setting options' to disable the only_full_group_by flag ( a mysql.ini editor or the like )
- verify in the control panel of your hosting provider if you can change the 'sql version' ( in mysql that option is enabled by default starting from ver 5.7, in mariaDb is disabled )
- you could add the following to your config.php script near line 15 ( after line beginning with '$con =' ). I used in my aruba domain which has the same problem, and it seems working.

Code: Select all

mysqli_query($con,"SET SESSION sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''))");
( if you run the 'main configuration script' and click the save button, you will need to reenter this mod )

Re: Rain block

Posted: Sun Nov 12, 2023 7:47 am
by djpoppy
@davidefa I have to thank you again... I used the "third method" you listed.
I have a TopHost domain and had the same problem.
Now it seems to work. I have to remember that if I make changes in the main configuration I have to go and edit the config.php file again.
My php version is 7.4.