Including additional sensor data in the database

Post Reply
AstroJAV
Newbie
Newbie
Posts: 2
Joined: Sun Mar 27, 2022 8:57 pm
Location: Aruba
Station model: MySQM+ Custom built
Software: Arduino IDE
Contact:

Including additional sensor data in the database

Post by AstroJAV » Tue Apr 19, 2022 7:58 pm

Hi folks,

I have a custom build weather station that is sending the following list of sensor data. I am able to integrate the Ambient Temperature, Humidity, Dewpoint, and Pressure in the meteotemplate database. I was wondering how I could integrate the rest of the data, especially the Sky Quality Measurement (SQM), Near-Eye Limiting Magnitude (NELM), and LUX?
Screenshot 2022-04-19 155640.png
Screenshot 2022-04-19 155640.png (27.08 KiB) Viewed 1289 times
Thanks in advance for any help.

Jairo

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

Re: Including additional sensor data in the database

Post by davidefa » Tue Apr 19, 2022 10:52 pm

- every field you pass to api.php will be reflected ( and accessible ) in the file meteotemplateLive.txt
( this file is used by blocks that need last/instantaneous values )
- if you want to save these new fields in the database ( table alldataExtra ) you have to modify: api.php, update/apiSetup.php and update/saveAPISettings.php
( comparing the original files with this version which have a few sensors added, you can easily see what to modify )

Next step is to modify blocks and plugins to access your new fields...


P.S.
If you want, you could use the solar radiation 'S' field to store the lux reading ( my weather station has a luxmeter sensor and converts, or approximates, the reading to w/m2 )
If you have a link to a description of your station/sensors/software, please, share
Please add a link to your site ( for example in your contact informations )
Image

AstroJAV
Newbie
Newbie
Posts: 2
Joined: Sun Mar 27, 2022 8:57 pm
Location: Aruba
Station model: MySQM+ Custom built
Software: Arduino IDE
Contact:

Re: Including additional sensor data in the database

Post by AstroJAV » Thu Apr 21, 2022 1:03 am

Hi David,

Thanks for the prompt response.
I am no programmer but can follow instructions quite well.
Would it be much to ask if you could modify the api.php, apiSetup.php, and saveAPISettings.php for at least one data, e.g., the SQM data? I can then use the PHP files as a guideline to integrate the other data. :)

Also, as a reference below is the project MySQM+ that I followed to make the custom build weather station which I currently sending data to Meteotemplate.

https://sourceforge.net/projects/mysqmp ... yj2Ixrg67w

Jairo

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: Including additional sensor data in the database

Post by alexvanuxem » Fri Apr 29, 2022 6:27 pm

about the lux reading 'S'....

I have a davis vantage pro 2.

in https://www.sint-katelijne-waver-meteo. ... /index.php

it records also the lux.

so my station records also lux ?

how can i incorporate the 'S'?

thx
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: Including additional sensor data in the database

Post by davidefa » Fri Apr 29, 2022 10:38 pm

Added SQM ( check limits... in api.php near line 902 )
Attachments
sensors8_1.1c.zip
(18.25 KiB) Downloaded 32 times
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: Including additional sensor data in the database

Post by alexvanuxem » Fri May 20, 2022 8:42 pm

my last remark was a faulty assumption I saw in
https://www.sint-katelijne-waver-meteo. ... /index.php

lux readings, so I thought my station was uploading lux, my apologies.

learning day by day,

cheers
Image

Post Reply