Extra Sensors in Block StationData

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

Re: Extra Sensors in Block StationData

Post by davidefa » Mon Jun 27, 2022 11:07 am

No, did not correct anything.
The problem arose when I added the support for extrasensor.
I added a few bugs when 'rationalizing the block'.
Moreover the simplified method I used to extract main sensor and extrasensor data ( from 2 different database tables ) has a 'couple of weakness':
1) when dealing with extrasensor data that has a different sampling/recording interval than main sensor data ( ex: 10 minutes for extrasensor and 5 minutes for main sensors )
2) when dealing with main sensor/extrasensor data that has a varying sampling/recording interval ( ex: part of the data are recorded at 10 minutes interval, part at 5 minutes interval, this may happen when importing old data which has a different recording interval )
3) when dealing with extrasensor data that has a reduced 'time coverage' respect to main sensor data
It should be fixed in the next revision ( in the next days ).

NOTE
Point 2) need to be fixed also by uniforming the recording interval
Image

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: Extra Sensors in Block StationData

Post by MeteoElMasnou » Mon Jun 27, 2022 1:01 pm

Thanks Davidefa for the clarification.

We will be attentive to new versions.

Regards

User avatar
BONSAI
Observer
Observer
Posts: 35
Joined: Sat Sep 23, 2017 10:59 am
Location: San Sebastian
Station model: Davis Vantage Pro2 Plus
Software: Meteobridge
Contact:

Re: Extra Sensors in Block StationData

Post by BONSAI » Sat Jul 23, 2022 11:05 pm

Hello everyone.

I have updated this block and I can't find the icons of CO2, PM2.5, PM10 .... in which folder in the template are they saved?

Thank you

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: Extra Sensors in Block StationData

Post by MeteoElMasnou » Sun Jul 24, 2022 5:28 am

davidefa wrote: Mon Jun 27, 2022 11:07 am No, did not correct anything.
The problem arose when I added the support for extrasensor.
I added a few bugs when 'rationalizing the block'.
Moreover the simplified method I used to extract main sensor and extrasensor data ( from 2 different database tables ) has a 'couple of weakness':
1) when dealing with extrasensor data that has a different sampling/recording interval than main sensor data ( ex: 10 minutes for extrasensor and 5 minutes for main sensors )
2) when dealing with main sensor/extrasensor data that has a varying sampling/recording interval ( ex: part of the data are recorded at 10 minutes interval, part at 5 minutes interval, this may happen when importing old data which has a different recording interval )
3) when dealing with extrasensor data that has a reduced 'time coverage' respect to main sensor data
It should be fixed in the next revision ( in the next days ).

NOTE
Point 2) need to be fixed also by uniforming the recording interval
Hello David,
Has there been any progress in the results of this block?

Thank you

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

Re: Extra Sensors in Block StationData

Post by davidefa » Sun Jul 24, 2022 8:26 am

BONSAI wrote: Sat Jul 23, 2022 11:05 pm Hello everyone.

I have updated this block and I can't find the icons of CO2, PM2.5, PM10 .... in which folder in the template are they saved?

Thank you
Please zip your stationData block directory so I can take a look ( with your configuration )
The icons are the 'mt-icons' you can find them in http://meteodonostia.es/frog/css/font/i ... rence.html

P.S.
I think your CO_2 sensor should be named CO2_1, see the wiki
( but this has nothing to do with your 'icon problem' that should be related to some 'configuration naming' issue )
Attachments
co2_01.png
co2_01.png (33.26 KiB) Viewed 2889 times
Image

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

Re: Extra Sensors in Block StationData

Post by davidefa » Sun Jul 24, 2022 8:28 am

MeteoElMasnou wrote: Sun Jul 24, 2022 5:28 am Hello David,
Has there been any progress in the results of this block?

Thank you
Sorry still working on it...
Image

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: Extra Sensors in Block StationData

Post by MeteoElMasnou » Sun Jul 24, 2022 9:51 am

davidefa wrote: Sun Jul 24, 2022 8:28 am
MeteoElMasnou wrote: Sun Jul 24, 2022 5:28 am Hello David,
Has there been any progress in the results of this block?

Thank you
Sorry still working on it...
No problem.

Thank you very much for trying

Regards

User avatar
BONSAI
Observer
Observer
Posts: 35
Joined: Sat Sep 23, 2017 10:59 am
Location: San Sebastian
Station model: Davis Vantage Pro2 Plus
Software: Meteobridge
Contact:

Re: Extra Sensors in Block StationData

Post by BONSAI » Sun Jul 24, 2022 8:41 pm

