IndoorData is only updated every hour

Post Reply
ph2
Observer
Observer
Posts: 32
Joined: Fri Sep 25, 2020 4:54 pm
Location: Österreich / Weyregg
Station model: Davis Vantage Pro2
Software: Meteobridge

IndoorData is only updated every hour

Post by ph2 » Mon Mar 15, 2021 10:28 am

Hi!
Metoebridge and API: For two months now, the indoor data has only been written to the database once an hour and not every 5 minutes. The cron job runs every 5 minutes. When I check the echo output, I see that the DateTime timestamp remains unchanged for an hour. The unchanged values ​​are not written to the database either.
In the API plugin, the values ​​change every 10 seconds. And the file meteotemplateLive.txt is rewritten every minute with the correct new UTC time stamp.
Where can I set the data to be saved every 5 minutes?
Greetings Harald

davidefa
Expert
Expert
Posts: 862
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: IndoorData is only updated every hour

Post by davidefa » Sun Mar 21, 2021 10:19 pm

I don't understand completely your question. So a few questions:
a) if you check your database extra sensor data are present only at 1 hour intervals?
b) the apiViewer Plugin updates every 10 seconds?
c) the file meteotemplateLive.txt is written every minute?
d) what are the extra sensor data that should be written to the database ( Tin, Hin... )?
e) in the post title you are referring to indoorData so you are particularly interested to Tin and Hin?
f) what is the url of your site?
Image

ph2
Observer
Observer
Posts: 32
Joined: Fri Sep 25, 2020 4:54 pm
Location: Österreich / Weyregg
Station model: Davis Vantage Pro2
Software: Meteobridge

Re: IndoorData is only updated every hour

Post by ph2 » Mon Mar 22, 2021 8:38 am

Thanks for the feedback. My answers as inlay:
I don't understand completely your question. So a few questions:

a) if you check your database extra sensor data are present only at 1 hour intervals?
Yes, in the indoor database only once every hour, in the alldataExtra database (with humidity, temperature indoor and extra sensor T1 (water temperature)) every 5 minutes
b) the apiViewer Plugin updates every 10 seconds?
Yes, every 10 seconds
c) the file meteotemplateLive.txt is written every minute?
Yes, every minute
d) what are the extra sensor data that should be written to the database ( Tin, Hin... )?
Humidity, temperature
e) in the post title you are referring to indoorData so you are particularly interested to Tin and Hin?
Yes, humidity, temperature indoor
f) what is the url of your site?
I'm still testing, the site is not yet official: https://www.pallausch.at/stw-wetter/tem ... esktop.php

The change took place on 1/19/21, 5:44 pm: previously the data was written to the database every 5 minutes, since then only every hour. I don't remember changing anything.

Greetings Harald

davidefa
Expert
Expert
Posts: 862
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: IndoorData is only updated every hour

Post by davidefa » Mon Mar 22, 2021 3:28 pm

The indoor table is written by the load/crons/updateIndoor.php.
You should have a cron job that call load/cron.php ( that in turns calls all the scripts in the directory load/crons )
Maybe you changed the timing of this cron job. So you have only to verify that the cron job is called every 5 minutes or less.

You may even remove that script if you install the modified indoorData and degreeDays plugin I posted some while ago.
Image

ph2
Observer
Observer
Posts: 32
Joined: Fri Sep 25, 2020 4:54 pm
Location: Österreich / Weyregg
Station model: Davis Vantage Pro2
Software: Meteobridge

Re: IndoorData is only updated every hour

Post by ph2 » Mon Mar 22, 2021 4:28 pm

Thank you I know. The cron job runs every 5 minutes! As already written: When I check the echo output of the cronjob, I see that the DateTime timestamp remains unchanged for an hour. This means that the same time stamp is always entered for about an hour. And if the timestamp does not change, no new entry is made in the database.

For example:
Cronjob from 3/19/21, 00:25:00: "Loaded CRON: /xxx/template/load/crons/dailyNotificationsCron.php <br> Indoor save interval elapsed. <br> Indoor conditions being saved. <br> Using API. <br> Executed query: INSERT INTO indoor (DateTime, Tin, Hin) VALUES ('2021-03-19 00:04', 5,72) <br> Loaded CRON: / xxx / template / load / crons /updateIndoor.php <br> "

5 minutes later:
Cronjob from 3/19/21, 00:30:00: "Loaded CRON: /xxx/template/load/crons/dailyNotificationsCron.php <br> Indoor save interval elapsed. <br> Indoor conditions being saved. <br> Using API. <br> Executed query: INSERT INTO indoor (DateTime, Tin, Hin) VALUES ('2021-03-19 00:04', 5,72) <br> Loaded CRON: / xxx / template / load / crons /updateIndoor.php <br> "
The same timestamp in both jobs !!
Greetings Harald

davidefa
Expert
Expert
Posts: 862
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: IndoorData is only updated every hour

Post by davidefa » Mon Mar 22, 2021 5:41 pm

Ok, I see
I don't know if this is important, but you have a form of caching enabled, server side.
For example I'm reloading your page:
https://www.pallausch.at/stw-wetter/tem ... teLive.txt
And I get the same result ( nothing changes, no matter how many times I repeat or how long I wait )
Have to change the url to update the page ( for example adding aaaa at the end: https://www.pallausch.at/stw-wetter/tem ... e.txt?aaaa )
But if this is the problem, you should see similar misbehaviour in all blocks/plugins that use meteotemplateLive.txt
Image

ph2
Observer
Observer
Posts: 32
Joined: Fri Sep 25, 2020 4:54 pm
Location: Österreich / Weyregg
Station model: Davis Vantage Pro2
Software: Meteobridge

Re: IndoorData is only updated every hour

Post by ph2 » Wed Apr 07, 2021 9:52 am

Hello!
Thanks for the tip, it helped! Some time ago my provider set up a varnish cache that cannot be turned off. I have now set up an additional cron job with curl -X PURGE, and since then it has been updated every 5 minutes!
greetings

Post Reply