"[rain0total-sumday]" showing up instead of number *solved*

All about the standard Meteobridge devices based on mobile routers from TP-Link, D-Link, ASUS

Moderator: Mattk

Post Reply
Medor
Junior Boarder
Junior Boarder
Posts: 31
Joined: Sun Apr 21, 2013 10:00 pm

"[rain0total-sumday]" showing up instead of number *solved*

Post by Medor »

I have my Meteobridge sending data every minute to my server through an HTTP push. The Meteobridge local time is on time zone Europe/Paris, currently UTC+2 (summer time).
The data is processed by a PHP script which feeds a plain texte file, 1 new line every hour, discarding the intermediate data.

As displayed in this text file, the rain total for the current day ("mm/jour") is reset to 0 and feeds the rain total for the previous day (mm/hier) at midnight local time, which is normal.
But somedays, at midnight local time, the current day rainfall column in the text file shows the raw descriptor "[rain0total-sumday]" instead of a proper number.
Is this a special code which is sent at this exact time by Meteobridge which the PHP script should understand as meaning "not available" or something like that ?

Extract from the text file:

Code: Select all

Date------UTC-----OutTemp--OutHum-InTemp-Vent-Rafale---mm/h---mm/jour--------mm/hier------solTemp--solHum1--solHum2
17/09/2014	21:00	22.1	76.0	23.9	3.2	7.6	  0.0	  0.2	          0.0	      20.6	200	     200	
17/09/2014	22:00	20.7	81.0	23.8	1.4	4.5	  0.0     [rain0total-sumday] 0.0     20.0   200	     200	
17/09/2014	23:00	20.1	82.0	23.9	1.7	5.8	  0.0	  0.0	          0.2	      20.0	200	     200
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7874
Joined: Mon Oct 01, 2007 10:51 pm

Re: "[rain0total-sumday]" showing up instead of a number

Post by admin »

When rain sensor is offline for a too long time, the variable will not be replaced but appear literally.

There is a simple measure to set in a default values in case of this as explained in the wiki.

[rain0total-sumday:0] does the trick.
Mattk
Platinum Boarder
Platinum Boarder
Posts: 1395
Joined: Mon Sep 22, 2014 3:24 am

Re: "[rain0total-sumday]" showing up instead of number *solv

Post by Mattk »

This appears more like a midnight (00:00) rollover issue?
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7874
Joined: Mon Oct 01, 2007 10:51 pm

Re: "[rain0total-sumday]" showing up instead of number *solv

Post by admin »

Mattk wrote:This appears more like a midnight (00:00) rollover issue?
yes, this can also be the reason for being no data there for the new day. However, the ":" default does the trick,
Mattk
Platinum Boarder
Platinum Boarder
Posts: 1395
Joined: Mon Sep 22, 2014 3:24 am

Re: "[rain0total-sumday]" showing up instead of number *solv

Post by Mattk »

Yes the default might do the trick on the output but doesn't really solve the input causing this default to trigger.
Post Reply