davidefa wrote: Sun Jul 24, 2022 8:26 am
BONSAI wrote: Sat Jul 23, 2022 11:05 pm Hello everyone.

I have updated this block and I can't find the icons of CO2, PM2.5, PM10 .... in which folder in the template are they saved?

Thank you
Please zip your stationData block directory so I can take a look ( with your configuration )
The icons are the 'mt-icons' you can find them in http://meteodonostia.es/frog/css/font/i ... rence.html

P.S.
I think your CO_2 sensor should be named CO2_1, see the wiki
( but this has nothing to do with your 'icon problem' that should be related to some 'configuration naming' issue )
Thank you very much David. You are a perfect companion. Always fast and very attentive.

I understand that you want me to send you a zip of my stationData block. If so, tell me how can I send it to you?

Thanks again

User avatar
BONSAI
Observer
Observer
Posts: 35
Joined: Sat Sep 23, 2017 10:59 am
Location: San Sebastian
Station model: Davis Vantage Pro2 Plus
Software: Meteobridge
Contact:

Re: Extra Sensors in Block StationData

Post by BONSAI » Sun Jul 24, 2022 9:00 pm

But I have problems with pm10, pm2.5 (don’t have) and co2 icons. I cant see this icons. Only can see the 1h icon.

if (($par == "TIN") || ($par == "T"))
{return "mticon-temp";}
if (($par == "HIN") || ($par == "H"))
{return "mticon-humidity";}
if ($par == "UV")
{return "mticon-uv";}
if ($par == "L")
{return "mticon-storm";}
if ($par == "PP2")
{return "mticon-pm10";}
if ($par == "PP3")
{return "mticon-pm2_5";}
if ($par == "CO_2")
{return "mticon-co2";}

return "mticon-1h";
}

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

Re: Extra Sensors in Block StationData

Post by davidefa » Mon Jul 25, 2022 7:36 am

You can attach the zipped archive to a post ( it does not contain any sensible/personal information ), or upload somewhere and pm me the link
Image

User avatar
BONSAI
Observer
Observer
Posts: 35
Joined: Sat Sep 23, 2017 10:59 am
Location: San Sebastian
Station model: Davis Vantage Pro2 Plus
Software: Meteobridge
Contact:

Re: Extra Sensors in Block StationData

Post by BONSAI » Mon Jul 25, 2022 8:17 am

Perfect. Tomorrow I'll do it because I'm now with a tablet.

User avatar
BONSAI
Observer
Observer
Posts: 35
Joined: Sat Sep 23, 2017 10:59 am
Location: San Sebastian
Station model: Davis Vantage Pro2 Plus
Software: Meteobridge
Contact:

Re: Extra Sensors in Block StationData

Post by BONSAI » Tue Jul 26, 2022 7:56 am

Good morning.
I send you as you told me the file StationData.

Thank you
Attachments
statioData.rar
(8.89 KiB) Downloaded 35 times

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

Re: Extra Sensors in Block StationData

Post by davidefa » Tue Aug 02, 2022 5:29 pm

This version should correct the discrepancies you noted.

ver 10.8
- corrected database query for alldata/alldataExtra tables

