Page 1 of 1
Including additional sensor data in the database
Posted: Tue Apr 19, 2022 7:58 pm
by AstroJAV
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 (27.08 KiB) Viewed 6698 times
Thanks in advance for any help.
Jairo
Re: Including additional sensor data in the database
Posted: Tue Apr 19, 2022 10:52 pm
by davidefa
- 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 )
Re: Including additional sensor data in the database
Posted: Thu Apr 21, 2022 1:03 am
by AstroJAV
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
Re: Including additional sensor data in the database
Posted: Fri Apr 29, 2022 6:27 pm
by alexvanuxem
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
Re: Including additional sensor data in the database
Posted: Fri Apr 29, 2022 10:38 pm
by davidefa
Added SQM ( check limits... in api.php near line 902 )
Re: Including additional sensor data in the database
Posted: Fri May 20, 2022 8:42 pm
by alexvanuxem
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