P.S.
While working with the block I have found a little problem in my database ( that causes an incorrect rain calculation ):
- found that in a few cases the rain in my database is not reset at 00:00 but at 00:05
- this causes an incorrect 'rain duplication'
Not sure why this happen ( but it has something to do with api.php ).
If you want to test if you suffer this problem too I have added an option 'Fix for rain at 00:00':
- if you find that enabling this option your rain totals ( for current year, for example ) change... you are a member of the club : - (
Attachments
stationData_10.8.zip
(9.7 KiB) Downloaded 61 times
Image

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

Re: Extra Sensors in Block StationData

Post by davidefa » Tue Aug 02, 2022 5:52 pm

@BONSAI

In your folder you have a mix of different version of the block ( maybe the result of an incomplete update? ).
Delete the content of the folder ( except the settings.php script with your configuration ), reinstall the block and you should be good to go
Image

User avatar
meteoesine
Forecaster
Forecaster
Posts: 166
Joined: Sun Aug 20, 2017 4:08 pm
Location: Esine, Valcamonica (BS) - Italy
Station model: Davis Pro2+
Software: Meteobridge nano
Contact:

Re: Extra Sensors in Block StationData

Post by meteoesine » Wed Aug 03, 2022 8:19 am

Ciao, the latest version works fine, great.
to be a perfectionist, the lightning displays (today, yesterday, ...) rightly the last detection even days ago, but it would not be better to do a sort of daily reset (I mean, today it should not indicate the number of lightning strikes detected 5 days ago)
thanks
Attachments
ScreenShot01094.jpg
ScreenShot01094.jpg (6.54 KiB) Viewed 2762 times
:arrow: https://meteoesine.it
ham wx aprs/cwop: IW2LAO-13

Image

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: Extra Sensors in Block StationData

Post by MeteoElMasnou » Wed Aug 03, 2022 4:12 pm

David,
I just installed it to test it and it works perfectly. Luckily I was not affected by the rain issue.
Changed colors etc. and working.
The only thing is to change the icons of the PM, since they are all the same. Nothing important

Thank you for your work.

Greetings.

User avatar
BONSAI
Observer
Observer
Posts: 35
Joined: Sat Sep 23, 2017 10:59 am
Location: San Sebastian
Station model: Davis Vantage Pro2 Plus
Software: Meteobridge
Contact:

Re: Extra Sensors in Block StationData

Post by BONSAI » Sat Aug 06, 2022 11:21 am

davidefa wrote: Tue Aug 02, 2022 5:52 pm @BONSAI

In your folder you have a mix of different version of the block ( maybe the result of an incomplete update? ).
Delete the content of the folder ( except the settings.php script with your configuration ), reinstall the block and you should be good to go
Thank you so much for all your help. Having people like you is wonderful.

Julius
Advisor
Advisor
Posts: 89
Joined: Fri Sep 24, 2021 10:41 pm
Station model: Barani MeteoHelix
Software: meteobridge

Re: Extra Sensors in Block StationData

Post by Julius » Sat Aug 27, 2022 3:06 pm

meteoesine wrote: Wed Aug 03, 2022 8:19 am Ciao, the latest version works fine, great.
to be a perfectionist, the lightning displays (today, yesterday, ...) rightly the last detection even days ago, but it would not be better to do a sort of daily reset (I mean, today it should not indicate the number of lightning strikes detected 5 days ago)
thanks
How did you get those red and blue colors in your interactiveGraph and stationData blocks?
Image

User avatar
meteoesine
Forecaster
Forecaster
Posts: 166
Joined: Sun Aug 20, 2017 4:08 pm
Location: Esine, Valcamonica (BS) - Italy
Station model: Davis Pro2+
Software: Meteobridge nano
Contact:

Re: Extra Sensors in Block StationData

Post by meteoesine » Sat Aug 27, 2022 4:06 pm

amending the stationDataBlock.php file starting around line 240
to be added style color#xxxx for each parameter
see below in bold type

<tr>
<td>
<span class="mticon-temp stationDataIcon tooltip" title="<?php echo lang('temperature','c')?>">
</td>
<td style="border-bottom:1px solid #9b9b8c">
<span id="recordsTAvg" class="records"></span>
</td>
<td style="border-bottom:1px solid #9b9b8c">
<span id="recordsTMax" style="color:#FA5858" class="records"></span>
</td>
<td style="border-bottom:1px solid #9b9b8c">
<span id="recordsTMin" style="color:#0cf" class="records"></span>
</td>
</tr>
<tr>
<td>
<span class="mticon-humidity stationDataIcon tooltip" title="<?php echo lang('humidity','c')?>">
</td>
<td style="border-bottom:1px solid #9b9b8c">
<span id="recordsHAvg" class="records"></span>
</td>
<td style="border-bottom:1px solid #9b9b8c">
<span id="recordsHMax" style="color:#FA5858" style="color:#FA5858" class="records"></span>
</td>
<td style="border-bottom:1px solid #9b9b8c">
<span id="recordsHMin" style="color:#0cf" class="records"></span>
</td>
</tr>
.........
:arrow: https://meteoesine.it
ham wx aprs/cwop: IW2LAO-13

Image

Julius
Advisor
Advisor
Posts: 89
Joined: Fri Sep 24, 2021 10:41 pm
Station model: Barani MeteoHelix
Software: meteobridge

Re: Extra Sensors in Block StationData

Post by Julius » Tue Aug 30, 2022 8:53 am

Thanks, that works.

Only addition to this extra sensors in the stationData block I could think of is the ordering of the tables.
For example, I have 3 T sensors in total showing now, and it would be nice to have them stacked near each other.
I tried doing this already myself, tinkering the php layout, but it fails because the extra sensors have a count that's not relevant to the tables that need to go under it. I would ideally have it like:

T1
T
T2
H1
H
H2
all the rest as normal.

But come to think of it, a better option would be a combined interactive graph block. I'm going to try modifying the existing interactive graph so that it shows 3 T sensors in color. This was easily accomplished with the weatherstation plugin for wordpress, where you can generate graphs using any sensor basically combined with any other sensor(s) you want.

Never mind, you already created it!. Man, Davide, you should be paid by Jachym ;)
Image

Julius
Advisor
Advisor
Posts: 89
Joined: Fri Sep 24, 2021 10:41 pm
Station model: Barani MeteoHelix
Software: meteobridge

Re: Extra Sensors in Block StationData

Post by Julius » Sun Nov 06, 2022 12:41 pm

For some really strange reason, most likely after having updated php (still 7.4), both the StationData and the CustomGraph blocks stop loading proper data. The stationData block no longer shows Min or Max values. And similarly, because of that same failure to see historical values, the customGraph can't draw.

@davidefa, do you have any idea what can cause this? I've researched all the logs, but can't find what's causing this.
It's not config, I have restored it to a backup of the entire /etc folder, and changed nothing. So it's probably not file corruption. Perhaps an update has changed permissions somewhere, but mariadb access is all fine.

This is at the bottom of LatestApiLog.txt;

Code: Select all

ERRORS:
No max temperature data provided.
No min temperature data provided.
Meteotemplate MySQL Error: Incorrect file format 'alldata' with query:
            INSERT INTO alldata
            (DateTime,T,Tmax,Tmin,H,P,W,G,B,R,RR,S,D,A)
            values ('2022-11-06 23:35:00',10.5,10.5,10.5,93.0,1003.8,7.9,9.8,198,11.5,0.1,0.0,9.4,8.9
        )
Meteotemplate MySQL Error: Incorrect file format 'alldataExtra' with query:
            INSERT INTO alldata
            (DateTime,T,Tmax,Tmin,H,P,W,G,B,R,RR,S,D,A)
            values ('2022-11-06 23:35:00',10.5,10.5,10.5,93.0,1003.8,7.9,9.8,198,11.5,0.1,0.0,9.4,8.9
        )
I figure you would know what this could be, since I run both blocks from your later (alpha) versions of these Blocks with some custom modifications showing 3 T sensors in one graph and such. This is my site: https://weer.broekermeer.nl/indexDesktop.php
Image

Julius
Advisor
Advisor
Posts: 89
Joined: Fri Sep 24, 2021 10:41 pm
Station model: Barani MeteoHelix
Software: meteobridge

Re: Extra Sensors in Block StationData

Post by Julius » Mon Nov 07, 2022 8:14 am

Suddenly occurred to me that this also coincides with the Daylight Savings Time change! This error has started after restarting the server, but only after the winter-time had been going live.. This could explain the error(s).

Oh how I hate DST.
Image

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

Re: Extra Sensors in Block StationData

Post by davidefa » Tue Nov 08, 2022 9:57 pm

The 'incorrect file format' error should mean that the table is corrupted
You can repair tables alldata and alldataExtra with the following command ( in phpmyadmin select the meteotemplate database and in the SQL tab execute the following commands )

Code: Select all

repair table alldata use_frm;

Code: Select all

repair table alldataExtra use_frm;
P.S.
It is always a good idea to make a backup of the database before executing these commands ( not sure the backup will succeed in this case, but I'm not a db expert )
Image

Julius
Advisor
Advisor
Posts: 89
Joined: Fri Sep 24, 2021 10:41 pm
Station model: Barani MeteoHelix
Software: meteobridge

Re: Extra Sensors in Block StationData

Post by Julius » Wed Nov 09, 2022 8:15 pm

Unfortunately, this did not fix it. Still not working.
And now even the netatmo data says "Offline", while it's still there when I look at netatmo itself.
Strange. Still pretty sure this has to do with updated php modules. It all stopped working right after that..
Image

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

Re: Extra Sensors in Block StationData

Post by davidefa » Wed Nov 09, 2022 10:31 pm

I see in cache/apiLog.txt that the last update is dated 2022-11-07 00:25:02 and from weatherflowNet plugin

Code: Select all

2022-11-07 00:25:02
INFOS:
Handling data from weatherflowNet
update 'U' = 1667777056 (2022-11-07 00:24:16)
Is the cron job executing correctly?
Try calling in your browser ( insert your update password ):

Code: Select all

https://weer.broekermeer.nl/load/cron.php?password=YOURPASSWORD&errors
Does it report any fatal error/warning ?
You may also update api.php script with the attached one ( it should correct a bug when calling api.php using 'require' from inside another script, as done by the weaterflowNet plugin )
Attachments
api_3.5.zip
(12.63 KiB) Downloaded 42 times
Image

Post Reply